CVE & CISA-KEV Catalog

CVE-2025-40230

UNSCORED

Description

In the Linux kernel, the following vulnerability has been resolved: mm: prevent poison consumption when splitting THP When performing memory error injection on a THP (Transparent Huge Page) mapped to userspace on an x86 server, the kernel panics with the following trace. The expected behavior is to terminate the affected process instead of panicking the kernel, as the x86 Machine Check code can recover from an in-userspace #MC. mce: [Hardware Error]: CPU 0: Machine Check Exception: f Bank 3: bd80000000070134 mce: [Hardware Error]: RIP 10:<ffffffff8372f8bc> {memchr_inv+0x4c/0xf0} mce: [Hardware Error]: TSC afff7bbff88a ADDR 1d301b000 MISC 80 PPIN 1e741e77539027db mce: [Hardware Error]: PROCESSOR 0:d06d0 TIME 1758093249 SOCKET 0 APIC 0 microcode 80000320 mce: [Hardware Error]: Run the above through 'mcelog --ascii' mce: [Hardware Error]: Machine check: Data load in unrecoverable area of kernel Kernel panic - not syncing: Fatal local machine check The root cause of this panic is that handling a memory failure triggered by an in-userspace #MC necessitates splitting the THP. The splitting process employs a mechanism, implemented in try_to_map_unused_to_zeropage(), which reads the pages in the THP to identify zero-filled pages. However, reading the pages in the THP results in a second in-kernel #MC, occurring before the initial memory_failure() completes, ultimately leading to a kernel panic. See the kernel panic call trace on the two #MCs. First Machine Check occurs // [1] memory_failure() // [2] try_to_split_thp_page() split_huge_page() split_huge_page_to_list_to_order() __folio_split() // [3] remap_page() remove_migration_ptes() remove_migration_pte() try_to_map_unused_to_zeropage() // [4] memchr_inv() // [5] Second Machine Check occurs // [6] Kernel panic [1] Triggered by accessing a hardware-poisoned THP in userspace, which is typically recoverable by terminating the affected process. [2] Call folio_set_has_hwpoisoned() before try_to_split_thp_page(). [3] Pass the RMP_USE_SHARED_ZEROPAGE remap flag to remap_page(). [4] Try to map the unused THP to zeropage. [5] Re-access pages in the hw-poisoned THP in the kernel. [6] Triggered in-kernel, leading to a panic kernel. In Step[2], memory_failure() sets the poisoned flag on the page in the THP by TestSetPageHWPoison() before calling try_to_split_thp_page(). As suggested by David Hildenbrand, fix this panic by not accessing to the poisoned page in the THP during zeropage identification, while continuing to scan unaffected pages in the THP for possible zeropage mapping. This prevents a second in-kernel #MC that would cause kernel panic in Step[4]. Thanks to Andrew Zaborowski for his initial work on fixing this issue.

How to fix

Remediation Available
linuxDebian
Fixed in:6.12.57-1CVE-2025-40230
Fixed in:6.17.6-1CVE-2025-40230
linuxUbuntu
Fixed in:6.17.0-14.14USN-8029-1
linux-awsUbuntu
Fixed in:6.17.0-1007.7USN-8029-2
linux-azureUbuntu
Fixed in:6.17.0-1008.8USN-8029-3
linux-gcpUbuntu
Fixed in:6.17.0-1007.7USN-8030-1
linux-image-6.17.0-1006-realtimeUbuntu
Fixed in:6.17.0-1006.7USN-8029-1
linux-image-6.17.0-1007-awsUbuntu
Fixed in:6.17.0-1007.7USN-8029-2
linux-image-6.17.0-1007-aws-64kUbuntu
Fixed in:6.17.0-1007.7USN-8029-2
linux-image-6.17.0-1007-gcpUbuntu
Fixed in:6.17.0-1007.7USN-8030-1
linux-image-6.17.0-1007-gcp-64kUbuntu
Fixed in:6.17.0-1007.7USN-8030-1
linux-image-6.17.0-1007-oracleUbuntu
Fixed in:6.17.0-1007.7USN-8029-2
linux-image-6.17.0-1007-oracle-64kUbuntu
Fixed in:6.17.0-1007.7USN-8029-2
linux-image-6.17.0-1008-azureUbuntu
Fixed in:6.17.0-1008.8USN-8029-3
linux-image-6.17.0-1008-raspiUbuntu
Fixed in:6.17.0-1008.8USN-8029-1
linux-image-6.17.0-1011-oemUbuntu
Fixed in:6.17.0-1011.11USN-8048-1
linux-image-6.17.0-14-genericUbuntu
Fixed in:6.17.0-14.14USN-8029-1
linux-image-6.17.0-14-generic-64kUbuntu
Fixed in:6.17.0-14.14USN-8029-1
linux-image-awsUbuntu
Fixed in:6.17.0-1007.7USN-8029-2
linux-image-aws-6.17Ubuntu
Fixed in:6.17.0-1007.7USN-8029-2
linux-image-aws-64kUbuntu
Fixed in:6.17.0-1007.7USN-8029-2
linux-image-aws-64k-6.17Ubuntu
Fixed in:6.17.0-1007.7USN-8029-2
linux-image-azureUbuntu
Fixed in:6.17.0-1008.8USN-8029-3
linux-image-azure-6.17Ubuntu
Fixed in:6.17.0-1008.8USN-8029-3
linux-image-gcpUbuntu
Fixed in:6.17.0-1007.7USN-8030-1
linux-image-gcp-6.17Ubuntu
Fixed in:6.17.0-1007.7USN-8030-1
linux-image-gcp-64kUbuntu
Fixed in:6.17.0-1007.7USN-8030-1
linux-image-gcp-64k-6.17Ubuntu
Fixed in:6.17.0-1007.7USN-8030-1
linux-image-genericUbuntu
Fixed in:6.17.0-14.14USN-8029-1
linux-image-generic-6.17Ubuntu
Fixed in:6.17.0-14.14USN-8029-1
linux-image-generic-64kUbuntu
Fixed in:6.17.0-14.14USN-8029-1
linux-image-generic-64k-6.17Ubuntu
Fixed in:6.17.0-14.14USN-8029-1
linux-image-oem-6.17Ubuntu
Fixed in:6.17.0-1011.11USN-8048-1
linux-image-oracleUbuntu
Fixed in:6.17.0-1007.7USN-8029-2
linux-image-oracle-6.17Ubuntu
Fixed in:6.17.0-1007.7USN-8029-2
linux-image-oracle-64kUbuntu
Fixed in:6.17.0-1007.7USN-8029-2
linux-image-oracle-64k-6.17Ubuntu
Fixed in:6.17.0-1007.7USN-8029-2
linux-image-raspiUbuntu
Fixed in:6.17.0-1008.8USN-8029-1
linux-image-raspi-6.17Ubuntu
Fixed in:6.17.0-1008.8USN-8029-1
linux-image-realtimeUbuntu
Fixed in:6.17.0-1006.7USN-8029-1
linux-image-realtime-6.17Ubuntu
Fixed in:6.17.0-1006.7USN-8029-1
linux-image-virtualUbuntu
Fixed in:6.17.0-14.14USN-8029-1
linux-image-virtual-6.17Ubuntu
Fixed in:6.17.0-14.14USN-8029-1
linux-oem-6.17Ubuntu
Fixed in:6.17.0-1011.11USN-8048-1
linux-oracleUbuntu
Fixed in:6.17.0-1007.7USN-8029-2
linux-raspiUbuntu
Fixed in:6.17.0-1008.8USN-8029-1
linux-realtimeUbuntu
Fixed in:6.17.0-1006.7USN-8029-1

Remediation is compiled from vendor and distribution security advisories. Always confirm against the linked source for your exact version and platform.

CVSS v3.1 Vector

No CVSS vector data available.

Exploit Intelligence

0.19%probability of exploitation in 30 days
8thpercentile

Low risk: more likely to be exploited than 8% of all known CVEs.

References

Embed a live status badge for CVE-2025-40230
CVE-2025-40230 severity badge

Markdown

[![CVE-2025-40230](https://tridentstack.com/cve/badge/CVE-2025-40230.svg)](https://tridentstack.com/cve/CVE-2025-40230)

HTML

<a href="https://tridentstack.com/cve/CVE-2025-40230"><img src="https://tridentstack.com/cve/badge/CVE-2025-40230.svg" alt="CVE-2025-40230"></a>

Find and fix vulnerabilities across your fleet

TridentStack Control continuously scans your Windows, macOS, and Linux fleet for known vulnerabilities, prioritizes them by severity and active exploitation, and patches them automatically.

Start free

This product uses NVD data but is not endorsed or certified by the NVD. EPSS scores courtesy of FIRST.org (https://www.first.org/epss). Source: CISA KEV Catalog. Data as of 2025-12-04.