# CVE-2022-50342: floppy: Fix memory leak in do\_floppy\_init()

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.23% (percentile 8, 2026-11-26)
- **CWE:** CWE-401
- **Published:** 2025-09-16T16:11:21.665Z
- **Modified:** 2026-06-17T05:23:16.460Z

## Who should check

- Anyone running Linux \>= 302cfee150291c6cd85b1ca197d062d0b423d09c, \< f36d8c8651506aea5f09899f5356ece5d1384f50; \>= 302cfee150291c6cd85b1ca197d062d0b423d09c, \< 75d8c8851a4da0190c2480e84315b5fd3d0356c5; \>= 302cfee150291c6cd85b1ca197d062d0b423d09c, \< 55b3c66a0d441cd37154ae95e44d0b82ccfd580e; \>= 302cfee150291c6cd85b1ca197d062d0b423d09c, \< f8ace2e304c5dd8a7328db9cd2b8a4b1b98d83ec
- Anyone running Linux 5.11

## Description

In the Linux kernel, the following vulnerability has been resolved:

floppy: Fix memory leak in do\_floppy\_init()

A memory leak was reported when floppy\_alloc\_disk() failed in
do\_floppy\_init().

unreferenced object 0xffff888115ed25a0 (size 8):
  comm "modprobe", pid 727, jiffies 4295051278 (age 25.529s)
  hex dump (first 8 bytes):
    00 ac 67 5b 81 88 ff ff                          ..g\[....
  backtrace:
    \[\<000000007f457abb\>\] \_\_kmalloc\_node+0x4c/0xc0
    \[\<00000000a87bfa9e\>\] blk\_mq\_realloc\_tag\_set\_tags.part.0+0x6f/0x180
    \[\<000000006f02e8b1\>\] blk\_mq\_alloc\_tag\_set+0x573/0x1130
    \[\<0000000066007fd7\>\] 0xffffffffc06b8b08
    \[\<0000000081f5ac40\>\] do\_one\_initcall+0xd0/0x4f0
    \[\<00000000e26d04ee\>\] do\_init\_module+0x1a4/0x680
    \[\<000000001bb22407\>\] load\_module+0x6249/0x7110
    \[\<00000000ad31ac4d\>\] \_\_do\_sys\_finit\_module+0x140/0x200
    \[\<000000007bddca46\>\] do\_syscall\_64+0x35/0x80
    \[\<00000000b5afec39\>\] entry\_SYSCALL\_64\_after\_hwframe+0x46/0xb0
unreferenced object 0xffff88810fc30540 (size 32):
  comm "modprobe", pid 727, jiffies 4295051278 (age 25.529s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    \[\<000000007f457abb\>\] \_\_kmalloc\_node+0x4c/0xc0
    \[\<000000006b91eab4\>\] blk\_mq\_alloc\_tag\_set+0x393/0x1130
    \[\<0000000066007fd7\>\] 0xffffffffc06b8b08
    \[\<0000000081f5ac40\>\] do\_one\_initcall+0xd0/0x4f0
    \[\<00000000e26d04ee\>\] do\_init\_module+0x1a4/0x680
    \[\<000000001bb22407\>\] load\_module+0x6249/0x7110
    \[\<00000000ad31ac4d\>\] \_\_do\_sys\_finit\_module+0x140/0x200
    \[\<000000007bddca46\>\] do\_syscall\_64+0x35/0x80
    \[\<00000000b5afec39\>\] entry\_SYSCALL\_64\_after\_hwframe+0x46/0xb0

If the floppy\_alloc\_disk() failed, disks of current drive will not be set,
thus the lastest allocated set-\>tag cannot be freed in the error handling
path. A simple call graph shown as below:

 floppy\_module\_init()
   floppy\_init()
     do\_floppy\_init()
       for (drive = 0; drive \< N\_DRIVE; drive++)
         blk\_mq\_alloc\_tag\_set()
           blk\_mq\_alloc\_tag\_set\_tags()
             blk\_mq\_realloc\_tag\_set\_tags() \# set-\>tag allocated
         floppy\_alloc\_disk()
           blk\_mq\_alloc\_disk() \# error occurred, disks failed to allocated

       -\>out\_put\_disk:
       for (drive = 0; drive \< N\_DRIVE; drive++)
         if (!disks\[drive\]\[0\]) \# the last disks is not set and loop break
           break;
         blk\_mq\_free\_tag\_set() \# the latest allocated set-\>tag leaked

Fix this problem by free the set-\>tag of current drive before jump to
error handling path.

\[efremov: added stable list, changed title\]

## Affected and fixed versions

- Linux: \>= 302cfee150291c6cd85b1ca197d062d0b423d09c, \< f36d8c8651506aea5f09899f5356ece5d1384f50; \>= 302cfee150291c6cd85b1ca197d062d0b423d09c, \< 75d8c8851a4da0190c2480e84315b5fd3d0356c5; \>= 302cfee150291c6cd85b1ca197d062d0b423d09c, \< 55b3c66a0d441cd37154ae95e44d0b82ccfd580e; \>= 302cfee150291c6cd85b1ca197d062d0b423d09c, \< f8ace2e304c5dd8a7328db9cd2b8a4b1b98d83ec (cvelist)
- Linux: 5.11 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2022-50342. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-50342.md
Affected: Linux >= 302cfee150291c6cd85b1ca197d062d0b423d09c, < f36d8c8651506aea5f09899f5356ece5d1384f50; >= 302cfee150291c6cd85b1ca197d062d0b423d09c, < 75d8c8851a4da0190c2480e84315b5fd3d0356c5; >= 302cfee150291c6cd85b1ca197d062d0b423d09c, < 55b3c66a0d441cd37154ae95e44d0b82ccfd580e; >= 302cfee150291c6cd85b1ca…
Fixed in: Linux 75d8c8851a4da0190c2480e84315b5fd3d0356c5, Linux 55b3c66a0d441cd37154ae95e44d0b82ccfd580e

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2022-50342 being exploited?

There is no confirmed exploitation: CVE-2022-50342 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.23% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2022-50342?

Medium: CVSS 5.5 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2022-50342?

Linux \>= 302cfee150291c6cd85b1ca197d062d0b423d09c, \< f36d8c8651506aea5f09899f5356ece5d1384f50; \>= 302cfee150291c6cd85b1ca197d062d0b423d09c, \< 75d8c8851a4da0190c2480e84315b5fd3d0356c5; \>= 302cfee150291c6cd85b1ca197d062d0b423d09c, \< 55b3c66a0d441cd37154ae95e44d0b82ccfd580e; \>= 302cfee150291c6cd85b1ca197d062d0b423d09c, \< f8ace2e304c5dd8a7328db9cd2b8a4b1b98d83ec; Linux 5.11.

### Is there a fix for CVE-2022-50342?

Yes. Fixed in Linux 75d8c8851a4da0190c2480e84315b5fd3d0356c5, Linux 55b3c66a0d441cd37154ae95e44d0b82ccfd580e. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2022-50342?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/f36d8c8651506aea5f09899f5356ece5d1384f50>
- patch: <https://git.kernel.org/stable/c/75d8c8851a4da0190c2480e84315b5fd3d0356c5>
- patch: <https://git.kernel.org/stable/c/55b3c66a0d441cd37154ae95e44d0b82ccfd580e>
- patch: <https://git.kernel.org/stable/c/f8ace2e304c5dd8a7328db9cd2b8a4b1b98d83ec>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-50342>

HTML: <https://flawdb.com/CVE-2022-50342> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-50342>
