CVE-2026-99505 in Linuxinfo

Summary

by MITRE • 11/19/2026

In 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.

If you want to get the best quality for vulnerability data then you always have to consider VulDB.

Analysis

by VulDB Data Team • 11/20/2026

The Linux kernel's AppArmor security module contains a critical concurrency flaw within the aa_lookupn_ns function, which results in a use-after-free vulnerability when handling concurrent profile removal operations. This issue stems from an improper synchronization mechanism during the lifecycle management of namespace objects. Specifically, the function attempts to acquire a reference on a found namespace by calling aa_get_ns, which internally invokes kref_get to increment the object's reference count. However, this operation is performed without verifying that the namespace is still actively in use or present within the system's data structures at that precise moment. This lack of atomicity creates a race condition where the state of the object can change between the initial lookup and the subsequent reference acquisition attempt.

The operational trigger for this vulnerability involves an attacker with CAP_MAC_ADMIN privileges, which grants the ability to modify AppArmor profiles via the /sys/kernel/security/apparmor/.remove interface. By concurrently writing removal commands for a namespace prefixed with a colon and its associated profile, such as ":<name>" followed by "<profile>", an adversary can exploit the timing window in the kernel's execution flow. A concurrent thread may initiate the lookup of the same namespace to remove it, but delays acquiring the necessary parent lock until after the first thread has already performed the initial lookup. During this interval, if no other references exist, the reference count for that namespace drops to zero as part of the removal process. When the first thread subsequently calls aa_get_ns, it attempts to increment a reference count that is currently at zero.

This specific sequence leads to a refcount_t addition on zero error, which the kernel detects and flags as a use-after-free condition. The warning originates from lib/refcount.c within the refcount_warn_saturate function, indicating that the integrity of the object's memory management has been compromised. Although the immediate symptom is a kernel warning or potential crash depending on subsequent usage patterns, the underlying issue represents a significant security risk. Use-after-free vulnerabilities allow for arbitrary code execution if an attacker can control the data written to the freed memory region before it is reallocated and reused by another part of the system. This aligns with CWE-416, which describes use after free errors resulting from improper handling of object lifecycles in concurrent environments.

From a threat modeling perspective, this vulnerability maps to MITRE ATT&CK technique T1059, specifically command execution via kernel exploitation, as it allows for potential privilege escalation or denial of service through memory corruption. The root cause is identified as CWE-362, a race condition involving shared resources without adequate synchronization primitives protecting the critical section where reference counts are checked and modified. To mitigate this risk, the fix involves modifying aa_lookupn_ns to explicitly reject any namespace whose reference count has reached zero before attempting to increment it. This ensures that operations only proceed on objects that are confirmed to be valid and active within the kernel's memory management subsystem. System administrators should apply the latest available kernel updates or security patches that include this specific AppArmor fix to prevent exploitation by privileged users capable of manipulating profile configurations concurrently.

Responsible

Linux

Reservation

09/25/2026

Disclosure

11/19/2026

Moderation

accepted

CPE

ready

EPSS

0.00174

KEV

no

Activities

very low

Sources

Interested in the pricing of exploits?

See the underground prices here!