{"id":"CVE-2022-50342","state":"PUBLISHED","title":"floppy: Fix memory leak in do_floppy_init()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nfloppy: Fix memory leak in do_floppy_init()\n\nA memory leak was reported when floppy_alloc_disk() failed in\ndo_floppy_init().\n\nunreferenced object 0xffff888115ed25a0 (size 8):\n  comm \"modprobe\", pid 727, jiffies 4295051278 (age 25.529s)\n  hex dump (first 8 bytes):\n    00 ac 67 5b 81 88 ff ff                          ..g[....\n  backtrace:\n    [<000000007f457abb>] __kmalloc_node+0x4c/0xc0\n    [<00000000a87bfa9e>] blk_mq_realloc_tag_set_tags.part.0+0x6f/0x180\n    [<000000006f02e8b1>] blk_mq_alloc_tag_set+0x573/0x1130\n    [<0000000066007fd7>] 0xffffffffc06b8b08\n    [<0000000081f5ac40>] do_one_initcall+0xd0/0x4f0\n    [<00000000e26d04ee>] do_init_module+0x1a4/0x680\n    [<000000001bb22407>] load_module+0x6249/0x7110\n    [<00000000ad31ac4d>] __do_sys_finit_module+0x140/0x200\n    [<000000007bddca46>] do_syscall_64+0x35/0x80\n    [<00000000b5afec39>] entry_SYSCALL_64_after_hwframe+0x46/0xb0\nunreferenced object 0xffff88810fc30540 (size 32):\n  comm \"modprobe\", pid 727, jiffies 4295051278 (age 25.529s)\n  hex dump (first 32 bytes):\n    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................\n    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................\n  backtrace:\n    [<000000007f457abb>] __kmalloc_node+0x4c/0xc0\n    [<000000006b91eab4>] blk_mq_alloc_tag_set+0x393/0x1130\n    [<0000000066007fd7>] 0xffffffffc06b8b08\n    [<0000000081f5ac40>] do_one_initcall+0xd0/0x4f0\n    [<00000000e26d04ee>] do_init_module+0x1a4/0x680\n    [<000000001bb22407>] load_module+0x6249/0x7110\n    [<00000000ad31ac4d>] __do_sys_finit_module+0x140/0x200\n    [<000000007bddca46>] do_syscall_64+0x35/0x80\n    [<00000000b5afec39>] entry_SYSCALL_64_after_hwframe+0x46/0xb0\n\nIf the floppy_alloc_disk() failed, disks of current drive will not be set,\nthus the lastest allocated set->tag cannot be freed in the error handling\npath. A simple call graph shown as below:\n\n floppy_module_init()\n   floppy_init()\n     do_floppy_init()\n       for (drive = 0; drive < N_DRIVE; drive++)\n         blk_mq_alloc_tag_set()\n           blk_mq_alloc_tag_set_tags()\n             blk_mq_realloc_tag_set_tags() # set->tag allocated\n         floppy_alloc_disk()\n           blk_mq_alloc_disk() # error occurred, disks failed to allocated\n\n       ->out_put_disk:\n       for (drive = 0; drive < N_DRIVE; drive++)\n         if (!disks[drive][0]) # the last disks is not set and loop break\n           break;\n         blk_mq_free_tag_set() # the latest allocated set->tag leaked\n\nFix this problem by free the set->tag of current drive before jump to\nerror handling path.\n\n[efremov: added stable list, changed title]","publishedAt":"2025-09-16T16:11:21.665Z","updatedAt":"2026-05-11T19:17:34.790Z","severity":{"score":5.5,"label":"Medium","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","source":"CISA-ADP"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"302cfee150291c6cd85b1ca197d062d0b423d09c","status":"affected","lessThan":"f36d8c8651506aea5f09899f5356ece5d1384f50","versionType":"git"},{"version":"302cfee150291c6cd85b1ca197d062d0b423d09c","status":"affected","lessThan":"75d8c8851a4da0190c2480e84315b5fd3d0356c5","versionType":"git"},{"version":"302cfee150291c6cd85b1ca197d062d0b423d09c","status":"affected","lessThan":"55b3c66a0d441cd37154ae95e44d0b82ccfd580e","versionType":"git"},{"version":"302cfee150291c6cd85b1ca197d062d0b423d09c","status":"affected","lessThan":"f8ace2e304c5dd8a7328db9cd2b8a4b1b98d83ec","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/block/floppy.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.11","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.11","versionType":"semver"},{"version":"5.15.86","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.0.16","status":"unaffected","lessThanOrEqual":"6.0.*","versionType":"semver"},{"version":"6.1.2","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/block/floppy.c"]}],"references":["https://git.kernel.org/stable/c/f36d8c8651506aea5f09899f5356ece5d1384f50","https://git.kernel.org/stable/c/75d8c8851a4da0190c2480e84315b5fd3d0356c5","https://git.kernel.org/stable/c/55b3c66a0d441cd37154ae95e44d0b82ccfd580e","https://git.kernel.org/stable/c/f8ace2e304c5dd8a7328db9cd2b8a4b1b98d83ec"],"weaknesses":["CWE-401"],"ingestedAt":"2026-10-29T20:05:26.763Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2022/50xxx/CVE-2022-50342.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2022-50342","state":"PUBLISHED","datePublished":"2025-09-16T16:11:21.665Z","dateUpdated":"2026-05-11T19:17:34.790Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-09-16T16:03:27.881Z"},"containers":{"cna":{"title":"floppy: Fix memory leak in do_floppy_init()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nfloppy: Fix memory leak in do_floppy_init()\n\nA memory leak was reported when floppy_alloc_disk() failed in\ndo_floppy_init().\n\nunreferenced object 0xffff888115ed25a0 (size 8):\n  comm \"modprobe\", pid 727, jiffies 4295051278 (age 25.529s)\n  hex dump (first 8 bytes):\n    00 ac 67 5b 81 88 ff ff                          ..g[....\n  backtrace:\n    [<000000007f457abb>] __kmalloc_node+0x4c/0xc0\n    [<00000000a87bfa9e>] blk_mq_realloc_tag_set_tags.part.0+0x6f/0x180\n    [<000000006f02e8b1>] blk_mq_alloc_tag_set+0x573/0x1130\n    [<0000000066007fd7>] 0xffffffffc06b8b08\n    [<0000000081f5ac40>] do_one_initcall+0xd0/0x4f0\n    [<00000000e26d04ee>] do_init_module+0x1a4/0x680\n    [<000000001bb22407>] load_module+0x6249/0x7110\n    [<00000000ad31ac4d>] __do_sys_finit_module+0x140/0x200\n    [<000000007bddca46>] do_syscall_64+0x35/0x80\n    [<00000000b5afec39>] entry_SYSCALL_64_after_hwframe+0x46/0xb0\nunreferenced object 0xffff88810fc30540 (size 32):\n  comm \"modprobe\", pid 727, jiffies 4295051278 (age 25.529s)\n  hex dump (first 32 bytes):\n    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................\n    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................\n  backtrace:\n    [<000000007f457abb>] __kmalloc_node+0x4c/0xc0\n    [<000000006b91eab4>] blk_mq_alloc_tag_set+0x393/0x1130\n    [<0000000066007fd7>] 0xffffffffc06b8b08\n    [<0000000081f5ac40>] do_one_initcall+0xd0/0x4f0\n    [<00000000e26d04ee>] do_init_module+0x1a4/0x680\n    [<000000001bb22407>] load_module+0x6249/0x7110\n    [<00000000ad31ac4d>] __do_sys_finit_module+0x140/0x200\n    [<000000007bddca46>] do_syscall_64+0x35/0x80\n    [<00000000b5afec39>] entry_SYSCALL_64_after_hwframe+0x46/0xb0\n\nIf the floppy_alloc_disk() failed, disks of current drive will not be set,\nthus the lastest allocated set->tag cannot be freed in the error handling\npath. A simple call graph shown as below:\n\n floppy_module_init()\n   floppy_init()\n     do_floppy_init()\n       for (drive = 0; drive < N_DRIVE; drive++)\n         blk_mq_alloc_tag_set()\n           blk_mq_alloc_tag_set_tags()\n             blk_mq_realloc_tag_set_tags() # set->tag allocated\n         floppy_alloc_disk()\n           blk_mq_alloc_disk() # error occurred, disks failed to allocated\n\n       ->out_put_disk:\n       for (drive = 0; drive < N_DRIVE; drive++)\n         if (!disks[drive][0]) # the last disks is not set and loop break\n           break;\n         blk_mq_free_tag_set() # the latest allocated set->tag leaked\n\nFix this problem by free the set->tag of current drive before jump to\nerror handling path.\n\n[efremov: added stable list, changed title]"}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"302cfee150291c6cd85b1ca197d062d0b423d09c","status":"affected","lessThan":"f36d8c8651506aea5f09899f5356ece5d1384f50","versionType":"git"},{"version":"302cfee150291c6cd85b1ca197d062d0b423d09c","status":"affected","lessThan":"75d8c8851a4da0190c2480e84315b5fd3d0356c5","versionType":"git"},{"version":"302cfee150291c6cd85b1ca197d062d0b423d09c","status":"affected","lessThan":"55b3c66a0d441cd37154ae95e44d0b82ccfd580e","versionType":"git"},{"version":"302cfee150291c6cd85b1ca197d062d0b423d09c","status":"affected","lessThan":"f8ace2e304c5dd8a7328db9cd2b8a4b1b98d83ec","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/block/floppy.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.11","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.11","versionType":"semver"},{"version":"5.15.86","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.0.16","status":"unaffected","lessThanOrEqual":"6.0.*","versionType":"semver"},{"version":"6.1.2","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/block/floppy.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/f36d8c8651506aea5f09899f5356ece5d1384f50"},{"url":"https://git.kernel.org/stable/c/75d8c8851a4da0190c2480e84315b5fd3d0356c5"},{"url":"https://git.kernel.org/stable/c/55b3c66a0d441cd37154ae95e44d0b82ccfd580e"},{"url":"https://git.kernel.org/stable/c/f8ace2e304c5dd8a7328db9cd2b8a4b1b98d83ec"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-05-11T19:17:34.790Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.11","versionEndExcluding":"5.15.86"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.11","versionEndExcluding":"6.0.16"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.11","versionEndExcluding":"6.1.2"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.11","versionEndExcluding":"6.2"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":5.5,"attackVector":"LOCAL","baseSeverity":"MEDIUM","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","integrityImpact":"NONE","userInteraction":"NONE","attackComplexity":"LOW","availabilityImpact":"HIGH","privilegesRequired":"LOW","confidentialityImpact":"NONE"}},{"other":{"type":"ssvc","content":{"id":"CVE-2022-50342","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"version":"2.0.3","timestamp":"2026-01-14T18:20:06.449961Z"}}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-401","lang":"en","type":"CWE","description":"CWE-401 Missing Release of Memory after Effective Lifetime"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-01-14T18:22:57.872Z"}}]}}}