{"id":"CVE-2025-39725","aliases":["CVE-2025-39725"],"related":[],"kind":"vulnerability","state":"published","title":"mm/vmscan: fix hwpoisoned large folio handling in shrink_folio_list","summary":"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()]","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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()]","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nmm/vmscan: corregir el manejo de folios grandes 'hwpoisoned' en shrink_folio_list\n\nEn shrink_folio_list(), el folio 'hwpoisoned' puede ser un folio grande, que no puede ser manejado por unmap_poisoned_folio(). Para THP, try_to_unmap_one() debe ser pasado con TTU_SPLIT_HUGE_PMD para dividir el PMD enorme primero y luego reintentar. Sin TTU_SPLIT_HUGE_PMD, activaremos una desreferencia de puntero nulo de pvmw.pte. Incluso si pasamos TTU_SPLIT_HUGE_PMD, activaremos un WARN_ON_ONCE debido a que la página no está en la swapcache.\n\nDado que UCE es raro en el mundo real, y la condición de carrera con la reclamación es aún más rara, simplemente omitir el folio grande 'hwpoisoned' es suficiente. memory_failure() lo manejará si el UCE se activa de nuevo.\n\nEsto ocurre cuando la reclamación de memoria para un folio grande entra en condición de carrera con memory_failure(), y conducirá a un pánico del kernel. La condición de carrera es la siguiente:\n\ncpu0      cpu1\n shrink_folio_list memory_failure\n  TestSetPageHWPoison\n  unmap_poisoned_folio\n  --> activa BUG_ON debido a\n  unmap_poisoned_folio no pudo\n   manejar folios grandes\n\n[tujinjiang@huawei.com: añadir comentario a unmap_poisoned_folio()]","source":"nvd"}],"published":"2025-09-05T17:27:18.719Z","modified":"2026-10-19T21:10:00.160Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":["CWE-476"],"affected":[{"ranges":[{"type":"git","introduced":"1c9798bf8145a92abf45aa9d38a6406d9eb8bdf0","fixed":"656eaddbc952e1baae2f69281c22debe22140312","status":"affected"},{"type":"git","introduced":"1b0449544c6482179ac84530b61fc192a6527bfd","fixed":"c1101113d45838a823188ae25c61af97552a28ae","status":"affected"},{"type":"git","introduced":"1b0449544c6482179ac84530b61fc192a6527bfd","fixed":"9f1e8cd0b7c4c944e9921b52a6661b5eda2705ab","status":"affected"},{"type":"git","version":"912e9f0300c3564b72a8808db406e313193a37ad","status":"affected"},{"type":"semver","introduced":"6.12.26","fixed":"6.12.41","status":"affected"},{"type":"semver","introduced":"6.14.5","fixed":"6.15","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.15","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.15","status":"unaffected"},{"type":"semver","introduced":"6.12.41","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.15.9","lastAffected":"6.15.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.16","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"6.12.26","fixed":"6.12.41"},{"status":"affected","introduced":"6.14.5","fixed":"6.15.9"},{"status":"affected","version":"6.16"},{"status":"affected","version":"6.16"},{"status":"affected","version":"6.16"},{"status":"affected","version":"6.16"},{"status":"affected","version":"6.16"},{"status":"affected","version":"6.16"},{"status":"affected","version":"6.16"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/656eaddbc952e1baae2f69281c22debe22140312","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/c1101113d45838a823188ae25c61af97552a28ae","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/9f1e8cd0b7c4c944e9921b52a6661b5eda2705ab","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-39725","url":"https://www.cve.org/CVERecord?id=CVE-2025-39725","licence":"CVE Terms of Use","modified":"2026-05-23T16:00:35.031Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-39725","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-39725","licence":"Public domain","modified":"2026-10-19T21:10:00.160Z"}],"updatedAt":"2026-11-25T22:59:04.284Z","epss":{"score":0.00163,"percentile":0.05737,"date":"2026-12-01T12:00:22.000Z"}}