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

Published Apr 1, 2025
·
Updated

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 hmmrangefault() 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 sgalloctablefrompagessegment() 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 upread() in an error path. (Matthew Auld)

(cherry picked from commit ea3e66d280ce2576664a862693d1da8fd324c317)

Affected Software

8 affected components
Linux Kernel
Linux Linux kernel>=6.10<6.12.19
Linux Linux kernel>=6.13<6.13.7
Linux Linux kernel=6.14-rc1
Linux Linux kernel=6.14-rc2
Linux Linux kernel=6.14-rc3
Linux Linux kernel=6.14-rc4
Linux Linux kernel=6.14-rc5

Event History

Apr 1, 2025
CVE Published
via MITRE·03:41 PM
Data Sourced
via MITRE·03:41 PM
DescriptionSeverity
Data Sourced
via NVD·04:15 PM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2025-21939?

CVE-2025-21939 is classified as a medium-severity vulnerability in the Linux kernel.

2

How do I fix CVE-2025-21939?

To mitigate CVE-2025-21939, update the Linux kernel to the latest patched version provided by your distribution.

3

What impact does CVE-2025-21939 have on system security?

CVE-2025-21939 may lead to unauthorized access or potential system instability due to improper handling of page pointers.

4

Is CVE-2025-21939 exploitable remotely?

The exploitability of CVE-2025-21939 depends on system configuration, but it primarily affects local users.

5

When was CVE-2025-21939 disclosed?

CVE-2025-21939 was disclosed as part of ongoing security improvements in 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