CVE-2024-44964

In the Linux kernel, the following vulnerability has been resolved: idpf: fix memory leaks and crashes while performing a soft reset The second tagged commit introduced a UAF, as it removed restoring q_vector->vport pointers after reinitializating the structures. This is due to that all queue allocation functions are performed here with the new temporary vport structure and those functions rewrite the backpointers to the vport. Then, this new struct is freed and the pointers start leading to nowhere. But generally speaking, the current logic is very fragile. It claims to be more reliable when the system is low on memory, but in fact, it consumes two times more memory as at the moment of running this function, there are two vports allocated with their queues and vectors. Moreover, it claims to prevent the driver from running into "bad state", but in fact, any error during the rebuild leaves the old vport in the partially allocated state. Finally, if the interface is down when the function is called, it always allocates a new queue set, but when the user decides to enable the interface later on, vport_open() allocates them once again, IOW there's a clear memory leak here. Just don't allocate a new queue set when performing a reset, that solves crashes and memory leaks. Readd the old queue number and reopen the interface on rollback - that solves limbo states when the device is left disabled and/or without HW queues enabled.
Configurations

Configuration 1 (hide)

OR cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.11:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.11:rc2:*:*:*:*:*:*

History

06 Sep 2024, 16:36

Type Values Removed Values Added
CPE cpe:2.3:o:linux:linux_kernel:6.11:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.11:rc2:*:*:*:*:*:*
CVSS v2 : unknown
v3 : unknown
v2 : unknown
v3 : 7.8
First Time Linux linux Kernel
Linux
CWE CWE-401
CWE-416
References () https://git.kernel.org/stable/c/6b289f8d91537ec1e4f9c7b38b31b90d93b1419b - () https://git.kernel.org/stable/c/6b289f8d91537ec1e4f9c7b38b31b90d93b1419b - Patch
References () https://git.kernel.org/stable/c/f01032a2ca099ec8d619aaa916c3762aa62495df - () https://git.kernel.org/stable/c/f01032a2ca099ec8d619aaa916c3762aa62495df - Patch

05 Sep 2024, 12:53

Type Values Removed Values Added
Summary
  • (es) En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: idpf: corrige fugas de memoria y fallos al realizar un reinicio suave El segundo commit etiquetado introdujo un UAF, ya que eliminó la restauración de punteros q_vector->vport después de reinicializar las estructuras. Esto se debe a que todas las funciones de asignación de colas se realizan aquí con la nueva estructura vport temporal y esas funciones reescriben los punteros hacia atrás al vport. Luego, esta nueva estructura se libera y los punteros comienzan a no llevar a ninguna parte. Pero en términos generales, la lógica actual es muy frágil. Afirma ser más confiable cuando el sistema tiene poca memoria, pero de hecho, consume dos veces más memoria ya que en el momento de ejecutar esta función, hay dos vports asignados con sus colas y vectores. Además, afirma evitar que el controlador entre en "mal estado", pero de hecho, cualquier error durante la reconstrucción deja el antiguo vport en el estado parcialmente asignado. Finalmente, si la interfaz está inactiva cuando se llama a la función, siempre asigna un nuevo conjunto de colas, pero cuando el usuario decide habilitar la interfaz más adelante, vport_open() las asigna una vez más, es decir, hay una clara pérdida de memoria aquí. Simplemente no asigne un nuevo conjunto de colas cuando realice un reinicio, eso resuelve fallas y pérdidas de memoria. Vuelva a agregar el número de cola anterior y vuelva a abrir la interfaz en la reversión: eso resuelve los estados de limbo cuando el dispositivo se deja deshabilitado y/o sin colas de HW habilitadas.

04 Sep 2024, 19:15

Type Values Removed Values Added
New CVE

Information

Published : 2024-09-04 19:15

Updated : 2024-09-06 16:36


NVD link : CVE-2024-44964

Mitre link : CVE-2024-44964

CVE.ORG link : CVE-2024-44964


JSON object : View

Products Affected

linux

  • linux_kernel
CWE
CWE-401

Missing Release of Memory after Effective Lifetime

CWE-416

Use After Free