apparmor: fix a use-after-free in aa_lookupn_ns()

Summary

CVECVE-2026-99505
StatePUBLISHED
AssignerLinux
Source PriorityCVE Program / NVD first with legacy fallback
Published2026-11-19 15:18:05 UTC
Updated2026-11-23 08:17:52 UTC
DescriptionIn the Linux kernel, the following vulnerability has been resolved: apparmor: fix a use-after-free in aa_lookupn_ns() aa_lookupn_ns() takes a reference on the namespace it finds with aa_get_ns(), which is kref_get() on the reference count that the namespace is released through, without checking whether the namespace is still in use. A concurrent removal of a ":"-prefixed namespace looks the same namespace up and only then takes the parent lock to remove it, so the last reference can be dropped between the lookup and the aa_get_ns() call: the reference count then reports the increment on a zero count and the kernel classifies the following use of the object as a use-after-free. A user with CAP_MAC_ADMIN can trigger this by writing a ":<name>" removal and a ":<name>/<profile>" removal to /sys/kernel/security/apparmor/.remove concurrently. refcount_t: addition on 0; use-after-free. WARNING: lib/refcount.c:25 at refcount_warn_saturate+0xc0/0xe0, CPU#6 Call Trace: <TASK> aa_lookupn_ns+0xa9/0xc0 aa_remove_profiles+0x4fb/0x730 ? __kvmalloc_node_noprof+0x219/0x5c0 ? __pfx_aa_remove_profiles+0x10/0x10 ? aa_loaddata_alloc+0x65/0x1f0 ? _copy_from_user+0x2d/0x80 ? aa_loaddata_alloc+0x111/0x1f0 profile_remove+0x2ee/0x4a0 vfs_write+0x21e/0xcf0 ? rcu_core+0x29c/0x1740 ? timerqueue_linked_add+0x1f4/0x3d0 ? __pfx_vfs_write+0x10/0x10 ? mutex_lock+0x81/0xe0 ? __pfx_mutex_lock+0x10/0x10 ? __pfx_rcu_core+0x10/0x10 ? __pfx_hrtimer_update_next_event+0x10/0x10 ? mutex_unlock+0x7b/0xd0 ? fdget_pos+0x24d/0x4b0 ksys_write+0xf7/0x1c0 ? __pfx_ksys_write+0x10/0x10 ? restore_fpregs_from_fpstate+0x37/0xc0 do_syscall_64+0xf9/0x540 entry_SYSCALL_64_after_hwframe+0x77/0x7f </TASK> Fix by rejecting a namespace whose reference count is zero.

Risk And Classification

EPSS: 0.002180000 probability, percentile 0.123110000 (date 2026-11-23)

Vendor Declared Affected Products

SourceVendorProductVersionPlatforms
CNA Linux Linux affected 3664268f19ea07bec55df92fe53ff9ed28968bcc 87124024b0a7c46e04f5588808fd2c0e95ce567a git Not specified
CNA Linux Linux affected 3664268f19ea07bec55df92fe53ff9ed28968bcc df8685e4f9da816927395c456a62c1043ecdd99a git Not specified
CNA Linux Linux affected 3664268f19ea07bec55df92fe53ff9ed28968bcc ba45d73f8782e3e9d521ec2bd4c4b4b4dc548f2b git Not specified
CNA Linux Linux affected 3664268f19ea07bec55df92fe53ff9ed28968bcc 1f09cc23d1cdf440ff03d4a0cf3ed8100134d9d3 git Not specified
CNA Linux Linux affected 3664268f19ea07bec55df92fe53ff9ed28968bcc 2588c5693f4535e856841976cb1e1532bae77109 git Not specified
CNA Linux Linux affected 3664268f19ea07bec55df92fe53ff9ed28968bcc 174b4b90ec6731934cf84eb267a86ad7152267fa git Not specified
CNA Linux Linux affected 3664268f19ea07bec55df92fe53ff9ed28968bcc 8db1a8614b4f8f3da11c568e2b5af4fe56eef360 git Not specified
CNA Linux Linux affected 3664268f19ea07bec55df92fe53ff9ed28968bcc f292873ceb4bd3a1a0f75f884361cd556e457692 git Not specified
CNA Linux Linux affected 4.13 Not specified
CNA Linux Linux unaffected 4.13 semver Not specified
CNA Linux Linux unaffected 5.10.275 5.10.* semver Not specified
CNA Linux Linux unaffected 5.15.226 5.15.* semver Not specified
CNA Linux Linux unaffected 6.1.193 6.1.* semver Not specified
CNA Linux Linux unaffected 6.6.163 6.6.* semver Not specified
CNA Linux Linux unaffected 6.12.117 6.12.* semver Not specified
CNA Linux Linux unaffected 6.18.61 6.18.* semver Not specified
CNA Linux Linux unaffected 7.3.2 7.3.* semver Not specified
CNA Linux Linux unaffected 7.4-rc1 * original_commit_for_fix Not specified

References

ReferenceSourceLinkTags
git.kernel.org/stable/c/8db1a8614b4f8f3da11c568e2b5af4fe56eef360 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/1f09cc23d1cdf440ff03d4a0cf3ed8100134d9d3 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/ba45d73f8782e3e9d521ec2bd4c4b4b4dc548f2b 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/f292873ceb4bd3a1a0f75f884361cd556e457692 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/2588c5693f4535e856841976cb1e1532bae77109 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/174b4b90ec6731934cf84eb267a86ad7152267fa 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/df8685e4f9da816927395c456a62c1043ecdd99a 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/87124024b0a7c46e04f5588808fd2c0e95ce567a 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
CVE Program record CVE.ORG www.cve.org canonical
NVD vulnerability detail NVD nvd.nist.gov canonical, analysis

© CVE.report 2026

Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

Free CVE JSON API cve.report/api

CVE.report and Source URL Uptime Status status.cve.report