lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <2025062834-CVE-2025-38084-9121@gregkh>
Date: Sat, 28 Jun 2025 09:44:35 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-cve-announce@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...nel.org>
Subject: CVE-2025-38084: mm/hugetlb: unshare page tables during VMA split, not before

From: Greg Kroah-Hartman <gregkh@...nel.org>

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@...gle.com: v2]

The Linux kernel CVE team has assigned CVE-2025-38084 to this issue.


Affected and fixed versions
===========================

	Issue introduced in 2.6.20 with commit 39dde65c9940c97fcd178a3d2b1c57ed8b7b68aa and fixed in 5.10.239 with commit e8847d18cd9fff1edbb45e963d9141273c3b539c
	Issue introduced in 2.6.20 with commit 39dde65c9940c97fcd178a3d2b1c57ed8b7b68aa and fixed in 5.15.186 with commit 366298f2b04d2bf1f2f2b7078405bdf9df9bd5d0
	Issue introduced in 2.6.20 with commit 39dde65c9940c97fcd178a3d2b1c57ed8b7b68aa and fixed in 6.1.142 with commit 2511ac64bc1617ca716d3ba8464e481a647c1902
	Issue introduced in 2.6.20 with commit 39dde65c9940c97fcd178a3d2b1c57ed8b7b68aa and fixed in 6.6.95 with commit af6cfcd0efb7f051af221c418ec8b37a10211947
	Issue introduced in 2.6.20 with commit 39dde65c9940c97fcd178a3d2b1c57ed8b7b68aa and fixed in 6.12.35 with commit 9cf5b2a3b72c23fb7b84736d5d19ee6ea718762b
	Issue introduced in 2.6.20 with commit 39dde65c9940c97fcd178a3d2b1c57ed8b7b68aa and fixed in 6.15.4 with commit 8a21d5584826f4880f45bbf8f72375f4e6c0ff2a
	Issue introduced in 2.6.20 with commit 39dde65c9940c97fcd178a3d2b1c57ed8b7b68aa and fixed in 6.16-rc1 with commit 081056dc00a27bccb55ccc3c6f230a3d5fd3f7e0

Please see https://www.kernel.org for a full list of currently supported
kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to
older supported kernel versions.  The official CVE entry at
	https://cve.org/CVERecord/?id=CVE-2025-38084
will be updated if fixes are backported, please check that for the most
up to date information about this issue.


Affected files
==============

The file(s) affected by this issue are:
	include/linux/hugetlb.h
	mm/hugetlb.c
	mm/vma.c
	tools/testing/vma/vma_internal.h


Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest
stable kernel version for this, and many other bugfixes.  Individual
changes are never tested alone, but rather are part of a larger kernel
release.  Cherry-picking individual commits is not recommended or
supported by the Linux kernel community at all.  If however, updating to
the latest release is impossible, the individual changes to resolve this
issue can be found at these commits:
	https://git.kernel.org/stable/c/e8847d18cd9fff1edbb45e963d9141273c3b539c
	https://git.kernel.org/stable/c/366298f2b04d2bf1f2f2b7078405bdf9df9bd5d0
	https://git.kernel.org/stable/c/2511ac64bc1617ca716d3ba8464e481a647c1902
	https://git.kernel.org/stable/c/af6cfcd0efb7f051af221c418ec8b37a10211947
	https://git.kernel.org/stable/c/9cf5b2a3b72c23fb7b84736d5d19ee6ea718762b
	https://git.kernel.org/stable/c/8a21d5584826f4880f45bbf8f72375f4e6c0ff2a
	https://git.kernel.org/stable/c/081056dc00a27bccb55ccc3c6f230a3d5fd3f7e0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ