{"id":"CVE-2026-99742","summary":"mm/mempolicy: charge shared policy nodes","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/mempolicy: charge shared policy nodes\n\nAny local user can bypass memory.max with mbind() on a tmpfs file, and\nallocate unbounded kernel memory.\n\nmbind() sets a NUMA memory policy for a range of a mapping. If the\nmapping is of a shmem and friends, the kernel also stores the policy on\nthe inode, in a tree with one entry per range of the file.\n\nEach mbind() on a single page of a mapping can add one shared policy node\n(struct sp_node) and one struct mempolicy to that tree. They outlive the\nmapping and stay around until the inode is destroyed. The tree is not\nbounded by the file size, so the file can be empty.\n\nMemory that user space can allocate must be charged to a memory cgroup. A\nslab cache does that for all of its objects if it is created with\nSLAB_ACCOUNT. numa_policy_init() creates the slab caches for both\nstructs without SLAB_ACCOUNT, so they are not charged to any cgroup.\n\nReproduced with mbind() on single pages of an empty tmpfs file, from a\ncgroup with memory.max=8M: the global OOM killer killed tasks owned by\nroot, and the machine panicked.\n\nFix this by creating both caches with SLAB_ACCOUNT. This change implies\nthat mbind() can now fail when running into memcg limits. Further,\nthe policy_cache also serves task and VMA policies, so they are\nsimilarly accounted now.\n\nNote that per-file limits are not really helpful, as the user could\nsimply use many files; having limits per user is tricky as well.\n\nFix generated by an LLM and submitted by Chris Mason in private.\n\n[ david: smaller description tweaks ]","modified":"2026-11-20T07:01:15.966920946Z","published":"2026-11-20T05:51:14.462Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/99xxx/CVE-2026-99742.json"},"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/0109fa404651e20493ca35a9a7d4f87861148064"},{"type":"WEB","url":"https://git.kernel.org/stable/c/40e340bab4d07958b2077c16650c3da5c76d5820"},{"type":"WEB","url":"https://git.kernel.org/stable/c/68b2aa37afa390f08de13bc0bac61a9ded3318bc"},{"type":"WEB","url":"https://git.kernel.org/stable/c/d500c37437cce47e492c561757ece2596e21446a"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/99xxx/CVE-2026-99742.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-99742"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"5d097056c9a017a3b720849efb5432f37acabbac"},{"fixed":"d500c37437cce47e492c561757ece2596e21446a"},{"fixed":"40e340bab4d07958b2077c16650c3da5c76d5820"},{"fixed":"0109fa404651e20493ca35a9a7d4f87861148064"},{"fixed":"68b2aa37afa390f08de13bc0bac61a9ded3318bc"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-99742.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.5.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.5"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-99742.json"}}],"schema_version":"1.9.2"}