# CVE-2026-99838: apparmor: fix refcount leak in aa_get_newest_profile()

- Severity: not scored yet
- 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.22%, higher than 13% of CVEs (2026-12-01)
- Published: 2026-11-30T13:17:31.392Z
- Modified: 2026-11-30T14:20:16.803Z
- Assigned by: Linux

## Description

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

apparmor: fix refcount leak in aa_get_newest_profile()

The labels_profile() macro is evaluating its argument twice

  #define labels_profile(X) ((X)->vec[(X)->size - 1])

unfortunately aa_get_newest_profile() passes
   aa_get_newest_label(&p->label)
so every call to aa_get_newest_profile results in 2 refcounts
being taken with one being leaked.

There is no need for labels_profile() to be a macro. Convert it to
an inline fn, which ensures all uses are passing the correct struct
and removes the double evaluation.

(As written by CVE List.)

## Affected

- Linux Linux: from 637f688dc3dc304a89f441d76f49a0e35bc49c08 before d8a4aac994f8497b20ace6c3ca33425c80ab7492; from 637f688dc3dc304a89f441d76f49a0e35bc49c08 before c70aba4b08a081cae49aaa7f94e76758b221b01b; from 637f688dc3dc304a89f441d76f49a0e35bc49c08 before 52e2c4b19e5a097e7c3fa99a39ad66b9d307c33a; from 637f688dc3dc304a89f441d76f49a0e35bc49c08 before d8bc7adff286996fd3e5e984e25eb2359eb5cd94; from 637f688dc3dc304a89f441d76f49a0e35bc49c08 before e89a7966686b80e9a0e4b49c6040b6a18c6c98aa; from 637f688dc3dc304a89f441d76f49a0e35bc49c08 before 8c054c71d47d19472d2aa2efbae89d2c85e0b7cf; from 637f688dc3dc304a89f441d76f49a0e35bc49c08 before dabd6ac70acaa838e011df72286734faa318f99b; from 637f688dc3dc304a89f441d76f49a0e35bc49c08 before 33ed50716251d5b2875706c40d0c8082d46be0b1; 4.13 (not affected: before 4.13; from 5.10.275 up to 5.10.*; from 5.15.226 up to 5.15.*; from 6.1.193 up to 6.1.*; from 6.6.163 up to 6.6.*; from 6.12.117 up to 6.12.*; from 6.18.63 up to 6.18.*; from 7.3.4 up to 7.3.*; from 7.4-rc1 up to *)

## References

- <https://git.kernel.org/stable/c/d8a4aac994f8497b20ace6c3ca33425c80ab7492>
- <https://git.kernel.org/stable/c/c70aba4b08a081cae49aaa7f94e76758b221b01b>
- <https://git.kernel.org/stable/c/52e2c4b19e5a097e7c3fa99a39ad66b9d307c33a>
- <https://git.kernel.org/stable/c/d8bc7adff286996fd3e5e984e25eb2359eb5cd94>
- <https://git.kernel.org/stable/c/e89a7966686b80e9a0e4b49c6040b6a18c6c98aa>
- <https://git.kernel.org/stable/c/8c054c71d47d19472d2aa2efbae89d2c85e0b7cf>
- <https://git.kernel.org/stable/c/dabd6ac70acaa838e011df72286734faa318f99b>
- <https://git.kernel.org/stable/c/33ed50716251d5b2875706c40d0c8082d46be0b1>

## Sources

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

---

Page: https://cve.day/CVE-2026-99838 · Whole record: https://cve.day/CVE-2026-99838.json · Rebuilt by cve.day 2026-11-30T14:33:29.422Z
