apparmor: fix refcount leak in aa_get_newest_profile()
- State
- Published
- Severity
- Not Scored
- Published
- Nov 30, 2026
- Updated
- Nov 30, 2026
- Reserved
- Sep 25, 2026
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.
| Product | Versions |
|---|---|
| Linux Linux | 637f688dc3dc304a89f441d76f49a0e35bc49c08 to before d8a4aac994f8497b20ace6c3ca33425c80ab7492 Affected637f688dc3dc304a89f441d76f49a0e35bc49c08 to before c70aba4b08a081cae49aaa7f94e76758b221b01b Affected637f688dc3dc304a89f441d76f49a0e35bc49c08 to before 52e2c4b19e5a097e7c3fa99a39ad66b9d307c33a Affected637f688dc3dc304a89f441d76f49a0e35bc49c08 to before d8bc7adff286996fd3e5e984e25eb2359eb5cd94 Affected637f688dc3dc304a89f441d76f49a0e35bc49c08 to before e89a7966686b80e9a0e4b49c6040b6a18c6c98aa Affected637f688dc3dc304a89f441d76f49a0e35bc49c08 to before 8c054c71d47d19472d2aa2efbae89d2c85e0b7cf Affected637f688dc3dc304a89f441d76f49a0e35bc49c08 to before dabd6ac70acaa838e011df72286734faa318f99b Affected637f688dc3dc304a89f441d76f49a0e35bc49c08 to before 33ed50716251d5b2875706c40d0c8082d46be0b1 Affected |
| Linux Linux | 4.13 Affectedbefore 4.13 Not Affected5.10.275 through 5.10.* Not Affected5.15.226 through 5.15.* Not Affected6.1.193 through 6.1.* Not Affected6.6.163 through 6.6.* Not Affected6.12.117 through 6.12.* Not Affected6.18.63 through 6.18.* Not Affected7.3.4 through 7.3.* Not Affected7.4-rc1 and later Not Affected |
The record has no CVSS score.
Weaknesses
The record names no weakness.
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
Every record here comes from the CVE Program's CVE List. © 1999-2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.