{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-74632","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2026-08-15T05:44:03.922Z","datePublished":"2026-08-22T15:32:13.078Z","dateUpdated":"2026-08-25T05:40:56.960Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-08-25T05:40:56.960Z"},"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/huge_memory: fix huge_zero_pfn race\n\nPatch series \"mm/huge_memory: fix huge_zero_pfn race\", v2.\n\nThere is a subtle race in the reference-counted huge_zero_folio\nimplementation.\n\nThe fast path atomic logic fails to account for the fact that the shrinker\n(which drops the final huge_zero_refcount pin) can overwrite huge_zero_pfn\nwith the ~0UL sentinel value in shrink_huge_zero_folio_scan() after a\nracing get_huge_zero_folio() installed a valid value there.\n\nThis results in huge_zero_folio being correctly set but huge_zero_pfn\nbeing set incorrectly and thus is_huge_zero_pfn() and consequently\nis_huge_zero_pmd() will misidentify the huge zero folio as being an\nordinary THP folio.\n\nThis can result in the huge zero folio being split and otherwise treated\nincorrectly.\n\nThe solution to this is very subtle as there is an atomic fast path, and\nthus ordering in weakly ordered architectures has to be treated very\ncarefully.\n\nThe first commit fixes the issue by introducing a spinlock around\nhuge_zero_[pfn, folio, refcount] write, with careful consideration paid to\nload/store ordering in the fast path.  It is placed first and kept as\nsmall as possible so that it can be backported on its own.\n\nThe second commit is a pure cleanup which reworks the\nCONFIG_PERSISTENT_HUGE_ZERO_FOLIO logic to better separate the persistent\nlogic from the dynamically allocated one.\n\n\nThis patch (of 2):\n\nIf !CONFIG_PERSISTENT_HUGE_ZERO_FOLIO, the huge_zero_folio is refcounted\nby huge_zero_refcount and returned by mm_get_huge_zero_folio().\n\nWhen the caller is done with the huge zero page, its reference count is\ndecremented.  Only a shrinker can set the reference count to zero.\n\nA race can unfortunately occur between a shrinker decrementing the\nreference count to zero and a concurrent page fault.\n\nThis is because shrink_huge_zero_folio_scan() might, if very unlucky, be\npreempted between setting huge_zero_refcount to zero and writing an\ninvalid value.\n\nDuring this time get_huge_zero_folio() could write to huge_zero_pfn before\nshrink_huge_zero_folio_scan() resumes.\n\nIn this event the huge zero folio will be persistently misidentified\ncausing the THP code path to be entered inappropriately for the huge zero\nfolio:\n\n                CPU 0                                   CPU 1\n=======================================|=================================\nshrink_huge_zero_folio_scan()          |\n   atomic_cmpxchg() sets refcount to 0 |\n   xchg() sets huge_zero_folio to NULL | get_huge_zero_folio()\n                 |                     |    atomic_inc_not_zero() -> zero\n      preempted for a long time        |    Allocate new huge zero folio\n                 |                     |    Write valid huge_zero_folio\n                 v                     |    Write valid huge_zero_pfn\n  Overwrite huge_zero_pfn with ~0UL   <--- Invalid overwrite!\n\nThis results in is_huge_zero_pfn() and is_huge_zero_pmd() incorrectly\nreturning false for a huge zero page which could result in issues like the\nhuge zero folio being incorrectly split.\n\nNote that the issue is with huge_zero_pfn not huge_zero_folio, as\nget_huge_zero_folio() uses cmpxchg() gated on huge_zero_folio being NULL\nwith a retry loop and shrink_huge_zero_folio_scan() uses xchg() to set\nhuge_zero_folio.\n\nFix the issue by introducing a spinlock, huge_zero_lock, to prevent\nconcurrent write of huge_zero_folio, huge_zero_pfn and huge_zero_refcount.\n\nThere needs to be significant care taken here to ensure correctness:\n\nThe fast path in get_huge_zero_folio() uses atomic_inc_not_zero(), which\nis outside of the critical section, and means huge zero allocation is\ngated on zero huge_zero_refcount.\n\nThe fast path doesn't use huge_zero_lock, so the critical section is\nirrelevant to it.\n\nSo invariants are required - huge_zero_refcount MUST:\n\n* Only be set in the huge_zero_lock critical section to ensure\n  serialisation of huge_zero_pfn, huge_zero_folio and\n---truncated---"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - Reached only through local page faults in handle_mm_fault()->create_huge_pmd()->do_huge_pmd_anonymous_page()->mm_get_huge_zero_folio() racing shrink_huge_zero_folio_scan(); no network, adjacent, or physical path exists.\nAC:L - Attacker controls both race sides: concurrent anonymous read faults drive get_huge_zero_folio() while memory-pressure reclaim drives shrink_huge_zero_folio_scan(); multi-threaded hammering makes the preemption window reliably winnable.\nPR:L - Any unprivileged local process can mmap anonymous memory and trigger huge-zero PMD installation on typical CONFIG_TRANSPARENT_HUGEPAGE systems with zero-page enabled; no root, capabilities, or authentication is required.\nUI:N - Exploitation is fully attacker-driven via standard syscalls (mmap, madvise, read, munmap) and deliberate memory pressure; no separate victim action beyond the attacker running their own workload is needed.\nS:U - Corrupts kernel-global huge_zero_folio metadata and rmap/RSS accounting within the kernel security boundary; this is not a VM escape, IOMMU bypass, or cross-authority sandbox break.\nC:H - Misidentification routes the shared huge zero folio through normal THP split/teardown (folio_remove_rmap_pmd, incorrect accounting), corrupting global page metadata with plausible arbitrary kernel memory disclosure leverage.\nI:H - Wrong-path splitting manipulates refcount/rmap state on the system-wide huge zero singleton folio, corrupting kernel integrity and enabling memory-write/control-flow primitives from metadata corruption.\nA:H - Mis-split triggers kernel WARN/BUG_ON, bad page state, and bad rss-counter failures during reclaim or teardown, causing kernel oops, panic, or hang on affected THP systems."}]}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/huge_memory.c"],"versions":[{"version":"3b77e8c8cde581dadab9a0f1543a347e24315f11","lessThan":"9332b080ad57650d1dc582e54517f9fc78ef89cc","status":"affected","versionType":"git"},{"version":"3b77e8c8cde581dadab9a0f1543a347e24315f11","lessThan":"f3a874a903053c53fb53ba287ea9eacda69c68e8","status":"affected","versionType":"git"},{"version":"3b77e8c8cde581dadab9a0f1543a347e24315f11","lessThan":"6024f6d0d9b9ca5138bfc4ac6f6e4bdf616e42b3","status":"affected","versionType":"git"},{"version":"3b77e8c8cde581dadab9a0f1543a347e24315f11","lessThan":"105d04edbec83010df5728f74d17fd9c108e7553","status":"affected","versionType":"git"},{"version":"3b77e8c8cde581dadab9a0f1543a347e24315f11","lessThan":"ab7e4b407c7f58d1a003134eff3841f303d5ccc2","status":"affected","versionType":"git"},{"version":"3b77e8c8cde581dadab9a0f1543a347e24315f11","lessThan":"33192a26cddea7a7e4ca66e5c3eebd36fa8be2bb","status":"affected","versionType":"git"},{"version":"fc1fbc5b017b6f5ef24a4a93f33cd022225e01c8","status":"affected","versionType":"git"},{"version":"bd092a0f19423d7e9e81182314a96ecd6a14f3b7","status":"affected","versionType":"git"},{"version":"6527d8ef68c3ca3c455e38ae2a37cd7810caec73","status":"affected","versionType":"git"},{"version":"b1daf8f862136894a4595770a44e4508808fb806","status":"affected","versionType":"git"},{"version":"4.19.197","lessThan":"4.20","status":"affected","versionType":"semver"},{"version":"5.4.129","lessThan":"5.5","status":"affected","versionType":"semver"},{"version":"5.10.47","lessThan":"5.11","status":"affected","versionType":"semver"},{"version":"5.12.14","lessThan":"5.13","status":"affected","versionType":"semver"}]},{"product":"Linux","vendor":"Linux","defaultStatus":"affected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/huge_memory.c"],"versions":[{"version":"5.13","status":"affected"},{"version":"0","lessThan":"5.13","status":"unaffected","versionType":"semver"},{"version":"6.1.184","lessThanOrEqual":"6.1.*","status":"unaffected","versionType":"semver"},{"version":"6.6.153","lessThanOrEqual":"6.6.*","status":"unaffected","versionType":"semver"},{"version":"6.12.104","lessThanOrEqual":"6.12.*","status":"unaffected","versionType":"semver"},{"version":"6.18.45","lessThanOrEqual":"6.18.*","status":"unaffected","versionType":"semver"},{"version":"7.1.9","lessThanOrEqual":"7.1.*","status":"unaffected","versionType":"semver"},{"version":"7.2","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.13","versionEndExcluding":"6.1.184"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.13","versionEndExcluding":"6.6.153"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.13","versionEndExcluding":"6.12.104"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.13","versionEndExcluding":"6.18.45"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.13","versionEndExcluding":"7.1.9"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.13","versionEndExcluding":"7.2"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.19.197"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.4.129"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.10.47"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.12.14"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/9332b080ad57650d1dc582e54517f9fc78ef89cc"},{"url":"https://git.kernel.org/stable/c/f3a874a903053c53fb53ba287ea9eacda69c68e8"},{"url":"https://git.kernel.org/stable/c/6024f6d0d9b9ca5138bfc4ac6f6e4bdf616e42b3"},{"url":"https://git.kernel.org/stable/c/105d04edbec83010df5728f74d17fd9c108e7553"},{"url":"https://git.kernel.org/stable/c/ab7e4b407c7f58d1a003134eff3841f303d5ccc2"},{"url":"https://git.kernel.org/stable/c/33192a26cddea7a7e4ca66e5c3eebd36fa8be2bb"}],"title":"mm/huge_memory: fix huge_zero_pfn race","x_generator":{"engine":"bippy-1.2.0"}}}}