HIGH
apparmor Rawdata UAF
CVE-2026-23410
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.8HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: apparmor: fix race on rawdata dereference There is a race condition that leads to a use-after-free situation: because the rawdata inodes are not refcounted, an attacker can start open()ing one of the rawdata files, and at the same time remove the last reference to this rawdata (by removing the corresponding profile, for example), which frees its struct aa_loaddata; as a result, when seq_rawdata_open() is reached, i_private is a dangling pointer and freed memory is accessed. The rawdata inodes weren't refcounted to avoid a circular refcount and were supposed to be held by the profile rawdata reference. However during profile removal there is a window where the vfs and profile destruction race, resulting in the use after free. Fix this by moving to a double refcount scheme. Where the profile refcount on rawdata is used to break the circular dependency. Allowing for freeing of the rawdata once all inode references to the rawdata are put.
02KernelScan AI Analysis
Risk summary
An attacker with local access and profile management capabilities can trigger a use-after-free condition by racing file operations against profile removal, potentially leading to kernel memory corruption, denial of service, or privilege escalation.
Vulnerability analysis
Root Cause: A race condition exists between VFS operations and AppArmor profile destruction. When an attacker opens a rawdata file via seq_rawdata_open() while simultaneously removing the corresponding profile, the rawdata struct aa_loaddata can be freed before the file operation completes. The rawdata inodes were not properly refcounted to avoid circular dependencies, creating a window where i_private becomes a dangling pointer.
Attack Surface: Local attack requiring the ability to open AppArmor rawdata files in /sys/kernel/security/apparmor/ and simultaneously trigger profile removal. Requires filesystem access to AppArmor's sysfs interface and the ability to manipulate profiles, typically requiring elevated privileges or specific AppArmor policy management permissions.
Fix Mechanism: The patch implements a double refcount scheme with two separate reference counters: 'count' for inode/filesystem references and 'pcount' for profile references. This allows proper lifecycle management where profiles can be destroyed without immediately freeing rawdata if filesystem operations are still active. The profile refcount breaks the circular dependency while ensuring rawdata remains valid during concurrent access.
03Fix Versions
| Branch | Fixed in | Patch commit |
|---|---|---|
| 5.10 | 5.10.253 | 3b8e77c7abab |
| 5.15 | 5.15.203 | d9d8560b9b79 |
| 6.1 | 6.1.169 | 6b6ba87579c7 |
| 6.12 | 6.12.77 | f9761add6d10 |
| 6.18 | 6.18.18 | af782cc8871e |
| 6.19 | 6.19.8 | 763e838adc3c |
| 6.6 | 6.6.130 | 6ef1f2926c41 |
| mainline | 7.0 | a0b7091c4de4 |