driver core: fix deadlock in __device_attach
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.
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 5.10.122, 5.15.47, 5.17.15, 5.18.4, 5.4.198
- CVEs
- CVE-2022-49371
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 7 Nov 2026, 04:38 UTC · Revision 1
Source evidence
driver core: fix deadlock in __device_attach
core-osv · Original sourcePublished 26 Feb 2025, 02:11 UTC
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.
osv:CVE-2022-49371
Kernel
Fixed versions: 5.4.198, 5.10.122, 5.15.47, 5.17.15, 5.18.4
Complete source record
{
"id": "bf85d9a10f8b164d882679b23ce041edf3a8bd5b987345bc8b4af97aafe58d9a",
"url": "https://osv.dev/vulnerability/CVE-2022-49371",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "driver core: fix deadlock in __device_attach",
"summary": "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.",
"evidence": "osv:CVE-2022-49371",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "5.4.198",
"evidence": "/affected/1/ranges"
},
{
"value": "5.10.122",
"evidence": "/affected/1/ranges"
},
{
"value": "5.15.47",
"evidence": "/affected/1/ranges"
},
{
"value": "5.17.15",
"evidence": "/affected/1/ranges"
},
{
"value": "5.18.4",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "medium",
"structured": {
"id": "CVE-2022-49371",
"aliases": [
"CVE-2022-49371"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "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"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "4.2.0"
},
{
"fixed": "5.4.198"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.5.0"
},
{
"fixed": "5.10.122"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.11.0"
},
{
"fixed": "5.15.47"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.16.0"
},
{
"fixed": "5.17.15"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.18.0"
},
{
"fixed": "5.18.4"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49371.json"
}
}
],
"modified": "2026-10-28T02:30:49.830132798Z",
"provider": "osv",
"references": [
"https://git.kernel.org/stable/c/34fdd9b7def9d2fcb71bb7b0bc4848dd7313767e",
"https://git.kernel.org/stable/c/36ee9ffca8ef56c302f2855c4a5fccf61c0c1ada",
"https://git.kernel.org/stable/c/593b595332bd2d65e1a5c1ae7897996c157f5468",
"https://git.kernel.org/stable/c/b232b02bf3c205b13a26dcec08e53baddd8e59ed",
"https://git.kernel.org/stable/c/d53a227bfcd5160ce1b61d9954901968a20651e7",
"https://git.kernel.org/stable/c/df6de52b80aa3b46f5ac804412355ffe2e1df93e",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49371.json",
"https://nvd.nist.gov/vuln/detail/CVE-2022-49371",
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
],
"provider_metadata": {
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49371.json"
}
},
"related_cves": [
{
"value": "CVE-2022-49371",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 518196,
"published_at": "2025-02-26T02:11:13.652+00:00"
}