Re: [PATCH v2] pinctrl: fix deadlock in create_pinctrl() when handling -EPROBE_DEFER

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 4, 2024 at 10:58 AM Hagar Hemdan <hagarhem@xxxxxxxxxx> 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@xxxxxxxxx>
> Signed-off-by: Hagar Hemdan <hagarhem@xxxxxxxxxx>

Looks like a real issue so patch applied for fixes.

Yours,
Linus Walleij





[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux