CVE-2024-56544

In the Linux kernel, the following vulnerability has been resolved: udmabuf: change folios array from kmalloc to kvmalloc When PAGE_SIZE 4096, MAX_PAGE_ORDER 10, 64bit machine, page_alloc only support 4MB. If above this, trigger this warn and return NULL. udmabuf can change size limit, if change it to 3072(3GB), and then alloc 3GB udmabuf, will fail create. [ 4080.876581] ------------[ cut here ]------------ [ 4080.876843] WARNING: CPU: 3 PID: 2015 at mm/page_alloc.c:4556 __alloc_pages+0x2c8/0x350 [ 4080.878839] RIP: 0010:__alloc_pages+0x2c8/0x350 [ 4080.879470] Call Trace: [ 4080.879473] <TASK> [ 4080.879473] ? __alloc_pages+0x2c8/0x350 [ 4080.879475] ? __warn.cold+0x8e/0xe8 [ 4080.880647] ? __alloc_pages+0x2c8/0x350 [ 4080.880909] ? report_bug+0xff/0x140 [ 4080.881175] ? handle_bug+0x3c/0x80 [ 4080.881556] ? exc_invalid_op+0x17/0x70 [ 4080.881559] ? asm_exc_invalid_op+0x1a/0x20 [ 4080.882077] ? udmabuf_create+0x131/0x400 Because MAX_PAGE_ORDER, kmalloc can max alloc 4096 * (1 << 10), 4MB memory, each array entry is pointer(8byte), so can save 524288 pages(2GB). Further more, costly order(order 3) may not be guaranteed that it can be applied for, due to fragmentation. This patch change udmabuf array use kvmalloc_array, this can fallback alloc into vmalloc, which can guarantee allocation for any size and does not affect the performance of kmalloc allocations.
Configurations

Configuration 1 (hide)

OR cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*

History

03 Feb 2025, 15:19

Type Values Removed Values Added
CPE cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
First Time Linux linux Kernel
Linux
Summary
  • (es) En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: udmabuf: cambia la matriz de folios de kmalloc a kvmalloc Cuando PAGE_SIZE es 4096, MAX_PAGE_ORDER es 10, en una máquina de 64 bits, page_alloc solo admite 4 MB. Si es mayor, se activa esta advertencia y se devuelve NULL. udmabuf puede cambiar el límite de tamaño. Si lo cambia a 3072 (3 GB) y luego asigna 3 GB, udmabuf no podrá crearlo. [ 4080.876581] ------------[ cortar aquí ]------------ [ 4080.876843] ADVERTENCIA: CPU: 3 PID: 2015 en mm/page_alloc.c:4556 __alloc_pages+0x2c8/0x350 [ 4080.878839] RIP: 0010:__alloc_pages+0x2c8/0x350 [ 4080.879470] Seguimiento de llamadas: [ 4080.879473] [ 4080.879473] ? __alloc_pages+0x2c8/0x350 [ 4080.879475] ? __warn.cold+0x8e/0xe8 [ 4080.880647] ? __alloc_pages+0x2c8/0x350 [ 4080.880909] ? report_bug+0xff/0x140 [ 4080.881175] ? handle_bug+0x3c/0x80 [ 4080.881556] ? exc_invalid_op+0x17/0x70 [ 4080.881559] ? asm_exc_invalid_op+0x1a/0x20 [ 4080.882077] ? udmabuf_create+0x131/0x400 Debido a MAX_PAGE_ORDER, kmalloc puede asignar un máximo de 4096 * (1 &lt;&lt; 10), 4 MB de memoria, cada entrada de la matriz es un puntero (8 bytes), por lo que puede guardar 524288 páginas (2 GB). Además, es posible que no se garantice que se pueda aplicar el pedido costoso (pedido 3) debido a la fragmentación. Este parche cambia la matriz udmabuf para usar kvmalloc_array, lo que permite que la asignación se convierta en una función alternativa de vmalloc, lo que puede garantizar la asignación para cualquier tamaño y no afecta el rendimiento de las asignaciones de kmalloc.
CVSS v2 : unknown
v3 : unknown
v2 : unknown
v3 : 5.5
References () https://git.kernel.org/stable/c/1c0844c6184e658064e14c4335885785ad3bf84b - () https://git.kernel.org/stable/c/1c0844c6184e658064e14c4335885785ad3bf84b - Patch
References () https://git.kernel.org/stable/c/2acc6192aa8570661ed37868c02c03002b1dc290 - () https://git.kernel.org/stable/c/2acc6192aa8570661ed37868c02c03002b1dc290 - Patch
References () https://git.kernel.org/stable/c/85bb72397cb63649fe493c96e27e1d0e4ed2ff63 - () https://git.kernel.org/stable/c/85bb72397cb63649fe493c96e27e1d0e4ed2ff63 - Patch
CWE CWE-476

27 Dec 2024, 14:15

Type Values Removed Values Added
New CVE

Information

Published : 2024-12-27 14:15

Updated : 2025-02-03 15:19


NVD link : CVE-2024-56544

Mitre link : CVE-2024-56544

CVE.ORG link : CVE-2024-56544


JSON object : View

Products Affected

linux

  • linux_kernel
CWE
CWE-476

NULL Pointer Dereference