CVE-2026-99837
published high CVSS 3.1 · 7.0apparmor: avoid potential double free when remapping DFA tables
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linuxb1a3e925e4fecb4a4b58f38ec39b550f8c849fe9 to < 7710dc49ae10d3493a18e5d53d7ef05913025e2d · 5955e8a3e956721594d618ae3f50a1541ef0dd09 to < 76688f427045ed2332bcd9fea6dac6e5b6117efa · 9208c05f9fdfd927ea160b97dfef3c379049fff2 to < 4971c6f821ff06a01c0779d0b1f9d0fd6452e3fe · 9208c05f9fdfd927ea160b97dfef3c379049fff2 to < 8d41718618ed58bab0cce12811c6a62491988f45 · 9208c05f9fdfd927ea160b97dfef3c379049fff2 to < 7ccd884a5e5386f4c7d98625113f4924f70286b4 · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux6.13 (affected) · 0 to < 6.13 (unaffected · semver) · 6.18.63 through 6.18.* (unaffected · semver) · 7.3.4 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: avoid potential double free when remapping DFA tables When unpacking a DFA, aa_dfa_unpack() stores a table in dfa->tables before attempting to remap a 16-bit table to 32-bit. However, remap_data16_to_data32() frees the original table when allocation of the new table fails. This leaves the corresponding dfa->tables entry pointing to freed memory. If the unpacking then fails, dfa_free() attempts to free the same table again. Only publish the table to dfa->tables after any required remapping has completed successfully, so that dfa->tables never contains a pointer to a table that has already been freed.
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.0 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
- Scenarios
- en: AV:L - Reached only by a local write() to AppArmor securityfs .load/.replace (profile_load -> policy_update -> aa_replace_profiles -> aa_unpack -> unpack_pdb -> unpack_dfa -> aa_dfa_unpack); the oversized DATA16 DEF/NXT/CHK table comes from the caller's own policy blob, with no remote input. AC:H - The double kvfree only happens if remap_data16_to_data32()'s kvzalloc fails. The attacker can force that with td_lolen >= 2^29 (u32 size > INT_MAX), but that u16 table is vmalloc'd and vfree() rejects the 2nd free with a WARN. Corruption needs the lazily purged VA reused inside the dfa_free window, or a real unaccounted GFP_KERNEL failure on a kmalloc'd table. PR:L - aa_may_manage_policy() -> aa_policy_admin_capable() needs CAP_MAC_ADMIN in the caller's userns plus aa_policy_view_capable(). With unprivileged_userns_apparmor_policy=1 (the default), container root in a child AppArmor namespace (LXD) passes; a bare unshare -U fails the level check. UI:N - The attacker builds the malformed DFA and issues the .load write() themselves; no other user or administrator action is involved. S:U - The stale dfa->tables[] pointer and both kvfree() calls stay inside kernel memory management in the same authority; no guest/host, IOMMU or sandbox boundary is crossed. C:H - dfa_free() frees dfa->tables[td_id] a second time. If the freed table's slab object, its large-kmalloc pages or the reused vmalloc VA is reallocated first, the attacker gets a UAF of a live kernel object that can be used to read kernel memory. I:H - A second kvfree of a kmalloc'd table corrupts the SLUB freelist or the large-kmalloc folio refcount. For a vmalloc'd table it frees whatever busy vmap_area now covers the address. Either way it yields overlapping allocations usable as kernel write primitives. A:H - Even the forceable >INT_MAX path fires WARN_ON_ONCE in __kvmalloc_node_noprof and the 'Trying to vfree() nonexistent vm area' WARN, which panic on panic_on_warn. A slab double free hits the SLAB_FREELIST_HARDENED BUG or corrupts the heap.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | b1a3e925e4fecb4a4b58f38ec39b550f8c849fe9 to < 7710dc49ae10d3493a18e5d53d7ef05913025e2d (affected · git)5955e8a3e956721594d618ae3f50a1541ef0dd09 to < 76688f427045ed2332bcd9fea6dac6e5b6117efa (affected · git)9208c05f9fdfd927ea160b97dfef3c379049fff2 to < 4971c6f821ff06a01c0779d0b1f9d0fd6452e3fe (affected · git)9208c05f9fdfd927ea160b97dfef3c379049fff2 to < 8d41718618ed58bab0cce12811c6a62491988f45 (affected · git)9208c05f9fdfd927ea160b97dfef3c379049fff2 to < 7ccd884a5e5386f4c7d98625113f4924f70286b4 (affected · git)Default: unaffected | Linux · cna |
| Linux | Linux | 6.13 (affected)0 to < 6.13 (unaffected · semver)6.18.63 through 6.18.* (unaffected · semver)7.3.4 through 7.3.* (unaffected · semver)7.4-rc1 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
5- https://git.kernel.org/stable/c/4971c6f821ff06a01c0779d0b1f9d0fd6452e3fe
- https://git.kernel.org/stable/c/76688f427045ed2332bcd9fea6dac6e5b6117efa
- https://git.kernel.org/stable/c/7710dc49ae10d3493a18e5d53d7ef05913025e2d
- https://git.kernel.org/stable/c/7ccd884a5e5386f4c7d98625113f4924f70286b4
- https://git.kernel.org/stable/c/8d41718618ed58bab0cce12811c6a62491988f45
Provider assertions
1Linux · cna
apparmor: avoid potential double free when remapping DFA tables
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- e37c1d9fa584d6240edc7a19384ecda7a159df94d9a0d2b2483c078289f75446
- Ingested
- 01 Dec 2026, 05:47:23 UTC
- Source record
- Official CVE record