{"id":"CVE-2025-39725","state":"PUBLISHED","title":"mm/vmscan: fix hwpoisoned large folio handling in shrink_folio_list","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/vmscan: fix hwpoisoned large folio handling in shrink_folio_list\n\nIn shrink_folio_list(), the hwpoisoned folio may be large folio, which\ncan't be handled by unmap_poisoned_folio().  For THP, try_to_unmap_one()\nmust be passed with TTU_SPLIT_HUGE_PMD to split huge PMD first and then\nretry.  Without TTU_SPLIT_HUGE_PMD, we will trigger null-ptr deref of\npvmw.pte.  Even we passed TTU_SPLIT_HUGE_PMD, we will trigger a\nWARN_ON_ONCE due to the page isn't in swapcache.\n\nSince UCE is rare in real world, and race with reclaimation is more rare,\njust skipping the hwpoisoned large folio is enough.  memory_failure() will\nhandle it if the UCE is triggered again.\n\nThis happens when memory reclaim for large folio races with\nmemory_failure(), and will lead to kernel panic.  The race is as\nfollows:\n\ncpu0      cpu1\n shrink_folio_list memory_failure\n  TestSetPageHWPoison\n  unmap_poisoned_folio\n  --> trigger BUG_ON due to\n  unmap_poisoned_folio couldn't\n   handle large folio\n\n[tujinjiang@huawei.com: add comment to unmap_poisoned_folio()]","publishedAt":"2025-09-05T17:27:18.719Z","updatedAt":"2026-05-23T16:00:35.031Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"1c9798bf8145a92abf45aa9d38a6406d9eb8bdf0","status":"affected","lessThan":"656eaddbc952e1baae2f69281c22debe22140312","versionType":"git"},{"version":"1b0449544c6482179ac84530b61fc192a6527bfd","status":"affected","lessThan":"c1101113d45838a823188ae25c61af97552a28ae","versionType":"git"},{"version":"1b0449544c6482179ac84530b61fc192a6527bfd","status":"affected","lessThan":"9f1e8cd0b7c4c944e9921b52a6661b5eda2705ab","versionType":"git"},{"version":"912e9f0300c3564b72a8808db406e313193a37ad","status":"affected","versionType":"git"},{"version":"6.12.26","status":"affected","lessThan":"6.12.41","versionType":"semver"},{"version":"6.14.5","status":"affected","lessThan":"6.15","versionType":"semver"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/memory-failure.c","mm/vmscan.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.15","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.15","versionType":"semver"},{"version":"6.12.41","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.15.9","status":"unaffected","lessThanOrEqual":"6.15.*","versionType":"semver"},{"version":"6.16","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/memory-failure.c","mm/vmscan.c"]}],"references":["https://git.kernel.org/stable/c/656eaddbc952e1baae2f69281c22debe22140312","https://git.kernel.org/stable/c/c1101113d45838a823188ae25c61af97552a28ae","https://git.kernel.org/stable/c/9f1e8cd0b7c4c944e9921b52a6661b5eda2705ab"],"weaknesses":[],"ingestedAt":"2026-10-29T20:09:09.358Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/39xxx/CVE-2025-39725.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-39725","state":"PUBLISHED","datePublished":"2025-09-05T17:27:18.719Z","dateUpdated":"2026-05-23T16:00:35.031Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-04-16T07:20:57.117Z"},"containers":{"cna":{"title":"mm/vmscan: fix hwpoisoned large folio handling in shrink_folio_list","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nmm/vmscan: fix hwpoisoned large folio handling in shrink_folio_list\n\nIn shrink_folio_list(), the hwpoisoned folio may be large folio, which\ncan't be handled by unmap_poisoned_folio().  For THP, try_to_unmap_one()\nmust be passed with TTU_SPLIT_HUGE_PMD to split huge PMD first and then\nretry.  Without TTU_SPLIT_HUGE_PMD, we will trigger null-ptr deref of\npvmw.pte.  Even we passed TTU_SPLIT_HUGE_PMD, we will trigger a\nWARN_ON_ONCE due to the page isn't in swapcache.\n\nSince UCE is rare in real world, and race with reclaimation is more rare,\njust skipping the hwpoisoned large folio is enough.  memory_failure() will\nhandle it if the UCE is triggered again.\n\nThis happens when memory reclaim for large folio races with\nmemory_failure(), and will lead to kernel panic.  The race is as\nfollows:\n\ncpu0      cpu1\n shrink_folio_list memory_failure\n  TestSetPageHWPoison\n  unmap_poisoned_folio\n  --> trigger BUG_ON due to\n  unmap_poisoned_folio couldn't\n   handle large folio\n\n[tujinjiang@huawei.com: add comment to unmap_poisoned_folio()]"}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"1c9798bf8145a92abf45aa9d38a6406d9eb8bdf0","status":"affected","lessThan":"656eaddbc952e1baae2f69281c22debe22140312","versionType":"git"},{"version":"1b0449544c6482179ac84530b61fc192a6527bfd","status":"affected","lessThan":"c1101113d45838a823188ae25c61af97552a28ae","versionType":"git"},{"version":"1b0449544c6482179ac84530b61fc192a6527bfd","status":"affected","lessThan":"9f1e8cd0b7c4c944e9921b52a6661b5eda2705ab","versionType":"git"},{"version":"912e9f0300c3564b72a8808db406e313193a37ad","status":"affected","versionType":"git"},{"version":"6.12.26","status":"affected","lessThan":"6.12.41","versionType":"semver"},{"version":"6.14.5","status":"affected","lessThan":"6.15","versionType":"semver"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/memory-failure.c","mm/vmscan.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.15","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.15","versionType":"semver"},{"version":"6.12.41","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.15.9","status":"unaffected","lessThanOrEqual":"6.15.*","versionType":"semver"},{"version":"6.16","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["mm/memory-failure.c","mm/vmscan.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/656eaddbc952e1baae2f69281c22debe22140312"},{"url":"https://git.kernel.org/stable/c/c1101113d45838a823188ae25c61af97552a28ae"},{"url":"https://git.kernel.org/stable/c/9f1e8cd0b7c4c944e9921b52a6661b5eda2705ab"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-05-23T16:00:35.031Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.12.26","versionEndExcluding":"6.12.41"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.15","versionEndExcluding":"6.15.9"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.15","versionEndExcluding":"6.16"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.14.5"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}