CVE-2025-21939
Severity CVSS v4.0:
Pending analysis
Type:
CWE-476
NULL Pointer Dereference
Publication date:
01/04/2025
Last modified:
30/10/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
drm/xe/hmm: Don&#39;t dereference struct page pointers without notifier lock<br />
<br />
The pnfs that we obtain from hmm_range_fault() point to pages that<br />
we don&#39;t have a reference on, and the guarantee that they are still<br />
in the cpu page-tables is that the notifier lock must be held and the<br />
notifier seqno is still valid.<br />
<br />
So while building the sg table and marking the pages accesses / dirty<br />
we need to hold this lock with a validated seqno.<br />
<br />
However, the lock is reclaim tainted which makes<br />
sg_alloc_table_from_pages_segment() unusable, since it internally<br />
allocates memory.<br />
<br />
Instead build the sg-table manually. For the non-iommu case<br />
this might lead to fewer coalesces, but if that&#39;s a problem it can<br />
be fixed up later in the resource cursor code. For the iommu case,<br />
the whole sg-table may still be coalesced to a single contigous<br />
device va region.<br />
<br />
This avoids marking pages that we don&#39;t own dirty and accessed, and<br />
it also avoid dereferencing struct pages that we don&#39;t own.<br />
<br />
v2:<br />
- Use assert to check whether hmm pfns are valid (Matthew Auld)<br />
- Take into account that large pages may cross range boundaries<br />
(Matthew Auld)<br />
<br />
v3:<br />
- Don&#39;t unnecessarily check for a non-freed sg-table. (Matthew Auld)<br />
- Add a missing up_read() in an error path. (Matthew Auld)<br />
<br />
(cherry picked from commit ea3e66d280ce2576664a862693d1da8fd324c317)
Impact
Base Score 3.x
5.50
Severity 3.x
MEDIUM
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.10 (including) | 6.12.19 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.13 (including) | 6.13.7 (excluding) |
| cpe:2.3:o:linux:linux_kernel:6.14:rc1:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.14:rc2:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.14:rc3:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.14:rc4:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.14:rc5:*:*:*:*:*:* |
To consult the complete list of CPE names with products and versions, see this page



