CVE-2024-38592

In the Linux kernel, the following vulnerability has been resolved: drm/mediatek: Init `ddp_comp` with devm_kcalloc() In the case where `conn_routes` is true we allocate an extra slot in the `ddp_comp` array but mtk_drm_crtc_create() never seemed to initialize it in the test case I ran. For me, this caused a later crash when we looped through the array in mtk_drm_crtc_mode_valid(). This showed up for me when I booted with `slub_debug=FZPUA` which poisons the memory initially. Without `slub_debug` I couldn't reproduce, presumably because the later code handles the value being NULL and in most cases (not guaranteed in all cases) the memory the allocator returned started out as 0. It really doesn't hurt to initialize the array with devm_kcalloc() since the array is small and the overhead of initting a handful of elements to 0 is small. In general initting memory to zero is a safer practice and usually it's suggested to only use the non-initting alloc functions if you really need to. Let's switch the function to use an allocation function that zeros the memory. For me, this avoids the crash.
Configurations

Configuration 1 (hide)

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

History

17 Sep 2025, 21:08

Type Values Removed Values Added
References () https://git.kernel.org/stable/c/01a2c5123e27b3c4685bf2fc4c2e879f6e0c7b33 - () https://git.kernel.org/stable/c/01a2c5123e27b3c4685bf2fc4c2e879f6e0c7b33 - Patch
References () https://git.kernel.org/stable/c/9fe2cc3fa44f7ad7ba5f29c1a68b2b924c17b9b1 - () https://git.kernel.org/stable/c/9fe2cc3fa44f7ad7ba5f29c1a68b2b924c17b9b1 - Patch
References () https://git.kernel.org/stable/c/cf69d0af7db917b82aceaa44b7b1b9376609da22 - () https://git.kernel.org/stable/c/cf69d0af7db917b82aceaa44b7b1b9376609da22 - Patch
CWE CWE-908
CVSS v2 : unknown
v3 : unknown
v2 : unknown
v3 : 5.5
CPE cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
First Time Linux linux Kernel
Linux

21 Nov 2024, 09:26

Type Values Removed Values Added
References () https://git.kernel.org/stable/c/01a2c5123e27b3c4685bf2fc4c2e879f6e0c7b33 - () https://git.kernel.org/stable/c/01a2c5123e27b3c4685bf2fc4c2e879f6e0c7b33 -
References () https://git.kernel.org/stable/c/9fe2cc3fa44f7ad7ba5f29c1a68b2b924c17b9b1 - () https://git.kernel.org/stable/c/9fe2cc3fa44f7ad7ba5f29c1a68b2b924c17b9b1 -
References () https://git.kernel.org/stable/c/cf69d0af7db917b82aceaa44b7b1b9376609da22 - () https://git.kernel.org/stable/c/cf69d0af7db917b82aceaa44b7b1b9376609da22 -

20 Jun 2024, 12:44

Type Values Removed Values Added
Summary
  • (es) En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: drm/mediatek: Init `ddp_comp` con devm_kcalloc() En el caso de que `conn_routes` sea verdadero, asignamos una ranura adicional en la matriz `ddp_comp` pero mtk_drm_crtc_create() nunca apareció para inicializarlo en el caso de prueba que ejecuté. Para mí, esto provocó un bloqueo posterior cuando recorrimos la matriz en mtk_drm_crtc_mode_valid(). Esto me apareció cuando arranqué con `slub_debug=FZPUA` que envenena la memoria inicialmente. Sin `slub_debug` no pude reproducir, presumiblemente porque el código posterior maneja que el valor sea NULL y en la mayoría de los casos (no garantizado en todos los casos) la memoria que devolvió el asignador comenzó como 0. Realmente no está de más inicializar el array con devm_kcalloc() ya que la matriz es pequeña y la sobrecarga de iniciar un puñado de elementos en 0 es pequeña. En general, iniciar la memoria a cero es una práctica más segura y, por lo general, se sugiere usar solo las funciones de asignación que no son de inicio si realmente es necesario. Cambiemos la función para usar una función de asignación que ponga a cero la memoria. Para mí, esto evita el accidente.

19 Jun 2024, 14:15

Type Values Removed Values Added
New CVE

Information

Published : 2024-06-19 14:15

Updated : 2025-09-17 21:08


NVD link : CVE-2024-38592

Mitre link : CVE-2024-38592

CVE.ORG link : CVE-2024-38592


JSON object : View

Products Affected

linux

  • linux_kernel
CWE
CWE-908

Use of Uninitialized Resource