CVE-2025-39725 mm/vmscan: fix hwpoisoned large folio handling in shrink_folio_list

Medium 5.5 Published Updated

A race condition in Linux kernel memory reclaim causes a null pointer dereference and kernel panic when handling hwpoisoned large folios.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2025-39725?

CVE-2025-39725 is a medium-severity vulnerability in Linux kernel, published on 5 Sep 2025. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

In the Linux kernel, the following vulnerability has been resolved:

mm/vmscan: fix hwpoisoned large folio handling in shrink_folio_list

In shrink_folio_list(), the hwpoisoned folio may be large folio, which can't be handled by unmap_poisoned_folio(). For THP, try_to_unmap_one() must be passed with TTU_SPLIT_HUGE_PMD to split huge PMD first and then retry. Without TTU_SPLIT_HUGE_PMD, we will trigger null-ptr deref of pvmw.pte. Even we passed TTU_SPLIT_HUGE_PMD, we will trigger a WARN_ON_ONCE due to the page isn't in swapcache.

Since UCE is rare in real world, and race with reclaimation is more rare, just skipping the hwpoisoned large folio is enough. memory_failure() will handle it if the UCE is triggered again.

This happens when memory reclaim for large folio races with memory_failure(), and will lead to kernel panic. The race is as follows:

cpu0 cpu1 shrink_folio_list memory_failure TestSetPageHWPoison unmap_poisoned_folio --> trigger BUG_ON due to unmap_poisoned_folio couldn't handle large folio

[[email protected]: add comment to unmap_poisoned_folio()]

Weakness: CWE-476

Which versions are affected by CVE-2025-39725?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2025-39725?

Apply the vendor's patch.

Is CVE-2025-39725 being exploited?

There is no known exploitation of CVE-2025-39725 in the wild and no public exploit code.

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2025-39725, DEBIAN-CVE-2025-39725, GHSA-qmpx-wcm9-r94f, UBUNTU-CVE-2025-39725.

Is CVE-2025-39725 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free