Skip to main content

CVE-2022-49902: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2022-49902cvecve-2022-49902
Published: Thu May 01 2025 (05/01/2025, 14:10:47 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

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.

AI-Powered Analysis

AILast updated: 06/29/2025, 20:26:28 UTC

Technical Analysis

CVE-2022-49902 is a vulnerability identified in the Linux kernel related to a potential memory leak in the block device subsystem. Specifically, the issue arises in the function device_add_disk(), which is responsible for adding a disk device to the system. The vulnerability is caused by improper error handling in the code path when adding a disk fails. During normal operation, memory allocated by the function wbt_enable_default() for the writeback throttling (wbt) subsystem is released properly via a sequence of calls culminating in rq_qos_exit(), which frees the rq_wb memory. However, in the error path of device_add_disk(), only blk_unregister_queue() is called without invoking rq_qos_exit(), resulting in the rq_wb memory not being freed and thus leaking. The memory leak was detected by kmemleak, a kernel memory leak detector, which reported unreferenced objects associated with the modprobe process. The fix involves adding a call to rq_qos_exit() in the error path of device_add_disk() to ensure proper cleanup of allocated memory. This vulnerability does not appear to have known exploits in the wild and does not have an assigned CVSS score. It affects Linux kernel versions identified by the commit hash 83cbce9574462c6b4eed6797bdaf18fae6859ab3 and likely other versions containing the vulnerable code. The issue is technical and subtle, related to kernel memory management and device registration error handling.

Potential Impact

The primary impact of this vulnerability is a potential memory leak in the Linux kernel when adding block devices fails. For European organizations, especially those running Linux servers, embedded systems, or infrastructure relying on dynamic device management, this could lead to gradual memory exhaustion on affected systems. Over time, repeated failures in adding disks could cause increased memory consumption, potentially degrading system performance or causing instability. While this vulnerability does not directly enable code execution, privilege escalation, or data leakage, the resulting resource exhaustion could disrupt critical services, particularly in environments with high device churn or automated device management. Systems used in data centers, cloud infrastructure, or industrial control that rely on Linux kernels with the vulnerable code are at risk. The absence of known exploits reduces immediate risk, but the vulnerability should be addressed to maintain system reliability and prevent denial-of-service conditions caused by memory leaks.

Mitigation Recommendations

To mitigate this vulnerability, European organizations should: 1) Apply the official Linux kernel patches that fix the memory leak by ensuring rq_qos_exit() is called in the error path of device_add_disk(). This is the definitive fix and should be prioritized. 2) Monitor system logs and use kernel memory leak detection tools such as kmemleak to identify any abnormal memory usage patterns related to block device management. 3) Implement robust error handling and alerting for device addition failures to detect and respond to potential issues early. 4) For critical systems, consider kernel updates during scheduled maintenance windows to minimize disruption. 5) If immediate patching is not feasible, limit dynamic disk addition operations or automate system reboots to clear leaked memory as a temporary workaround. 6) Maintain up-to-date inventories of Linux kernel versions deployed across infrastructure to identify vulnerable systems quickly. 7) Engage with Linux distribution vendors for backported patches if using long-term support kernels.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2025-05-01T14:05:17.245Z
Cisa Enriched
false
Cvss Version
null
State
PUBLISHED

Threat ID: 682d982bc4522896dcbe3fe0

Added to database: 5/21/2025, 9:08:59 AM

Last enriched: 6/29/2025, 8:26:28 PM

Last updated: 8/9/2025, 4:18:00 PM

Views: 13

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats