CVE-2024-35977

In the Linux kernel, the following vulnerability has been resolved: platform/chrome: cros_ec_uart: properly fix race condition The cros_ec_uart_probe() function calls devm_serdev_device_open() before it calls serdev_device_set_client_ops(). This can trigger a NULL pointer dereference: BUG: kernel NULL pointer dereference, address: 0000000000000000 ... Call Trace: <TASK> ... ? ttyport_receive_buf A simplified version of crashing code is as follows: static inline size_t serdev_controller_receive_buf(struct serdev_controller *ctrl, const u8 *data, size_t count) { struct serdev_device *serdev = ctrl->serdev; if (!serdev || !serdev->ops->receive_buf) // CRASH! return 0; return serdev->ops->receive_buf(serdev, data, count); } It assumes that if SERPORT_ACTIVE is set and serdev exists, serdev->ops will also exist. This conflicts with the existing cros_ec_uart_probe() logic, as it first calls devm_serdev_device_open() (which sets SERPORT_ACTIVE), and only later sets serdev->ops via serdev_device_set_client_ops(). Commit 01f95d42b8f4 ("platform/chrome: cros_ec_uart: fix race condition") attempted to fix a similar race condition, but while doing so, made the window of error for this race condition to happen much wider. Attempt to fix the race condition again, making sure we fully setup before calling devm_serdev_device_open().
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:6.9:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.9:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.9:rc3:*:*:*:*:*:*

History

14 Jan 2025, 16:36

Type Values Removed Values Added
CPE cpe:2.3:o:linux:linux_kernel:6.9:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.9:rc3:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.9:rc1:*:*:*:*:*:*
CWE CWE-362
CWE-476
First Time Linux linux Kernel
Linux
CVSS v2 : unknown
v3 : unknown
v2 : unknown
v3 : 4.7
References () https://git.kernel.org/stable/c/5e700b384ec13f5bcac9855cb28fcc674f1d3593 - () https://git.kernel.org/stable/c/5e700b384ec13f5bcac9855cb28fcc674f1d3593 - Patch
References () https://git.kernel.org/stable/c/9e9bb74a93b7daa32313ccaefd0edc529d40daf8 - () https://git.kernel.org/stable/c/9e9bb74a93b7daa32313ccaefd0edc529d40daf8 - Patch
References () https://git.kernel.org/stable/c/cfd758041d8b79aa8c3f811b6bd6105379f2f702 - () https://git.kernel.org/stable/c/cfd758041d8b79aa8c3f811b6bd6105379f2f702 - Patch

21 Nov 2024, 09:21

Type Values Removed Values Added
Summary
  • (es) En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: plataforma/chrome: cros_ec_uart: corrige correctamente la condición de ejecución. La función cros_ec_uart_probe() llama a devm_serdev_device_open() antes de llamar a serdev_device_set_client_ops(). Esto puede desencadenar una desreferencia del puntero NULL: ERROR: desreferencia del puntero NULL del kernel, dirección: 0000000000000000... Seguimiento de llamadas: ...? ttyport_receive_buf Una versión simplificada del código de bloqueo es la siguiente: static inline size_t serdev_controller_receive_buf(struct serdev_controller *ctrl, const u8 *data, size_t count) { struct serdev_device *serdev = ctrl-&gt;serdev; if (!serdev || !serdev-&gt;ops-&gt;receive_buf) // ¡CRASH! devolver 0; devolver serdev-&gt;ops-&gt;receive_buf(serdev, datos, recuento); } Se supone que si SERPORT_ACTIVE está configurado y serdev existe, serdev-&gt;ops también existirá. Esto entra en conflicto con la lógica cros_ec_uart_probe() existente, ya que primero llama a devm_serdev_device_open() (que configura SERPORT_ACTIVE), y solo luego configura serdev-&gt;ops a través de serdev_device_set_client_ops(). La confirmación 01f95d42b8f4 ("plataforma/chrome: cros_ec_uart: arreglar condición de ejecución") intentó arreglar una condición de ejecución similar, pero al hacerlo, hizo que la ventana de error para que esta condición de ejecución ocurriera fuera mucho más amplia. Intente corregir la condición de ejecución nuevamente, asegurándose de realizar la configuración completa antes de llamar a devm_serdev_device_open().
References () https://git.kernel.org/stable/c/5e700b384ec13f5bcac9855cb28fcc674f1d3593 - () https://git.kernel.org/stable/c/5e700b384ec13f5bcac9855cb28fcc674f1d3593 -
References () https://git.kernel.org/stable/c/9e9bb74a93b7daa32313ccaefd0edc529d40daf8 - () https://git.kernel.org/stable/c/9e9bb74a93b7daa32313ccaefd0edc529d40daf8 -
References () https://git.kernel.org/stable/c/cfd758041d8b79aa8c3f811b6bd6105379f2f702 - () https://git.kernel.org/stable/c/cfd758041d8b79aa8c3f811b6bd6105379f2f702 -

20 May 2024, 10:15

Type Values Removed Values Added
New CVE

Information

Published : 2024-05-20 10:15

Updated : 2025-01-14 16:36


NVD link : CVE-2024-35977

Mitre link : CVE-2024-35977

CVE.ORG link : CVE-2024-35977


JSON object : View

Products Affected

linux

  • linux_kernel
CWE
CWE-362

Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')

CWE-476

NULL Pointer Dereference