linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Hagar Hemdan <hagarhem@amazon.com>
Cc: Maximilian Heyne <mheyne@amazon.de>,
	Norbert Manthey <nmanthey@amazon.de>,
	 Patrice Chotard <patrice.chotard@st.com>,
	linux-gpio@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] pinctrl: fix deadlock in create_pinctrl() when handling -EPROBE_DEFER
Date: Mon, 17 Jun 2024 09:55:37 +0200	[thread overview]
Message-ID: <CACRpkdbWeMtQ5upOQR--6RYzwcD+N_2o3OA11zT-sPr_SnQWwQ@mail.gmail.com> (raw)
In-Reply-To: <20240604085838.3344-1-hagarhem@amazon.com>

On Tue, Jun 4, 2024 at 10:58 AM Hagar Hemdan <hagarhem@amazon.com> wrote:

> In create_pinctrl(), pinctrl_maps_mutex is acquired before calling
> add_setting(). If add_setting() returns -EPROBE_DEFER, create_pinctrl()
> calls pinctrl_free(). However, pinctrl_free() attempts to acquire
> pinctrl_maps_mutex, which is already held by create_pinctrl(), leading to
> a potential deadlock.
>
> This patch resolves the issue by releasing pinctrl_maps_mutex before
> calling pinctrl_free(), preventing the deadlock.
>
> This bug was discovered and resolved using Coverity Static Analysis
> Security Testing (SAST) by Synopsys, Inc.
>
> Fixes: 42fed7ba44e4 ("pinctrl: move subsystem mutex to pinctrl_dev struct")
> Suggested-by: Maximilian Heyne <mheyne@amazon.de>
> Signed-off-by: Hagar Hemdan <hagarhem@amazon.com>

Looks like a real issue so patch applied for fixes.

Yours,
Linus Walleij

      reply	other threads:[~2024-06-17  7:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-04  8:58 [PATCH v2] pinctrl: fix deadlock in create_pinctrl() when handling -EPROBE_DEFER Hagar Hemdan
2024-06-17  7:55 ` Linus Walleij [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACRpkdbWeMtQ5upOQR--6RYzwcD+N_2o3OA11zT-sPr_SnQWwQ@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=hagarhem@amazon.com \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mheyne@amazon.de \
    --cc=nmanthey@amazon.de \
    --cc=patrice.chotard@st.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).