CVE-2022-48797
Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
16/07/2024
Last modified:
03/10/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
mm: don&#39;t try to NUMA-migrate COW pages that have other uses<br />
<br />
Oded Gabbay reports that enabling NUMA balancing causes corruption with<br />
his Gaudi accelerator test load:<br />
<br />
"All the details are in the bug, but the bottom line is that somehow,<br />
this patch causes corruption when the numa balancing feature is<br />
enabled AND we don&#39;t use process affinity AND we use GUP to pin pages<br />
so our accelerator can DMA to/from system memory.<br />
<br />
Either disabling numa balancing, using process affinity to bind to<br />
specific numa-node or reverting this patch causes the bug to<br />
disappear"<br />
<br />
and Oded bisected the issue to commit 09854ba94c6a ("mm: do_wp_page()<br />
simplification").<br />
<br />
Now, the NUMA balancing shouldn&#39;t actually be changing the writability<br />
of a page, and as such shouldn&#39;t matter for COW. But it appears it<br />
does. Suspicious.<br />
<br />
However, regardless of that, the condition for enabling NUMA faults in<br />
change_pte_range() is nonsensical. It uses "page_mapcount(page)" to<br />
decide if a COW page should be NUMA-protected or not, and that makes<br />
absolutely no sense.<br />
<br />
The number of mappings a page has is irrelevant: not only does GUP get a<br />
reference to a page as in Oded&#39;s case, but the other mappings migth be<br />
paged out and the only reference to them would be in the page count.<br />
<br />
Since we should never try to NUMA-balance a page that we can&#39;t move<br />
anyway due to other references, just fix the code to use &#39;page_count()&#39;.<br />
Oded confirms that that fixes his issue.<br />
<br />
Now, this does imply that something in NUMA balancing ends up changing<br />
page protections (other than the obvious one of making the page<br />
inaccessible to get the NUMA faulting information). Otherwise the COW<br />
simplification wouldn&#39;t matter - since doing the GUP on the page would<br />
make sure it&#39;s writable.<br />
<br />
The cause of that permission change would be good to figure out too,<br />
since it clearly results in spurious COW events - but fixing the<br />
nonsensical test that just happened to work before is obviously the<br />
CorrectThing(tm) to do regardless.
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:*:*:*:*:*:*:*:* | 5.9.1 (including) | 5.10.102 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.11 (including) | 5.15.25 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.16 (including) | 5.16.11 (excluding) |
| cpe:2.3:o:linux:linux_kernel:5.9:-:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:5.9:rc4:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:5.9:rc5:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:5.9:rc6:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:5.9:rc7:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:5.9:rc8:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:5.17:rc1:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:5.17:rc2:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:5.17:rc3:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:5.17:rc4:*:*:*:*:*:* |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/254090925e16abd914c87b4ad1b489440d89c4c3
- https://git.kernel.org/stable/c/80d47f5de5e311cbc0d01ebb6ee684e8f4c196c6
- https://git.kernel.org/stable/c/b3dc4b9d3ca68b370c4aeab5355007eedf948849
- https://git.kernel.org/stable/c/d187eeb02d18446e5e54ed6bcbf8b47e6551daea
- https://git.kernel.org/stable/c/254090925e16abd914c87b4ad1b489440d89c4c3
- https://git.kernel.org/stable/c/80d47f5de5e311cbc0d01ebb6ee684e8f4c196c6
- https://git.kernel.org/stable/c/b3dc4b9d3ca68b370c4aeab5355007eedf948849
- https://git.kernel.org/stable/c/d187eeb02d18446e5e54ed6bcbf8b47e6551daea



