# CVE-2022-50140: memstick/ms_block: Fix a memory leak

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.20%, higher than 10% of CVEs (2026-12-01)
- Published: 2025-06-18T11:03:03.027Z
- Modified: 2026-06-17T05:22:50.387Z
- Weaknesses: CWE-401
- Assigned by: Linux

## Description

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

memstick/ms_block: Fix a memory leak

'erased_blocks_bitmap' is never freed. As it is allocated at the same time
as 'used_blocks_bitmap', it is likely that it should be freed also at the
same time.

Add the corresponding bitmap_free() in msb_data_clear().

(As written by CVE List.)

## Affected

- Linux Linux: from 0ab30494bc4f3bc1ea4659b7c5d97c5218554a63 before efd675246aec045507b9425c67b548cc2d782d8f; from 0ab30494bc4f3bc1ea4659b7c5d97c5218554a63 before 37958980eb4cd71ae594ace093c11b6a91e165e8; from 0ab30494bc4f3bc1ea4659b7c5d97c5218554a63 before 9d8b911fe3c3ed788c66edba7c90e32a4a7a5f53; from 0ab30494bc4f3bc1ea4659b7c5d97c5218554a63 before 9260a154b3b5e387dbceec7c0ac441470646bc6f; from 0ab30494bc4f3bc1ea4659b7c5d97c5218554a63 before 961d7d12080fe70847f944d656e36cd0dd0214ba; from 0ab30494bc4f3bc1ea4659b7c5d97c5218554a63 before 16e07966638717416abf45393d6a80a5a1034429; from 0ab30494bc4f3bc1ea4659b7c5d97c5218554a63 before 39be95d1ff7b44c1e969af72ba9da7332dfcc1da; from 0ab30494bc4f3bc1ea4659b7c5d97c5218554a63 before 54eb7a55be6779c4d0c25eaf5056498a28595049; 3.12 (not affected: before 3.12; from 4.14.291 up to 4.14.*; from 4.19.256 up to 4.19.*; from 5.4.211 up to 5.4.*; from 5.10.137 up to 5.10.*; from 5.15.61 up to 5.15.*; from 5.18.18 up to 5.18.*; from 5.19.2 up to 5.19.*; from 6.0 up to *)
- linux linux_kernel: from 3.12 before 4.14.291; from 4.15 before 4.19.256; from 4.20 before 5.4.211; from 5.5 before 5.10.137; from 5.11 before 5.15.61; from 5.16 before 5.18.18; from 5.19 before 5.19.2

## References

- <https://git.kernel.org/stable/c/efd675246aec045507b9425c67b548cc2d782d8f> (patch)
- <https://git.kernel.org/stable/c/37958980eb4cd71ae594ace093c11b6a91e165e8> (patch)
- <https://git.kernel.org/stable/c/9d8b911fe3c3ed788c66edba7c90e32a4a7a5f53> (patch)
- <https://git.kernel.org/stable/c/9260a154b3b5e387dbceec7c0ac441470646bc6f> (patch)
- <https://git.kernel.org/stable/c/961d7d12080fe70847f944d656e36cd0dd0214ba> (patch)
- <https://git.kernel.org/stable/c/16e07966638717416abf45393d6a80a5a1034429> (patch)
- <https://git.kernel.org/stable/c/39be95d1ff7b44c1e969af72ba9da7332dfcc1da> (patch)
- <https://git.kernel.org/stable/c/54eb7a55be6779c4d0c25eaf5056498a28595049> (patch)

## Sources

- CVE List: [CVE-2022-50140](https://www.cve.org/CVERecord?id=CVE-2022-50140), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2022-50140](https://nvd.nist.gov/vuln/detail/CVE-2022-50140), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-50140 · Whole record: https://cve.day/CVE-2022-50140.json · Rebuilt by cve.day 2026-11-25T22:58:21.072Z
