CVE-2022-49371

Source
https://cve.org/CVERecord?id=CVE-2022-49371
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49371.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2022-49371
Downstream
Related
Published
2025-02-26T02:11:13.652Z
Modified
2026-04-02T08:27:31.727430Z
Severity
  • 5.5 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
driver core: fix deadlock in __device_attach
Details

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

driver core: fix deadlock in _deviceattach

In __device_attach function, The lock holding logic is as follows: ... __deviceattach devicelock(dev) // get lock dev asyncscheduledev(__deviceattachasynchelper, dev); // func asyncschedulenode asyncschedulenodedomain(func) entry = kzalloc(sizeof(struct asyncentry), GFPATOMIC); /* when fail or work limit, sync to execute func, but _deviceattachasynchelper will get lock dev as well, which will lead to A-A deadlock. */ if (!entry || atomicread(&entrycount) > MAXWORK) { func; else queueworknode(node, systemunboundwq, &entry->work) deviceunlock(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 _deviceattachasynchelper getting lock dev.

To fix the deadlock, move the asyncscheduledev outside devicelock, as we can see, in asyncschedulenodedomain, the parameter of queueworknode is systemunboundwq, so it can accept concurrent operations. which will also not change the code logic, and will not lead to deadlock.

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49371.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
765230b5f084863183aa8adb3405ab3f32c0b16e
Fixed
593b595332bd2d65e1a5c1ae7897996c157f5468
Fixed
36ee9ffca8ef56c302f2855c4a5fccf61c0c1ada
Fixed
df6de52b80aa3b46f5ac804412355ffe2e1df93e
Fixed
d53a227bfcd5160ce1b61d9954901968a20651e7
Fixed
34fdd9b7def9d2fcb71bb7b0bc4848dd7313767e
Fixed
b232b02bf3c205b13a26dcec08e53baddd8e59ed

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49371.json"