Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796203970; b=IjsoY7G4CfuACY4TTrhfMYrEAOQiXjpW0uQXnNe0Re1iloyUFu+OISV5GjnuR/HTlDmn P2jvGyRZ/3jZ4Hbnms/4lEB/IeGD9qfhVWIsklYqYhQkMcl8nHQkTPchpZenkuUPRGb5t 83iG/sAjINC0pN//jK11Dr0v5kqVdkdMQE26+Ln/imrYS+R5T9/HTGKxLolcNbm4bD+F0 54nTFXqh6FYJ1Ijcrfr+JfQrsY/n2+my6oJUK/Pj1IsEERVQpgPryGdiu5LbsVEDtbHTw Rj3pzHncdXNXtb2kOwdFf/MWrmjRLwDcybUDWoLqgggN3c44+Ccs4DXH8ODf4wGyQDQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796203970; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=yagTQoshnwfOCV7VnKlxagKPAeBef5Vjs0iNmBPOxR0=; b=SeZ8WJLbc6zVDiWhoB7nJW2IB6z+2q2+Kar3skuNsScjiKuaZXMmwoQFbXOMz0SS72to z68exxl/F7VGsexsgHYfYMXSogVgkX26u6aeFQ7m++6R4zYWbsDMYmHIuS/1Gjw+WagLe ArsXZPalbZ+PjMofIxifyRKk538gO+LB6d4APvChlLwhnJ6QQ4OfSvwBSzj29lGqXZEIc iVQMsuB+mhuKrGysWdg8IG5VMWgwr/bgEF7dn/hO+GbxiEGFu3ZaiLckqNNj2nvk1s6L9 oEeIwQXGruu6hHmIwd9ApiEhvSUwIKfE2hNHWI7hy01sMBYuUmJ9tIpunHWDg0uiz8A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="F115Q/0S"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 87532606A331; Wed, 2 Dec 2026 09:32:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=F115Q/0S Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73FC31F00893; Wed, 2 Dec 2026 09:32:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796203969; bh=yagTQoshnwfOCV7VnKlxagKPAeBef5Vjs0iNmBPOxR0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=F115Q/0STAM9t+GO5n4ldPUmf80jtgRMjHxL83DXAhGgOkJ3nbc90W3uWcEyVuCSq MdRKTAP86O3k+9PjoAH1xekS+WT611DCf1htcydUfNV1b6SnuPPUahSFf24LmnCD0f Ta8RsopPABsRbfGg+Kk+yALYgCTrFAJcB18NhahFQz8PB9Z86jTULNY5oo99Nafm/O kMkiKuzBAgJ7Q0Znm3lZAwyYk3HAsKhEnJZ2QZtOSE2VWEuscSBRgIX8oQCvTGrJQe +63t/8Duem8coxd+m0LEyiuItBmoCi6tJT/jB9iSao24H0UapMwsfN7CyV6DtP9XHE Jx8087FAdSpYA== From: Lee Jones To: lee@kernel.org, Linus Walleij , Lokesh Vutla , Rob Herring , Nishanth Menon , Tony Lindgren , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Subject: [PATCH 09/12] pinctrl: ti: iodelay: Protect generic group addition with pctldev->mutex Date: Wed, 2 Dec 2026 09:30:03 +0000 Message-ID: <6c2699633b5638906b68fdfce780823bee32851e.1796203691.git.lee@kernel.org> X-Mailer: git-send-email 2.56.1.911.g883d8bcb20-goog In-Reply-To: References: X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ti_iodelay_dt_node_to_map() calls pinctrl_generic_add_group() and pinctrl_generic_get_group() without holding iod->pctl->mutex. Both helpers expect the caller to hold pctldev->mutex to serialise radix tree mutations against concurrent consumer probes and pinctrl core debugfs readers. Acquire iod->pctl->mutex around pinctrl_generic_add_group() and the subsequent pinctrl_generic_get_group() deduplication check. Fixes: 003910ebc83b ("pinctrl: Introduce TI IOdelay configuration driver") Closes: https://sashiko.dev/#/bug/linux-3aaee4c1-6bf8-47f0-b590-fb336372c247 Cc: stable@vger.kernel.org Signed-off-by: Lee Jones --- drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c index 4a48cebbf2b3..f52d0af0794d 100644 --- a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c +++ b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -550,9 +551,12 @@ static int ti_iodelay_dt_node_to_map(struct pinctrl_dev *pctldev, g->ncfg = i; g->config = PIN_CONFIG_END; + mutex_lock(&iod->pctl->mutex); error = pinctrl_generic_add_group(iod->pctl, np->name, pins, i, g); - if (error < 0) + if (error < 0) { + mutex_unlock(&iod->pctl->mutex); goto free_data; + } /* * The core deduplicates groups by name and keeps the first for the @@ -566,6 +570,7 @@ static int ti_iodelay_dt_node_to_map(struct pinctrl_dev *pctldev, devm_kfree(iod->dev, g); g = grp->data; } + mutex_unlock(&iod->pctl->mutex); (*map)->type = PIN_MAP_TYPE_CONFIGS_GROUP; (*map)->data.configs.group_or_pin = np->name; -- 2.56.1.911.g883d8bcb20-goog