# CVE-2022-50074: apparmor: Fix memleak in aa_simple_write_to_buffer()

- 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:02:18.140Z
- Modified: 2026-06-17T05:22:42.403Z
- Weaknesses: CWE-401
- Assigned by: Linux

## Description

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

apparmor: Fix memleak in aa_simple_write_to_buffer()

When copy_from_user failed, the memory is freed by kvfree. however the
management struct and data blob are allocated independently, so only
kvfree(data) cause a memleak issue here. Use aa_put_loaddata(data) to
fix this issue.

(As written by CVE List.)

## Affected

- Linux Linux: from a6a52579e52b55448326db88bd9a5740e7c1a037 before 6500eb3a48ac221051b1791818a1ac74744ef617; from a6a52579e52b55448326db88bd9a5740e7c1a037 before 7db182a2ebeefded86fea542fcc5d6a68bb77f58; from a6a52579e52b55448326db88bd9a5740e7c1a037 before 8aab4295582eb397a125d2788b829fa62b88dbf7; from a6a52579e52b55448326db88bd9a5740e7c1a037 before bf7ebebce2c25071c719fd8a2f1307e0c243c2d7; from a6a52579e52b55448326db88bd9a5740e7c1a037 before 6583edbf459de2e06b9759f264c0ae27e452b97a; from a6a52579e52b55448326db88bd9a5740e7c1a037 before 417ea9fe972d2654a268ad66e89c8fcae67017c3; 4.17 (not affected: before 4.17; from 4.19.256 up to 4.19.*; from 5.4.211 up to 5.4.*; from 5.10.138 up to 5.10.*; from 5.15.63 up to 5.15.*; from 5.19.4 up to 5.19.*; from 6.0 up to *)
- linux linux_kernel: from 4.17 before 4.19.256; from 4.20 before 5.4.211; from 5.5 before 5.10.138; from 5.11 before 5.15.63; from 5.16 before 5.19.4

## References

- <https://git.kernel.org/stable/c/6500eb3a48ac221051b1791818a1ac74744ef617> (patch)
- <https://git.kernel.org/stable/c/7db182a2ebeefded86fea542fcc5d6a68bb77f58> (patch)
- <https://git.kernel.org/stable/c/8aab4295582eb397a125d2788b829fa62b88dbf7> (patch)
- <https://git.kernel.org/stable/c/bf7ebebce2c25071c719fd8a2f1307e0c243c2d7> (patch)
- <https://git.kernel.org/stable/c/6583edbf459de2e06b9759f264c0ae27e452b97a> (patch)
- <https://git.kernel.org/stable/c/417ea9fe972d2654a268ad66e89c8fcae67017c3> (patch)

## Sources

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

---

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