CVE-2022-49902

Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
01/05/2025
Last modified:
07/05/2025

Description

In the Linux kernel, the following vulnerability has been resolved:<br /> <br /> block: Fix possible memory leak for rq_wb on add_disk failure<br /> <br /> kmemleak reported memory leaks in device_add_disk():<br /> <br /> kmemleak: 3 new suspected memory leaks<br /> <br /> unreferenced object 0xffff88800f420800 (size 512):<br /> comm "modprobe", pid 4275, jiffies 4295639067 (age 223.512s)<br /> hex dump (first 32 bytes):<br /> 04 00 00 00 08 00 00 00 01 00 00 00 00 00 00 00 ................<br /> 00 e1 f5 05 00 00 00 00 00 00 00 00 00 00 00 00 ................<br /> backtrace:<br /> [] kmalloc_trace+0x26/0x60<br /> [] wbt_init+0x50/0x6f0<br /> [] wbt_enable_default+0x157/0x1c0<br /> [] blk_register_queue+0x2a4/0x420<br /> [] device_add_disk+0x6fd/0xe40<br /> [] nbd_dev_add+0x828/0xbf0 [nbd]<br /> ...<br /> <br /> It is because the memory allocated in wbt_enable_default() is not<br /> released in device_add_disk() error path.<br /> Normally, these memory are freed in:<br /> <br /> del_gendisk()<br /> rq_qos_exit()<br /> rqos-&gt;ops-&gt;exit(rqos);<br /> wbt_exit()<br /> <br /> So rq_qos_exit() is called to free the rq_wb memory for wbt_init().<br /> However in the error path of device_add_disk(), only<br /> blk_unregister_queue() is called and make rq_wb memory leaked.<br /> <br /> Add rq_qos_exit() to the error path to fix it.

Vulnerable products and versions

CPE From Up to
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.15 (including) 5.15.78 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.16 (including) 6.0.8 (excluding)
cpe:2.3:o:linux:linux_kernel:6.1:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.1:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.1:rc3:*:*:*:*:*:*