CVE-2022-48797

In the Linux kernel, the following vulnerability has been resolved: mm: don't try to NUMA-migrate COW pages that have other uses Oded Gabbay reports that enabling NUMA balancing causes corruption with his Gaudi accelerator test load: "All the details are in the bug, but the bottom line is that somehow, this patch causes corruption when the numa balancing feature is enabled AND we don't use process affinity AND we use GUP to pin pages so our accelerator can DMA to/from system memory. Either disabling numa balancing, using process affinity to bind to specific numa-node or reverting this patch causes the bug to disappear" and Oded bisected the issue to commit 09854ba94c6a ("mm: do_wp_page() simplification"). Now, the NUMA balancing shouldn't actually be changing the writability of a page, and as such shouldn't matter for COW. But it appears it does. Suspicious. However, regardless of that, the condition for enabling NUMA faults in change_pte_range() is nonsensical. It uses "page_mapcount(page)" to decide if a COW page should be NUMA-protected or not, and that makes absolutely no sense. The number of mappings a page has is irrelevant: not only does GUP get a reference to a page as in Oded's case, but the other mappings migth be paged out and the only reference to them would be in the page count. Since we should never try to NUMA-balance a page that we can't move anyway due to other references, just fix the code to use 'page_count()'. Oded confirms that that fixes his issue. Now, this does imply that something in NUMA balancing ends up changing page protections (other than the obvious one of making the page inaccessible to get the NUMA faulting information). Otherwise the COW simplification wouldn't matter - since doing the GUP on the page would make sure it's writable. The cause of that permission change would be good to figure out too, since it clearly results in spurious COW events - but fixing the nonsensical test that just happened to work before is obviously the CorrectThing(tm) to do regardless.
Configurations

Configuration 1 (hide)

OR cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
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:*:*:*:*:*:*

History

03 Oct 2025, 14:06

Type Values Removed Values Added
First Time Linux linux Kernel
Linux
CWE NVD-CWE-noinfo
CPE cpe:2.3:o:linux:linux_kernel:5.17:rc3:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:5.17:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:5.9:rc4:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:5.9:-:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:5.9:rc8:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:5.9:rc7:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:5.9:rc6:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:5.9:rc5:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:5.17:rc4:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:5.17:rc2:*:*:*:*:*:*
CVSS v2 : unknown
v3 : unknown
v2 : unknown
v3 : 5.5
References () https://git.kernel.org/stable/c/254090925e16abd914c87b4ad1b489440d89c4c3 - () https://git.kernel.org/stable/c/254090925e16abd914c87b4ad1b489440d89c4c3 - Patch
References () https://git.kernel.org/stable/c/80d47f5de5e311cbc0d01ebb6ee684e8f4c196c6 - () https://git.kernel.org/stable/c/80d47f5de5e311cbc0d01ebb6ee684e8f4c196c6 - Patch
References () https://git.kernel.org/stable/c/b3dc4b9d3ca68b370c4aeab5355007eedf948849 - () https://git.kernel.org/stable/c/b3dc4b9d3ca68b370c4aeab5355007eedf948849 - Patch
References () https://git.kernel.org/stable/c/d187eeb02d18446e5e54ed6bcbf8b47e6551daea - () https://git.kernel.org/stable/c/d187eeb02d18446e5e54ed6bcbf8b47e6551daea - Patch

21 Nov 2024, 07:34

Type Values Removed Values Added
References () https://git.kernel.org/stable/c/254090925e16abd914c87b4ad1b489440d89c4c3 - () https://git.kernel.org/stable/c/254090925e16abd914c87b4ad1b489440d89c4c3 -
References () https://git.kernel.org/stable/c/80d47f5de5e311cbc0d01ebb6ee684e8f4c196c6 - () https://git.kernel.org/stable/c/80d47f5de5e311cbc0d01ebb6ee684e8f4c196c6 -
References () https://git.kernel.org/stable/c/b3dc4b9d3ca68b370c4aeab5355007eedf948849 - () https://git.kernel.org/stable/c/b3dc4b9d3ca68b370c4aeab5355007eedf948849 -
References () https://git.kernel.org/stable/c/d187eeb02d18446e5e54ed6bcbf8b47e6551daea - () https://git.kernel.org/stable/c/d187eeb02d18446e5e54ed6bcbf8b47e6551daea -
Summary
  • (es) En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: mm: no intente migrar páginas COW con NUMA que tengan otros usos Oded Gabbay informa que habilitar el equilibrio de NUMA causa corrupción en la carga de prueba del acelerador Gaudí: "Todos los detalles están en el error, pero la conclusión es que de alguna manera, este parche causa corrupción cuando la función de equilibrio numa está habilitada Y no usamos la afinidad de procesos Y usamos GUP para anclar páginas para que nuestro acelerador pueda DMA hacia/desde la memoria del sistema, ya sea deshabilitando. El equilibrio de numa, el uso de la afinidad del proceso para vincularse a un nodo numa específico o revertir este parche hace que el error desaparezca" y Oded dividió el problema en dos para el commit 09854ba94c6a ("mm: simplificación de do_wp_page()"). Ahora bien, el equilibrio NUMA en realidad no debería cambiar la capacidad de escritura de una página y, como tal, no debería importarle a COW. Pero parece que sí. Sospechoso. Sin embargo, independientemente de eso, la condición para habilitar fallas NUMA en change_pte_range() no tiene sentido. Utiliza "page_mapcount(page)" para decidir si una página COW debe estar protegida por NUMA o no, y eso no tiene ningún sentido. El número de asignaciones que tiene una página es irrelevante: GUP no solo obtiene una referencia a una página como en el caso de Oded, sino que las otras asignaciones podrían eliminarse y la única referencia a ellas estaría en el recuento de páginas. Dado que nunca debemos intentar equilibrar NUMA una página que no podemos mover de todos modos debido a otras referencias, simplemente corrija el código para usar 'page_count()'. Oded confirma que eso soluciona su problema. Ahora bien, esto implica que algo en el equilibrio de NUMA termina cambiando las protecciones de la página (aparte de la obvia de hacer que la página sea inaccesible para obtener la información de fallas de NUMA). De lo contrario, la simplificación de COW no importaría, ya que hacer el GUP en la página garantizaría que se pueda escribir. También sería bueno descubrir la causa de ese cambio de permiso, ya que claramente da como resultado eventos COW falsos, pero arreglar la prueba sin sentido que funcionó antes es obviamente lo CorrectThing(tm) que se debe hacer de todos modos.

16 Jul 2024, 12:15

Type Values Removed Values Added
New CVE

Information

Published : 2024-07-16 12:15

Updated : 2025-10-03 14:06


NVD link : CVE-2022-48797

Mitre link : CVE-2022-48797

CVE.ORG link : CVE-2022-48797


JSON object : View

Products Affected

linux

  • linux_kernel