KernelScan.io

HIGH Introduced in 4.13

apparmor LabelVec OOB

CVE-2026-89761

CVSS 7.8 / 10.0 NVD

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

KernelScan AI8.4HIGH

01

In the Linux kernel, the following vulnerability has been resolved: apparmor: fix out-of-bounds write when null terminating a label vec aa_vec_unique() null terminates at vec[n - dups] when VEC_FLAG_TERMINATE is passed. If the components are all distinct no duplicates are dropped, dups is 0 and the terminator goes to vec[n], so the caller has to provide room for n + 1 entries. aa_label_strn_parse() sets up its vector with vec_setup(profile, vec, len, gfp) and then calls aa_vec_unique(vec, len, VEC_FLAG_TERMINATE), but vec_setup() does not reserve the terminator entry. Up to LOCAL_VEC_ENTRIES it uses the local array of LOCAL_VEC_ENTRIES pointers, above that it allocates exactly len pointers. The terminator therefore lands one entry past the end of the local array when len is LOCAL_VEC_ENTRIES, and one entry past the end of the allocation when len is larger. len comes from the number of "//&" separated components in the label name and label_count_strn_entries() does not bound it. An unprivileged task reaches the parse by writing to /proc/self/attr/apparmor/current or through lsm_set_self_attr(2), both of which go through do_setattr(), and the name is parsed before the change_profile permission is checked. The query_label() path behind the securityfs .access file, which is mode 0666, performs no permission check at all. Every component has to resolve to a loaded profile, so a system with policy loaded is required. The other two VEC_FLAG_TERMINATE users work on a label vec that aa_label_alloc() has already sized with "+ 1 for null terminator entry on vec". Reserve the same entry in vec_setup() and DEFINE_VEC(). Passing len + 1 from the caller instead would move len == LOCAL_VEC_ENTRIES out of the local array and into kzalloc().

02

Engine v0.6.0

Risk summary

An unprivileged local user can trigger an out-of-bounds write in the AppArmor label parser by supplying a crafted multi-component label name. The write corrupts memory adjacent to a stack array or heap allocation, potentially leading to privilege escalation or kernel crash. Any system with AppArmor policy loaded is affected.

Affectedsecurity/apparmor/include/label.h (apparmor)

Vulnerability analysis

When AppArmor parses a stacked label name, it builds a list of profile pointers and later adds a null terminator after removing duplicates. The code that prepares the list does not reserve space for that terminator, so when every component is unique the terminator is written one slot past the end of the backing memory. For shorter label names this overflows a stack-local buffer; for longer names it overflows a heap allocation. The fix reserves an extra slot in both the local buffer and the heap allocation so the terminator always lands inside valid memory. Any unprivileged local process can reach the parser through AppArmor's per-process attribute interface or through a world-writable securityfs file, because parsing happens before permission checks on those paths. The system must have AppArmor policy loaded so that each supplied component resolves to a real profile.

03

BranchIntroducedFixed inPatch commit
6.124.136.12.1099124e078ea22
6.184.136.18.5028069434aef6
6.64.136.6.160b17c8f5dcb36
7.24.137.2.436bdd0b45ec3
mainline4.137.39f1e40193eef
cip/6.124.136.12.111-cip329124e078ea22

04

State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.

CIP treeState
cip/6.12Fixed in 6.12.111-cip32
cip/6.1Affected — no CIP fix yet (latest 6.1.189-cip61)
cip/6.1-rtAffected — no CIP fix yet (latest 6.1.189-cip61-rt32)
cip/5.10Affected — no CIP fix yet (latest 5.10.271-cip78)
cip/5.10-rtAffected — no CIP fix yet (latest 5.10.268-cip77-rt34)
cip/4.19Affected — no CIP fix yet (latest 4.19.325-cip136)
cip/4.19-rtAffected — no CIP fix yet (latest 4.19.325-cip136-rt50)