writeback: avoid use-after-free after removing device
In the Linux kernel, the following vulnerability has been resolved: writeback: avoid use-after-free after removing device When a disk is removed, bdi_unregister gets called to stop further writeback and wait for associated delayed work to complete. However, wb_inode_writeback_end() may schedule bandwidth estimation dwork after this has completed, which can result in the timer attempting to access the just freed bdi_writeback. Fix this by checking if the bdi_writeback is alive, similar to when scheduling writeback work. Since this requires wb->work_lock, and wb_inode_writeback_end() may get called from interrupt, switch wb->work_lock to an irqsafe lock.
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 5.15.64, 5.19.6
- CVEs
- CVE-2022-49995
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 3 Nov 2026, 00:44 UTC · Revision 1
Source evidence
writeback: avoid use-after-free after removing device
core-osv · Original sourcePublished 18 Jun 2025, 11:00 UTC
In the Linux kernel, the following vulnerability has been resolved: writeback: avoid use-after-free after removing device When a disk is removed, bdi_unregister gets called to stop further writeback and wait for associated delayed work to complete. However, wb_inode_writeback_end() may schedule bandwidth estimation dwork after this has completed, which can result in the timer attempting to access the just freed bdi_writeback. Fix this by checking if the bdi_writeback is alive, similar to when scheduling writeback work. Since this requires wb->work_lock, and wb_inode_writeback_end() may get called from interrupt, switch wb->work_lock to an irqsafe lock.
osv:CVE-2022-49995
Kernel
Fixed versions: 5.15.64, 5.19.6
Complete source record
{
"id": "f6395ea4b861f03a18c8f26fb62640dc97a84b93e28fc69ddda4de0d43711a0e",
"url": "https://osv.dev/vulnerability/CVE-2022-49995",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "writeback: avoid use-after-free after removing device",
"summary": "In the Linux kernel, the following vulnerability has been resolved: writeback: avoid use-after-free after removing device When a disk is removed, bdi_unregister gets called to stop further writeback and wait for associated delayed work to complete. However, wb_inode_writeback_end() may schedule bandwidth estimation dwork after this has completed, which can result in the timer attempting to access the just freed bdi_writeback. Fix this by checking if the bdi_writeback is alive, similar to when scheduling writeback work. Since this requires wb->work_lock, and wb_inode_writeback_end() may get called from interrupt, switch wb->work_lock to an irqsafe lock.",
"evidence": "osv:CVE-2022-49995",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "5.15.64",
"evidence": "/affected/1/ranges"
},
{
"value": "5.19.6",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "high",
"structured": {
"id": "CVE-2022-49995",
"aliases": [
"CVE-2022-49995"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "45a2966fd64147518dc5bca25f447bd0fb5359ac"
},
{
"fixed": "f96b9f7c1676923bce871e728bb49c0dfa5013cc"
},
{
"fixed": "9a6c710f3bc10bc9cc23e1c080b53245b7f9d5b7"
},
{
"fixed": "f87904c075515f3e1d8f4a7115869d3b914674fd"
}
]
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49995.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.15.0"
},
{
"fixed": "5.15.64"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.16.0"
},
{
"fixed": "5.19.6"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49995.json"
}
}
],
"modified": "2026-10-28T02:30:24.860109181Z",
"provider": "osv",
"references": [
"https://git.kernel.org/stable/c/9a6c710f3bc10bc9cc23e1c080b53245b7f9d5b7",
"https://git.kernel.org/stable/c/f87904c075515f3e1d8f4a7115869d3b914674fd",
"https://git.kernel.org/stable/c/f96b9f7c1676923bce871e728bb49c0dfa5013cc",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49995.json",
"https://nvd.nist.gov/vuln/detail/CVE-2022-49995",
"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-49995.json"
}
},
"related_cves": [
{
"value": "CVE-2022-49995",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 491297,
"published_at": "2025-06-18T11:00:55.352+00:00"
}