CVE-2022-49371
driver core: fix deadlock in __device_attach
Check your servers for CVE-2022-49371
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2022-49371 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
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.
Severity (CVSS)
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
- Attack vector
- local: the attacker needs local access, or a user has to open a prepared file
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- low: the attacker needs an ordinary user account
- User interaction
- none: nobody has to click or open anything
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality none, integrity none, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 0.21%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 12.4% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 1 Oct 2025):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- no: each attack takes manual steps
- Technical impact
- partial: limited control or limited data
Weakness
- CWE-667 Improper Locking
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from 765230b5f084863183aa8adb3405ab3f32c0b16e, before 593b595332bd2d65e1a5c1ae7897996c157f5468 affected from 765230b5f084863183aa8adb3405ab3f32c0b16e, before 36ee9ffca8ef56c302f2855c4a5fccf61c0c1ada affected from 765230b5f084863183aa8adb3405ab3f32c0b16e, before df6de52b80aa3b46f5ac804412355ffe2e1df93e affected from 765230b5f084863183aa8adb3405ab3f32c0b16e, before d53a227bfcd5160ce1b61d9954901968a20651e7 affected from 765230b5f084863183aa8adb3405ab3f32c0b16e, before 34fdd9b7def9d2fcb71bb7b0bc4848dd7313767e affected from 765230b5f084863183aa8adb3405ab3f32c0b16e, before b232b02bf3c205b13a26dcec08e53baddd8e59ed
Other versions: unaffected
|
| Linux |
affected 4.2 unaffected before 4.2 unaffected from 5.4.198 up to and including 5.4.* unaffected from 5.10.122 up to and including 5.10.* unaffected from 5.15.47 up to and including 5.15.* unaffected from 5.17.15 up to and including 5.17.* unaffected from 5.18.4 up to and including 5.18.* unaffected 5.19 and later
Other versions: affected
|
Is my server affected?
This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:
uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2022-49371 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2022-49371
With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2022-49371
trivy image --scanners vuln IMAGE | grep CVE-2022-49371
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Other references
- https://git.kernel.org/stable/c/593b595332bd2d65e1a5c1ae7897996c157f5468 git.kernel.org
- https://git.kernel.org/stable/c/36ee9ffca8ef56c302f2855c4a5fccf61c0c1ada git.kernel.org
- https://git.kernel.org/stable/c/df6de52b80aa3b46f5ac804412355ffe2e1df93e git.kernel.org
- https://git.kernel.org/stable/c/d53a227bfcd5160ce1b61d9954901968a20651e7 git.kernel.org
- https://git.kernel.org/stable/c/34fdd9b7def9d2fcb71bb7b0bc4848dd7313767e git.kernel.org
- https://git.kernel.org/stable/c/b232b02bf3c205b13a26dcec08e53baddd8e59ed git.kernel.org
Source: the record CVE-2022-49371 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse