CVE-2022-49902: block: Fix possible memory leak for rq_wb on add_disk failure
In the Linux kernel, the following vulnerability has been resolved:
block: Fix possible memory leak for rq_wb on add_disk failure
kmemleak reported memory leaks in device_add_disk():
kmemleak: 3 new suspected memory leaks
unreferenced object 0xffff88800f420800 (size 512):
comm "modprobe", pid 4275, jiffies 4295639067 (age 223.512s)
hex dump (first 32 bytes):
04 00 00 00 08 00 00 00 01 00 00 00 00 00 00 00 ................
00 e1 f5 05 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<00000000d3662699>] kmalloc_trace+0x26/0x60
[<00000000edc7aadc>] wbt_init+0x50/0x6f0
[<0000000069601d16>] wbt_enable_default+0x157/0x1c0
[<0000000028fc393f>] blk_register_queue+0x2a4/0x420
[<000000007345a042>] device_add_disk+0x6fd/0xe40
[<0000000060e6aab0>] nbd_dev_add+0x828/0xbf0 [nbd]
...
It is because the memory allocated in wbt_enable_default() is not
released in device_add_disk() error path.
Normally, these memory are freed in:
del_gendisk()
rq_qos_exit()
rqos->ops->exit(rqos);
wbt_exit()
So rq_qos_exit() is called to free the rq_wb memory for wbt_init().
However in the error path of device_add_disk(), only
blk_unregister_queue() is called and make rq_wb memory leaked.
Add rq_qos_exit() to the error path to fix it.
Security readout for executives and security teams
Plain-English summary
This is a Linux kernel resource-leak bug. If a local low-privileged user can trigger the failing disk-add path, kernel memory allocated for writeback throttling may not be released. The business risk is availability: repeated failures could contribute to memory exhaustion or instability.
Executive priority
Treat as moderate priority. It is availability-focused and local, with no cited active exploitation, but kernel memory leaks can matter on shared or high-availability systems. Patch through normal kernel maintenance, faster where untrusted local access exists.
Technical view
device_add_disk() could leak rq_wb memory allocated by wbt_enable_default() when add_disk failed. The normal del_gendisk() path calls rq_qos_exit(), but the error path only called blk_unregister_queue(). The fix adds rq_qos_exit() on that error path. CVSS is 5.5 with local, low-complexity, low-privilege availability impact.
Likely exposure
Exposure is limited to affected Linux kernel builds identified by the CVE data, including 5.15-era and 6.0/6.1 entries. Distribution backports may change practical exposure, so kernel package status must be checked against vendor advisories and the referenced stable commits.
Exploitation context
The bundle does not cite active exploitation, and KEV is false. The CVSS vector requires local access and low privileges, with no user interaction. The public description shows a kernel memory leak in an error path, not remote code execution or data theft.
Researcher notes
The key behavior is missing cleanup on the device_add_disk() failure path after rq_wb allocation. Evidence supports CWE-401 and availability impact. The bundle does not provide proof of exploitation, distro package status, or non-Linux affected products.
Mitigation direction
Update to a vendor-supported kernel containing the referenced stable fixes.
Check distribution advisories for backported fixes before relying on version numbers alone.
Prioritize multi-user systems where local users can exercise block-device paths.
If no vendor fix is available, monitor vendor guidance for supported mitigations.
Validation and detection
Inventory running Linux kernel versions across servers, containers hosts, and appliances.
Map each kernel package to vendor advisories and the referenced stable commits.
Confirm whether the rq_qos_exit() error-path fix is present in source or changelog.
Review system exposure to local untrusted users or delegated device-management capabilities.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-401: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-401 · source CWE mapping
Missing Release of Memory after Effective Lifetime
Missing Release of Memory after Effective Lifetime represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.