CVE-2026-138864: mm/page_counter: avoid integer overflow in effective_protection()
In the Linux kernel, the following vulnerability has been resolved:
mm/pagecounter: avoid integer overflow in effectiveprotection()
Patch series "mm/mglru: fix ineffective memory protection for non-kswapd reclaim", v4.
For MGLRU, memory.min/low is not honored during non-kswapd global reclaim (global direct reclaim and root-level memory.reclaim), because these paths shrink memcgs using stale protection (emin/elow).
Patch 2 is the actual fix. Patch 1 is a prerequisite: an integer overflow in effectiveprotection(), spotted by the sashiko review tool, which patch 2's new caller would also be exposed to.
This patch (of 2):
effectiveprotection() scales a parent's protection by a ratio of page counts, e.g. for recursive protection:
(parenteffective - siblingsprotected) (usage - protected) / (parentusage - siblingsprotected)
The multiply is done at unsigned long width before dividing. On systems with >= 16TB RAM the product can exceed 2^64 and wrap, giving a bogus protection value and silently breaking memory.min/low enforcement.
Use mulu64u64divu64() to multiply in a 128-bit intermediate. Because usage and parentusage are not read atomically (a child is charged before its parent), usage - protected can briefly exceed the divisor, making the quotient overflow 64 bits and trap (#DE on x86). Cap it so the ratio stays <= 1.
Reported by the sashiko review tool [1].
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In the Linux kernel, update effective_protection() to use mul_u64_u64_div_u64() so the multiplication uses a 128-bit intermediate.