CVE-2026-139108
published high CVSS 3.1 · 7.8apparmor: fix table_size() integer overflow on 32 bit
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linuxe06f75a6a2b43bd3a7a197bd21466f9da130e4af to < 9a934c8a856423dc55c3f7dd001dd48b455b27a1 · e06f75a6a2b43bd3a7a197bd21466f9da130e4af to < 60b954df92a58869cbfc0dcc4947f8b5ab309a89 · e06f75a6a2b43bd3a7a197bd21466f9da130e4af to < 3b2d73aa4c0228b232af7950f2d0cc32b9b8b81a · e06f75a6a2b43bd3a7a197bd21466f9da130e4af to < 449195a4bb7d9c456c02b871eec6905edb449bd2 · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux2.6.36 (affected) · 0 to < 2.6.36 (unaffected · semver) · 6.12.119 through 6.12.* (unaffected · semver) · 6.18.65 through 6.18.* (unaffected · semver) · 7.3.6 through 7.3.* (unaffected · semver) · 7.4-rc1 and later (unaffected · original_commit_for_fix) · Other versions: affected | Version-specific | Not stated | Linux |
| Amazon Linux | AL2 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
Description
In the Linux kernel, the following vulnerability has been resolved: apparmor: fix table_size() integer overflow on 32 bit table_size() checks ALIGN(sizeof(struct table_header) + len * el_size, 8) in size_t, where @len is td_lolen, a u32 user-provided value from the policy blob. On 32 bit kernels both operations can overflow. Triggering this bug allows to: - overflow a 16 byte allocation with up to 4GiB of policy data - store the table header at address ZERO_SIZE_PTR (kvzalloc(0)) However, this bug requires CAP_MAC_ADMIN, only affects 32 bit kernels, and the copy runs until the machine is destroyed, so it gives no controllable primitive and is therefore not a security issue. Compute the size with the checked helpers and return 0 when the result is not representable, so the callers can reject the table. A valid table is never 0 bytes, the header alone is 12. 64 bit kernels cannot overflow (these structs are 32 bit), and are hence not affected.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.8 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Scenarios
- en: AV:L - The wrapping td_lolen is a u32 in the policy blob the attacker write()s to apparmorfs .load/.replace (profile_load → policy_update → aa_replace_profiles → aa_unpack → unpack_pdb → unpack_dfa → aa_dfa_unpack → unpack_table → table_size). No network protocol carries the blob. AC:L - The attacker picks td_lolen=0x40000000+k with YYTD_DATA32, so len*4 wraps and tsize=ALIGN(12+4k,8) passes the bsize check every time. There is no race and no outside state. Sizing the write over 4 MiB and placing the table at the buffer's end are the attacker's own choices. PR:L - aa_may_manage_policy() → aa_policy_admin_capable() checks CAP_MAC_ADMIN in subj_cred->user_ns. With unprivileged_userns_apparmor_policy=1 (the default) and user_ns->level == view_ns->level, root in an LXC/LXD container with its own AppArmor namespace can load policy without host root. A bare unshare -U fails this level check. UI:N - The attacker's own write() of the crafted blob to .load/.replace triggers the overflow. Nobody else has to load policy, mount anything or open a file. S:U - The overflow corrupts kernel heap memory next to the kvzalloc'd table in the same kernel that does the policy unpack. Container root reaching the host kernel is ordinary kernel privilege escalation, with no VM or IOMMU boundary crossed. C:H - A >4 MiB policy write puts aa_loaddata->data in vmalloc, and the copy faults on its guard page after a length the attacker picks. That makes a controlled-length, controlled-content overflow of a chosen kmalloc-N object, which can corrupt neighbouring objects to build kernel read primitives. I:H - UNPACK_ARRAY/memcpy in unpack_table() writes attacker blob bytes past the undersized table, and DATA8 wraps write the header to ZERO_SIZE_PTR. This is an out-of-bounds slab write that can be turned into control-flow hijack. A:H - Every trigger oopses: the copy faults on the vmalloc guard page, or a kmalloc'd blob leads to a multi-GiB wild write across lowmem that destroys the machine. The kvzalloc(0) path also faults writing the header at 0x10.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | e06f75a6a2b43bd3a7a197bd21466f9da130e4af to < 9a934c8a856423dc55c3f7dd001dd48b455b27a1 (affected · git)e06f75a6a2b43bd3a7a197bd21466f9da130e4af to < 60b954df92a58869cbfc0dcc4947f8b5ab309a89 (affected · git)e06f75a6a2b43bd3a7a197bd21466f9da130e4af to < 3b2d73aa4c0228b232af7950f2d0cc32b9b8b81a (affected · git)e06f75a6a2b43bd3a7a197bd21466f9da130e4af to < 449195a4bb7d9c456c02b871eec6905edb449bd2 (affected · git)Default: unaffected | Linux · cna |
| Linux | Linux | 2.6.36 (affected)0 to < 2.6.36 (unaffected · semver)6.12.119 through 6.12.* (unaffected · semver)6.18.65 through 6.18.* (unaffected · semver)7.3.6 through 7.3.* (unaffected · semver)7.4-rc1 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
4Provider assertions
1Linux · cna
apparmor: fix table_size() integer overflow on 32 bit
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 701a1a55e8ca877146530059152c3bf1bfde1cc38cbc45b9e1c1478ece762b7d
- Ingested
- 01 Dec 2026, 05:47:22 UTC
- Source record
- Official CVE record