# CVE-2022-50149: driver core: fix potential deadlock in \_\_driver\_attach

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.21% (percentile 7, 2026-11-26)
- **CWE:** CWE-667
- **Published:** 2025-06-18T11:03:09.099Z
- **Modified:** 2026-06-17T05:22:51.597Z

## Who should check

- Anyone running Linux \>= ef0ff68351be4fd83bec2d797f0efdc0174a55a4, \< 8191b6cd9ada09b675f17446d5872eb1f77685cb; \>= ef0ff68351be4fd83bec2d797f0efdc0174a55a4, \< a93f33aeef4e6a94ae9c9d3f5b2f9085ad0572ec; \>= ef0ff68351be4fd83bec2d797f0efdc0174a55a4, \< 733ab0c19bf17f6ad7c2b580ede006e369d5ab1b; \>= ef0ff68351be4fd83bec2d797f0efdc0174a55a4, \< 779b634714c51d05baaeff4868ce2fd9fc7399bf; \>= ef0ff68351be4fd83bec2d797f0efdc0174a55a4, \< 37f908038402c9b8325763f306a1c65d88757e15; \>= ef0ff68351be4fd83bec2d797f0efdc0174a55a4, \< 70fe758352cafdee72a7b13bf9db065f9613ced8
- Anyone running Linux 5.1

## Description

In the Linux kernel, the following vulnerability has been resolved:

driver core: fix potential deadlock in \_\_driver\_attach

In \_\_driver\_attach function, There are also AA deadlock problem,
like the commit b232b02bf3c2 ("driver core: fix deadlock in
\_\_device\_attach").

stack like commit b232b02bf3c2 ("driver core: fix deadlock in
\_\_device\_attach").
list below:
    In \_\_driver\_attach function, The lock holding logic is as follows:
    ...
    \_\_driver\_attach
    if (driver\_allows\_async\_probing(drv))
      device\_lock(dev)      // get lock dev
        async\_schedule\_dev(\_\_driver\_attach\_async\_helper, dev); // func
          async\_schedule\_node
            async\_schedule\_node\_domain(func)
              entry = kzalloc(sizeof(struct async\_entry), GFP\_ATOMIC);
              /\* when fail or work limit, sync to execute func, but
                 \_\_driver\_attach\_async\_helper will get lock dev as
                 will, which will lead to A-A deadlock.  \*/
              if (!entry \|\| atomic\_read(&entry\_count) \> MAX\_WORK) {
                func;
              else
                queue\_work\_node(node, system\_unbound\_wq, &entry-\>work)
      device\_unlock(dev)

    As above show, when it is allowed to do async probes, because of
    out of memory or work limit, async work is not be allowed, to do
    sync execute instead. it will lead to A-A deadlock because of
    \_\_driver\_attach\_async\_helper getting lock dev.

Reproduce:
and it can be reproduce by make the condition
(if (!entry \|\| atomic\_read(&entry\_count) \> MAX\_WORK)) untenable, like
below:

\[  370.785650\] "echo 0 \> /proc/sys/kernel/hung\_task\_timeout\_secs" disables
this message.
\[  370.787154\] task:swapper/0       state:D stack:    0 pid:    1 ppid:
0 flags:0x00004000
\[  370.788865\] Call Trace:
\[  370.789374\]  \<TASK\>
\[  370.789841\]  \_\_schedule+0x482/0x1050
\[  370.790613\]  schedule+0x92/0x1a0
\[  370.791290\]  schedule\_preempt\_disabled+0x2c/0x50
\[  370.792256\]  \_\_mutex\_lock.isra.0+0x757/0xec0
\[  370.793158\]  \_\_mutex\_lock\_slowpath+0x1f/0x30
\[  370.794079\]  mutex\_lock+0x50/0x60
\[  370.794795\]  \_\_device\_driver\_lock+0x2f/0x70
\[  370.795677\]  ? driver\_probe\_device+0xd0/0xd0
\[  370.796576\]  \_\_driver\_attach\_async\_helper+0x1d/0xd0
\[  370.797318\]  ? driver\_probe\_device+0xd0/0xd0
\[  370.797957\]  async\_schedule\_node\_domain+0xa5/0xc0
\[  370.798652\]  async\_schedule\_node+0x19/0x30
\[  370.799243\]  \_\_driver\_attach+0x246/0x290
\[  370.799828\]  ? driver\_allows\_async\_probing+0xa0/0xa0
\[  370.800548\]  bus\_for\_each\_dev+0x9d/0x130
\[  370.801132\]  driver\_attach+0x22/0x30
\[  370.801666\]  bus\_add\_driver+0x290/0x340
\[  370.802246\]  driver\_register+0x88/0x140
\[  370.802817\]  ? virtio\_scsi\_init+0x116/0x116
\[  370.803425\]  scsi\_register\_driver+0x1a/0x30
\[  370.804057\]  init\_sd+0x184/0x226
\[  370.804533\]  do\_one\_initcall+0x71/0x3a0
\[  370.805107\]  kernel\_init\_freeable+0x39a/0x43a
\[  370.805759\]  ? rest\_init+0x150/0x150
\[  370.806283\]  kernel\_init+0x26/0x230
\[  370.806799\]  ret\_from\_fork+0x1f/0x30

To fix the deadlock, move the async\_schedule\_dev outside device\_lock,
as we can see, in async\_schedule\_node\_domain, the parameter of
queue\_work\_node is system\_unbound\_wq, so it can accept concurrent
operations. which will also not change the code logic, and will
not lead to deadlock.

## Affected and fixed versions

- Linux: \>= ef0ff68351be4fd83bec2d797f0efdc0174a55a4, \< 8191b6cd9ada09b675f17446d5872eb1f77685cb; \>= ef0ff68351be4fd83bec2d797f0efdc0174a55a4, \< a93f33aeef4e6a94ae9c9d3f5b2f9085ad0572ec; \>= ef0ff68351be4fd83bec2d797f0efdc0174a55a4, \< 733ab0c19bf17f6ad7c2b580ede006e369d5ab1b; \>= ef0ff68351be4fd83bec2d797f0efdc0174a55a4, \< 779b634714c51d05baaeff4868ce2fd9fc7399bf; \>= ef0ff68351be4fd83bec2d797f0efdc0174a55a4, \< 37f908038402c9b8325763f306a1c65d88757e15; \>= ef0ff68351be4fd83bec2d797f0efdc0174a55a4, \< 70fe758352cafdee72a7b13bf9db065f9613ced8 (cvelist)
- Linux: 5.1 (cvelist)

## Mitigation

- Upgrade Linux to 70fe758352cafdee72a7b13bf9db065f9613ced8 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2022-50149. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-50149.md
Affected: Linux >= ef0ff68351be4fd83bec2d797f0efdc0174a55a4, < 8191b6cd9ada09b675f17446d5872eb1f77685cb; >= ef0ff68351be4fd83bec2d797f0efdc0174a55a4, < a93f33aeef4e6a94ae9c9d3f5b2f9085ad0572ec; >= ef0ff68351be4fd83bec2d797f0efdc0174a55a4, < 733ab0c19bf17f6ad7c2b580ede006e369d5ab1b; >= ef0ff68351be4fd83bec2d7…
Fixed in: Linux 8191b6cd9ada09b675f17446d5872eb1f77685cb, Linux 733ab0c19bf17f6ad7c2b580ede006e369d5ab1b, Linux 779b634714c51d05baaeff4868ce2fd9fc7399bf, Linux 37f908038402c9b8325763f306a1c65d88757e15, Linux 70fe758352cafdee72a7b13bf9db065f9613ced8

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2022-50149 being exploited?

There is no confirmed exploitation: CVE-2022-50149 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.21% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2022-50149?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2022-50149?

Linux \>= ef0ff68351be4fd83bec2d797f0efdc0174a55a4, \< 8191b6cd9ada09b675f17446d5872eb1f77685cb; \>= ef0ff68351be4fd83bec2d797f0efdc0174a55a4, \< a93f33aeef4e6a94ae9c9d3f5b2f9085ad0572ec; \>= ef0ff68351be4fd83bec2d797f0efdc0174a55a4, \< 733ab0c19bf17f6ad7c2b580ede006e369d5ab1b; \>= ef0ff68351be4fd83bec2d797f0efdc0174a55a4, \< 779b634714c51d05baaeff4868ce2fd9fc7399bf; \>= ef0ff68351be4fd83bec2d797f0efdc0174a55a4, \< 37f908038402c9b8325763f306a1c65d88757e15; \>= ef0ff68351be4fd83bec2d797f0efdc0174a55a4, \< 70fe758352cafdee72a7b13bf9db065f9613ced8; Linux 5.1.

### Is there a fix for CVE-2022-50149?

Yes. Fixed in Linux 8191b6cd9ada09b675f17446d5872eb1f77685cb, Linux 733ab0c19bf17f6ad7c2b580ede006e369d5ab1b, Linux 779b634714c51d05baaeff4868ce2fd9fc7399bf, Linux 37f908038402c9b8325763f306a1c65d88757e15, Linux 70fe758352cafdee72a7b13bf9db065f9613ced8. Upgrade Linux to 70fe758352cafdee72a7b13bf9db065f9613ced8 or later.

### How do I check if I'm affected by CVE-2022-50149?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/8191b6cd9ada09b675f17446d5872eb1f77685cb>
- patch: <https://git.kernel.org/stable/c/a93f33aeef4e6a94ae9c9d3f5b2f9085ad0572ec>
- patch: <https://git.kernel.org/stable/c/733ab0c19bf17f6ad7c2b580ede006e369d5ab1b>
- patch: <https://git.kernel.org/stable/c/779b634714c51d05baaeff4868ce2fd9fc7399bf>
- patch: <https://git.kernel.org/stable/c/37f908038402c9b8325763f306a1c65d88757e15>
- patch: <https://git.kernel.org/stable/c/70fe758352cafdee72a7b13bf9db065f9613ced8>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-50149>

HTML: <https://flawdb.com/CVE-2022-50149> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-50149>
