CVE-2022-50342
Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
16/09/2025
Last modified:
17/09/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
floppy: Fix memory leak in do_floppy_init()<br />
<br />
A memory leak was reported when floppy_alloc_disk() failed in<br />
do_floppy_init().<br />
<br />
unreferenced object 0xffff888115ed25a0 (size 8):<br />
comm "modprobe", pid 727, jiffies 4295051278 (age 25.529s)<br />
hex dump (first 8 bytes):<br />
00 ac 67 5b 81 88 ff ff ..g[....<br />
backtrace:<br />
[] __kmalloc_node+0x4c/0xc0<br />
[] blk_mq_realloc_tag_set_tags.part.0+0x6f/0x180<br />
[] blk_mq_alloc_tag_set+0x573/0x1130<br />
[] 0xffffffffc06b8b08<br />
[] do_one_initcall+0xd0/0x4f0<br />
[] do_init_module+0x1a4/0x680<br />
[] load_module+0x6249/0x7110<br />
[] __do_sys_finit_module+0x140/0x200<br />
[] do_syscall_64+0x35/0x80<br />
[] entry_SYSCALL_64_after_hwframe+0x46/0xb0<br />
unreferenced object 0xffff88810fc30540 (size 32):<br />
comm "modprobe", pid 727, jiffies 4295051278 (age 25.529s)<br />
hex dump (first 32 bytes):<br />
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................<br />
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................<br />
backtrace:<br />
[] __kmalloc_node+0x4c/0xc0<br />
[] blk_mq_alloc_tag_set+0x393/0x1130<br />
[] 0xffffffffc06b8b08<br />
[] do_one_initcall+0xd0/0x4f0<br />
[] do_init_module+0x1a4/0x680<br />
[] load_module+0x6249/0x7110<br />
[] __do_sys_finit_module+0x140/0x200<br />
[] do_syscall_64+0x35/0x80<br />
[] entry_SYSCALL_64_after_hwframe+0x46/0xb0<br />
<br />
If the floppy_alloc_disk() failed, disks of current drive will not be set,<br />
thus the lastest allocated set->tag cannot be freed in the error handling<br />
path. A simple call graph shown as below:<br />
<br />
floppy_module_init()<br />
floppy_init()<br />
do_floppy_init()<br />
for (drive = 0; drive tag allocated<br />
floppy_alloc_disk()<br />
blk_mq_alloc_disk() # error occurred, disks failed to allocated<br />
<br />
->out_put_disk:<br />
for (drive = 0; drive tag leaked<br />
<br />
Fix this problem by free the set->tag of current drive before jump to<br />
error handling path.<br />
<br />
[efremov: added stable list, changed title]