{"id":"CVE-2026-138864","summary":"mm/page_counter: avoid integer overflow in effective_protection()","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/page_counter: avoid integer overflow in effective_protection()\n\nPatch series \"mm/mglru: fix ineffective memory protection for non-kswapd\nreclaim\", v4.\n\nFor MGLRU, memory.min/low is not honored during non-kswapd global reclaim\n(global direct reclaim and root-level memory.reclaim), because these paths\nshrink memcgs using stale protection (emin/elow).\n\nPatch 2 is the actual fix.  Patch 1 is a prerequisite: an integer overflow\nin effective_protection(), spotted by the sashiko review tool, which patch\n2's new caller would also be exposed to.\n\n\nThis patch (of 2):\n\neffective_protection() scales a parent's protection by a ratio of page\ncounts, e.g.  for recursive protection:\n\n\t(parent_effective - siblings_protected) * (usage - protected)\n\t\t/ (parent_usage - siblings_protected)\n\nThe multiply is done at unsigned long width before dividing.  On systems\nwith \u003e= 16TB RAM the product can exceed 2^64 and wrap, giving a bogus\nprotection value and silently breaking memory.min/low enforcement.\n\nUse mul_u64_u64_div_u64() to multiply in a 128-bit intermediate.  Because\nusage and parent_usage are not read atomically (a child is charged before\nits parent), usage - protected can briefly exceed the divisor, making the\nquotient overflow 64 bits and trap (#DE on x86).  Cap it so the ratio\nstays \u003c= 1.\n\nReported by the sashiko review tool [1].","modified":"2026-11-30T15:01:20.852113463Z","published":"2026-11-30T13:25:42.018Z","database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/138xxx/CVE-2026-138864.json","cna_assigner":"Linux"},"references":[{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"},{"type":"WEB","url":"https://git.kernel.org/stable/c/2748bfeb1c12aa99670c08a34f5ff07ba6945c89"},{"type":"WEB","url":"https://git.kernel.org/stable/c/7809ce47b05671e1fa6d74bead892d6ad6c1403b"},{"type":"WEB","url":"https://git.kernel.org/stable/c/c380274c205add299b48135ef6cd11e67aac29b2"},{"type":"WEB","url":"https://git.kernel.org/stable/c/d8957533806e9f291e8e65ee2bb12163ce5ecebc"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/138xxx/CVE-2026-138864.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-138864"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"bc50bcc6e00b8509e64875c674f4573e8b4df1e8"},{"fixed":"c380274c205add299b48135ef6cd11e67aac29b2"},{"fixed":"d8957533806e9f291e8e65ee2bb12163ce5ecebc"},{"fixed":"2748bfeb1c12aa99670c08a34f5ff07ba6945c89"},{"fixed":"7809ce47b05671e1fa6d74bead892d6ad6c1403b"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-138864.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"5.7.0"},{"fixed":"6.12.118"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.18.64"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.3.4"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-138864.json"}}],"schema_version":"1.9.2"}