CVE-2025-37958: mm/huge_memory: fix dereferencing invalid pmd migration entry

Published May 20, 2025
·
Updated

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

mm/hugememory: fix dereferencing invalid pmd migration entry

When migrating a THP, concurrent access to the PMD migration entry during a deferred split scan can lead to an invalid address access, as illustrated below. To prevent this invalid access, it is necessary to check the PMD migration entry and return early. In this context, there is no need to use pmdtoswpentry and pfnswapentrytopage to verify the equality of the target folio. Since the PMD migration entry is locked, it cannot be served as the target.

Mailing list discussion and explanation from Hugh Dickins: "An anonvma lookup points to a location which may contain the folio of interest, but might instead contain another folio: and weeding out those other folios is precisely what the "folio != pmdfolio((pmd)" check (and the "risk of replacing the wrong folio" comment a few lines above it) is for."

BUG: unable to handle page fault for address: ffffea60001db008 CPU: 0 UID: 0 PID: 2199114 Comm: tee Not tainted 6.14.0+ #4 NONE Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 RIP: 0010:splithugepmdlocked+0x3b5/0x2b60 Call Trace: <TASK> trytomigrateone+0x28c/0x3730 rmapwalkanon+0x4f6/0x770 unmapfolio+0x196/0x1f0 splithugepagetolisttoorder+0x9f6/0x1560 deferredsplitscan+0xac5/0x12a0 shrinkerdebugfsscanwrite+0x376/0x470 fullproxywrite+0x15c/0x220 vfswrite+0x2fc/0xcb0 ksyswrite+0x146/0x250 dosyscall64+0x6a/0x120 entrySYSCALL64afterhwframe+0x76/0x7e

The bug is found by syzkaller on an internal kernel, then confirmed on upstream.

Affected Software

17 affected componentsFixes available
Linux Kernel
Linux Linux kernel>=4.14<5.4.295
Linux Linux kernel>=5.5<5.10.239
Linux Linux kernel>=5.11<5.15.186
Linux Linux kernel>=5.16<6.1.142
Linux Linux kernel>=6.2<6.6.95
Linux Linux kernel>=6.7<6.12.29
Linux Linux kernel>=6.13<6.14.7
Linux Linux kernel=6.15-rc1
Linux Linux kernel=6.15-rc2
Linux Linux kernel=6.15-rc3
Linux Linux kernel=6.15-rc4
Linux Linux kernel=6.15-rc5
Debian Debian Linux=11.0
Microsoft azl3 kernel 6.6.96.1-1
Microsoft azl3 kernel 6.6.92.2-2
debian/linux
6.1.176-16.1.190-16.12.107-16.12.113-17.2.12-17.2.13-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.1.176-1Fixed in 6.1.190-1Fixed in 6.12.107-1Fixed in 6.12.113-1Fixed in 7.2.12-1Fixed in 7.2.13-1

Event History

May 20, 2025
CVE Published
via MITRE·04:01 PM
Data Sourced
via MITRE·04:01 PM
Description
Data Sourced
via NVD·04:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Data Sourced
via Red Hat·05:01 PM
DescriptionSeverityAffected Software
Aug 6, 2025
Data Sourced
via Microsoft·07:00 AM
DescriptionSeverityWeaknessAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What is the severity of CVE-2025-37958?

CVE-2025-37958 has been classified with a high severity due to its potential for causing invalid memory access.

2

How do I fix CVE-2025-37958?

You can fix CVE-2025-37958 by upgrading to a patched version of the Linux kernel that addresses this vulnerability.

3

What causes the CVE-2025-37958 vulnerability?

CVE-2025-37958 is caused by concurrent access to the PMD migration entry during a deferred split scan when migrating a Transparent Huge Page (THP).

4

Which versions of the Linux kernel are affected by CVE-2025-37958?

CVE-2025-37958 affects Linux kernel versions starting from 6.14.0.

5

Is CVE-2025-37958 specific to certain Linux distributions?

CVE-2025-37958 impacts any Linux distribution using the affected versions of the Linux kernel.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203