pinctrl: fix deadlock in create_pinctrl() when handling -EPROBE_DEFER
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 42fed7ba44e4e8c1fb27b28ad14490cb1daff3c7 · < 4038c57bf61631219b31f1bd6e92106ec7f084dc| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
pinctrl: fix deadlock in create_pinctrl() when handling -EPROBE_DEFER
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.
From the CVE record · Linux
The Linux kernel's pinctrl code can deadlock when add_setting() returns -EPROBE_DEFER: create_pinctrl() calls pinctrl_free() while holding a mutex that pinctrl_free() tries to acquire. The input does not describe an attacker route, authentication requirement, or user interaction needed to reach this condition.
Engineers running the Linux kernel should check whether their kernel includes the affected pinctrl code; affected versions are not specified.