Vulnerability · Published Apr 1, 2025 · Assigned by Linux

CVE-2025-21939drm/xe/hmm: Don't dereference struct page pointers without notifier lock

High 7.8

In plain English

A high-severity security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 12% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)7.8High
Exploit odds (30 days)0.2%top 87.9% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

In the Linux kernel, the following vulnerability has been resolved: drm/xe/hmm: Don't dereference struct page pointers without notifier lock The pnfs that we obtain from hmm_range_fault() point to pages that we don't have a reference on, and the guarantee that they are still in the cpu page-tables is that the notifier lock must be held and the notifier seqno is still valid. So while building the sg table and marking the pages accesses / dirty we need to hold this lock with a validated seqno. However, the lock is reclaim tainted which makes sg_alloc_table_from_pages_segment() unusable, since it internally allocates memory. Instead build the sg-table manually. For the non-iommu case this might lead to fewer coalesces, but if that's a problem it can be fixed up later in the resource cursor code. For the iommu case, the whole sg-table may still be coalesced to a single contigous device va region. This avoids marking pages that we don't own dirty and accessed, and it also avoid dereferencing struct pages that we don't own. v2: - Use assert to check whether hmm pfns are valid (Matthew Auld) - Take into account that large pages may cross range boundaries (Matthew Auld) v3: - Don't unnecessarily check for a non-freed sg-table. (Matthew Auld) - Add a missing up_read() in an error path. (Matthew Auld) (cherry picked from commit ea3e66d280ce2576664a862693d1da8fd324c317)

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:13linux6.12.19-1DEBIAN-CVE-2025-21939
Debian:14linux6.12.19-1DEBIAN-CVE-2025-21939
Ubuntu:22.04:LTSlinux-allwinner-5.19no fix listedUBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-aws-5.19no fix listedUBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-aws-6.2no fix listedUBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-aws-6.5no fix listedUBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-azure-5.19no fix listedUBUNTU-CVE-2025-21939
Ubuntu:24.04:LTSlinux-azure-6.116.11.0-1018.18~24.04.1USN-7628-1
Ubuntu:24.04:LTSlinux-azure-6.116.11.0-1018.18~24.04.1UBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-azure-6.2no fix listedUBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-azure-6.5no fix listedUBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-azure-fde-5.19no fix listedUBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-azure-fde-6.2no fix listedUBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-gcp-5.19no fix listedUBUNTU-CVE-2025-21939
Ubuntu:24.04:LTSlinux-gcp-6.116.11.0-1016.16~24.04.1USN-7605-1
Ubuntu:24.04:LTSlinux-gcp-6.116.11.0-1016.16~24.04.1UBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-gcp-6.2no fix listedUBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-gcp-6.5no fix listedUBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-hwe-5.19no fix listedUBUNTU-CVE-2025-21939
Ubuntu:24.04:LTSlinux-hwe-6.116.11.0-28.28~24.04.1UBUNTU-CVE-2025-21939
Ubuntu:24.04:LTSlinux-hwe-6.116.11.0-28.28~24.04.1USN-7605-1
Ubuntu:22.04:LTSlinux-hwe-6.2no fix listedUBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-hwe-6.5no fix listedUBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-intel-iot-realtimeno fix listedUBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-lowlatency-hwe-5.19no fix listedUBUNTU-CVE-2025-21939
Ubuntu:24.04:LTSlinux-lowlatency-hwe-6.116.11.0-1015.16~24.04.2USN-7605-2
Ubuntu:24.04:LTSlinux-lowlatency-hwe-6.116.11.0-1015.16~24.04.2UBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.2no fix listedUBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.5no fix listedUBUNTU-CVE-2025-21939
Ubuntu:24.04:LTSlinux-nvidia-6.116.11.0-1012.12UBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-nvidia-6.2no fix listedUBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-nvidia-6.5no fix listedUBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-oem-5.17no fix listedUBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-oem-6.0no fix listedUBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-oem-6.1no fix listedUBUNTU-CVE-2025-21939
Ubuntu:24.04:LTSlinux-oem-6.116.11.0-1024.24UBUNTU-CVE-2025-21939
Ubuntu:24.04:LTSlinux-oem-6.116.11.0-1024.24USN-7606-1
Ubuntu:22.04:LTSlinux-oem-6.5no fix listedUBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-oracle-6.5no fix listedUBUNTU-CVE-2025-21939
Ubuntu:24.04:LTSlinux-raspi-realtimeno fix listedUBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2025-21939
Ubuntu:24.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-riscvno fix listedUBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-riscv-5.19no fix listedUBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-riscv-6.5no fix listedUBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-starfive-5.19no fix listedUBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-starfive-6.2no fix listedUBUNTU-CVE-2025-21939
Ubuntu:22.04:LTSlinux-starfive-6.5no fix listedUBUNTU-CVE-2025-21939

Affected products (as reported)

VendorProductVersions
Linux Linux 81e058a3e7fd8593d076b4f26f7b8bb49f1d61e3 – before 2a24c98f0e4cc994334598d4f3a851972064809d81e058a3e7fd8593d076b4f26f7b8bb49f1d61e3 – before f9326f529da7298a95643c3267f1c0fdb0db55eb81e058a3e7fd8593d076b4f26f7b8bb49f1d61e3 – before 0a98219bcc961edd3388960576e4353e123b4a51
Linux Linux 6.10

References