Skip to content

CVE-2025-38084 mm/hugetlb: unshare page tables during VMA split, not before

MediumCVSS 5.5 EPSS 0.23%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
No known exploitation · automatable: no · technical impact: total
Technology
Linux KernelUbuntuDebian

Description

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

mm/hugetlb: unshare page tables during VMA split, not before

Currently, __split_vma() triggers hugetlb page table unsharing through
vm_ops->may_split(). This happens before the VMA lock and rmap locks are
taken - which is too early, it allows racing VMA-locked page faults in our
process and racing rmap walks from other processes to cause page tables to
be shared again before we actually perform the split.

Fix it by explicitly calling into the hugetlb unshare logic from
__split_vma() in the same place where THP splitting also happens. At that
point, both the VMA and the rmap(s) are write-locked.

An annoying detail is that we can now call into the helper
hugetlb_unshare_pmds() from two different locking contexts:

  1. from hugetlb_split(), holding:
    • mmap lock (exclusively)
    • VMA lock
    • file rmap lock (exclusively)
  2. hugetlb_unshare_all_pmds(), which I think is designed to be able to
    call us with only the mmap lock held (in shared mode), but currently
    only runs while holding mmap lock (exclusively) and VMA lock

Backporting note:
This commit fixes a racy protection that was introduced in commit
b30c14cd6102 ("hugetlb: unshare some PMDs when splitting VMAs"); that
commit claimed to fix an issue introduced in 5.13, but it should actually
also go all the way back.

[jannh@google.com: v2]

Upgrade path

11 packages: 10 fixed.

PackageAffectedFixed inStatus
azure linux kernel(Azure Linux 3.0) < 6.6.96.1-1 6.6.96.1-1 Fixed
debian/linux(Debian 12) < 6.1.147-1; = 6.1.27-1; = 6.1.37-1; = 6.1.38-1 +38 more 6.1.147-1 Fixed
debian/linux(Debian 13) < 6.12.35-1 6.12.35-1 Fixed
debian/linux(Debian 14) < 6.12.35-1 6.12.35-1 Fixed
Linux kernel < 5.10.239; < 5.15.186; < 6.1.142; < 6.6.95 +17 more 5.10.239, 5.15.186, 6.1.142, 6.6.95, 6.12.35, 6.15.4, 6.16, 8a21d5584826f4880f45bbf8f72375f4e6c0ff2a, 9cf5b2a3b72c23fb7b84736d5d19ee6ea718762b, 2511ac64bc1617ca716d3ba8464e481a647c1902, 081056dc00a27bccb55ccc3c6f230a3d5fd3f7e0, 366298f2b04d2bf1f2f2b7078405bdf9df9bd5d0, af6cfcd0efb7f051af221c418ec8b37a10211947, e8847d18cd9fff1edbb45e963d9141273c3b539c Fixed
ubuntu/linux(Ubuntu 22.04) < 5.15.0-156.166 5.15.0-156.166 Fixed
ubuntu/linux(Ubuntu 24.04) < 6.8.0-100.100 6.8.0-100.100 Fixed
ubuntu/linux-kvm(Ubuntu 22.04) < 5.15.0-1088.93 5.15.0-1088.93 Fixed
ubuntu/linux-raspi(Ubuntu 22.04) < 5.15.0-1086.89 5.15.0-1086.89 Fixed
ubuntu/linux-raspi(Ubuntu 24.04) < 6.8.0-1047.51 6.8.0-1047.51 Fixed
debian linux = 11.0 No fix listed Versions listed

Affected products

ProductAffected versionsFixed in
azure linux kernel(Azure Linux:3.0) < 6.6.96.1-1 6.6.96.1-1
debian/linux(Debian:12) < 6.1.147-1 6.1.147-1
debian/linux(Debian:12) = 6.1.106-1 No fix listed
debian/linux(Debian:12) = 6.1.106-2 No fix listed
debian/linux(Debian:12) = 6.1.106-3 No fix listed
debian/linux(Debian:12) = 6.1.112-1 No fix listed
debian/linux(Debian:12) = 6.1.115-1 No fix listed
debian/linux(Debian:12) = 6.1.119-1 No fix listed
debian/linux(Debian:12) = 6.1.123-1 No fix listed
debian/linux(Debian:12) = 6.1.124-1 No fix listed
debian/linux(Debian:12) = 6.1.128-1 No fix listed
debian/linux(Debian:12) = 6.1.129-1 No fix listed
debian/linux(Debian:12) = 6.1.133-1 No fix listed
debian/linux(Debian:12) = 6.1.135-1 No fix listed
debian/linux(Debian:12) = 6.1.137-1 No fix listed
debian/linux(Debian:12) = 6.1.139-1 No fix listed
debian/linux(Debian:12) = 6.1.140-1 No fix listed
debian/linux(Debian:12) = 6.1.27-1 No fix listed
debian/linux(Debian:12) = 6.1.37-1 No fix listed
debian/linux(Debian:12) = 6.1.38-1 No fix listed
debian/linux(Debian:12) = 6.1.38-2 No fix listed
debian/linux(Debian:12) = 6.1.38-2~bpo11+1 No fix listed
debian/linux(Debian:12) = 6.1.38-3 No fix listed
debian/linux(Debian:12) = 6.1.38-4 No fix listed
debian/linux(Debian:12) = 6.1.38-4~bpo11+1 No fix listed
Show 47 more
ProductAffected versionsFixed in
debian/linux(Debian:12) = 6.1.52-1 No fix listed
debian/linux(Debian:12) = 6.1.55-1 No fix listed
debian/linux(Debian:12) = 6.1.55-1~bpo11+1 No fix listed
debian/linux(Debian:12) = 6.1.64-1 No fix listed
debian/linux(Debian:12) = 6.1.66-1 No fix listed
debian/linux(Debian:12) = 6.1.67-1 No fix listed
debian/linux(Debian:12) = 6.1.69-1 No fix listed
debian/linux(Debian:12) = 6.1.69-1~bpo11+1 No fix listed
debian/linux(Debian:12) = 6.1.76-1 No fix listed
debian/linux(Debian:12) = 6.1.76-1~bpo11+1 No fix listed
debian/linux(Debian:12) = 6.1.82-1 No fix listed
debian/linux(Debian:12) = 6.1.85-1 No fix listed
debian/linux(Debian:12) = 6.1.90-1 No fix listed
debian/linux(Debian:12) = 6.1.90-1~bpo11+1 No fix listed
debian/linux(Debian:12) = 6.1.94-1 No fix listed
debian/linux(Debian:12) = 6.1.94-1~bpo11+1 No fix listed
debian/linux(Debian:12) = 6.1.98-1 No fix listed
debian/linux(Debian:12) = 6.1.99-1 No fix listed
debian/linux(Debian:13) < 6.12.35-1 6.12.35-1
debian/linux(Debian:14) < 6.12.35-1 6.12.35-1
Linux kernel >= 39dde65c9940c97fcd178a3d2b1c57ed8b7b68aa, < e8847d18cd9fff1edbb45e963d9141273c3b539c e8847d18cd9fff1edbb45e963d9141273c3b539c
Linux kernel >= 39dde65c9940c97fcd178a3d2b1c57ed8b7b68aa, < 366298f2b04d2bf1f2f2b7078405bdf9df9bd5d0 366298f2b04d2bf1f2f2b7078405bdf9df9bd5d0
Linux kernel >= 39dde65c9940c97fcd178a3d2b1c57ed8b7b68aa, < 2511ac64bc1617ca716d3ba8464e481a647c1902 2511ac64bc1617ca716d3ba8464e481a647c1902
Linux kernel >= 39dde65c9940c97fcd178a3d2b1c57ed8b7b68aa, < af6cfcd0efb7f051af221c418ec8b37a10211947 af6cfcd0efb7f051af221c418ec8b37a10211947
Linux kernel >= 39dde65c9940c97fcd178a3d2b1c57ed8b7b68aa, < 9cf5b2a3b72c23fb7b84736d5d19ee6ea718762b 9cf5b2a3b72c23fb7b84736d5d19ee6ea718762b
Linux kernel >= 39dde65c9940c97fcd178a3d2b1c57ed8b7b68aa, < 8a21d5584826f4880f45bbf8f72375f4e6c0ff2a 8a21d5584826f4880f45bbf8f72375f4e6c0ff2a
Linux kernel >= 39dde65c9940c97fcd178a3d2b1c57ed8b7b68aa, < 081056dc00a27bccb55ccc3c6f230a3d5fd3f7e0 081056dc00a27bccb55ccc3c6f230a3d5fd3f7e0
Linux kernel = 2.6.20 No fix listed
Linux kernel < 5.10.239 5.10.239
Linux kernel < 5.15.186 5.15.186
Linux kernel < 6.1.142 6.1.142
Linux kernel < 6.6.95 6.6.95
Linux kernel < 6.12.35 6.12.35
Linux kernel < 6.15.4 6.15.4
Linux kernel < 6.16 6.16
ubuntu/linux(Ubuntu:22.04) < 5.15.0-156.166 5.15.0-156.166
ubuntu/linux-kvm(Ubuntu:22.04) < 5.15.0-1088.93 5.15.0-1088.93
ubuntu/linux-raspi(Ubuntu:22.04) < 5.15.0-1086.89 5.15.0-1086.89
ubuntu/linux(Ubuntu:24.04) < 6.8.0-100.100 6.8.0-100.100
ubuntu/linux-raspi(Ubuntu:24.04) < 6.8.0-1047.51 6.8.0-1047.51
Linux kernel >= 2.6.20, < 5.10.239 5.10.239
Linux kernel >= 5.11, < 5.15.186 5.15.186
Linux kernel >= 5.16, < 6.1.142 6.1.142
Linux kernel >= 6.2, < 6.6.95 6.6.95
Linux kernel >= 6.7, < 6.12.35 6.12.35
Linux kernel >= 6.13, < 6.15.4 6.15.4
debian linux = 11.0 No fix listed

References