# CVE-2022-49371: driver core: fix deadlock in __device_attach

- Severity: Medium 5.5 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.21%, higher than 12% of CVEs (2026-12-01)
- Published: 2025-02-26T02:11:13.652Z
- Modified: 2026-06-17T05:17:51.317Z
- Weaknesses: CWE-667
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

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

driver core: fix deadlock in __device_attach

In __device_attach function, The lock holding logic is as follows:
...
__device_attach
device_lock(dev)      // get lock dev
  async_schedule_dev(__device_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
	   __device_attach_async_helper will get lock dev as
	   well, 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 shown above, when it is allowed to do async probes, because of
out of memory or work limit, async work is not allowed, to do
sync execute instead. it will lead to A-A deadlock because of
__device_attach_async_helper getting lock dev.

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.

(As written by CVE List.)

## Affected

- Linux Linux: from 765230b5f084863183aa8adb3405ab3f32c0b16e before 593b595332bd2d65e1a5c1ae7897996c157f5468; from 765230b5f084863183aa8adb3405ab3f32c0b16e before 36ee9ffca8ef56c302f2855c4a5fccf61c0c1ada; from 765230b5f084863183aa8adb3405ab3f32c0b16e before df6de52b80aa3b46f5ac804412355ffe2e1df93e; from 765230b5f084863183aa8adb3405ab3f32c0b16e before d53a227bfcd5160ce1b61d9954901968a20651e7; from 765230b5f084863183aa8adb3405ab3f32c0b16e before 34fdd9b7def9d2fcb71bb7b0bc4848dd7313767e; from 765230b5f084863183aa8adb3405ab3f32c0b16e before b232b02bf3c205b13a26dcec08e53baddd8e59ed; 4.2 (not affected: before 4.2; from 5.4.198 up to 5.4.*; from 5.10.122 up to 5.10.*; from 5.15.47 up to 5.15.*; from 5.17.15 up to 5.17.*; from 5.18.4 up to 5.18.*; from 5.19 up to *)
- linux linux_kernel: from 4.2 before 5.4.198; from 5.5 before 5.10.122; from 5.11 before 5.15.47; from 5.16 before 5.17.15; from 5.18 before 5.18.4

## Every score

- CISA-ADP: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://git.kernel.org/stable/c/593b595332bd2d65e1a5c1ae7897996c157f5468> (patch)
- <https://git.kernel.org/stable/c/36ee9ffca8ef56c302f2855c4a5fccf61c0c1ada> (patch)
- <https://git.kernel.org/stable/c/df6de52b80aa3b46f5ac804412355ffe2e1df93e> (patch)
- <https://git.kernel.org/stable/c/d53a227bfcd5160ce1b61d9954901968a20651e7> (patch)
- <https://git.kernel.org/stable/c/34fdd9b7def9d2fcb71bb7b0bc4848dd7313767e> (patch)
- <https://git.kernel.org/stable/c/b232b02bf3c205b13a26dcec08e53baddd8e59ed> (patch)

## Sources

- CVE List: [CVE-2022-49371](https://www.cve.org/CVERecord?id=CVE-2022-49371), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2022-49371](https://nvd.nist.gov/vuln/detail/CVE-2022-49371), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-49371 · Whole record: https://cve.day/CVE-2022-49371.json · Rebuilt by cve.day 2026-11-25T22:58:20.470Z
