CVE-2026-139108: apparmor: fix table_size() integer overflow on 32 bit
In the Linux kernel, the following vulnerability has been resolved:
apparmor: fix tablesize() integer overflow on 32 bit
tablesize() checks ALIGN(sizeof(struct tableheader) + len elsize, 8) in sizet, where @len is tdlolen, 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 ZEROSIZEPTR (kvzalloc(0))
However, this bug requires CAPMACADMIN, 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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In the Linux kernel AppArmor table_size() calculation, use checked helpers to compute the aligned table size and return 0 if the result is not representable, allowing callers to reject the table.