// For flags

CVE-2024-35977

platform/chrome: cros_ec_uart: properly fix race condition

Severity Score

"-"
*CVSS v-

Exploit Likelihood

*EPSS

Affected Versions

*CPE

Public Exploits

0
*Multiple Sources

Exploited in Wild

-
*KEV

Decision

Track
*SSVC
Descriptions

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().

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().

*Credits: N/A
CVSS Scores
Attack Vector
-
Attack Complexity
-
Privileges Required
-
User Interaction
-
Scope
-
Confidentiality
-
Integrity
-
Availability
-
* Common Vulnerability Scoring System
SSVC
  • Decision:Track
Exploitation
None
Automatable
No
Tech. Impact
Partial
* Organization's Worst-case Scenario
Timeline
  • 2024-05-17 CVE Reserved
  • 2024-05-20 CVE Published
  • 2024-05-21 EPSS Updated
  • 2024-09-11 CVE Updated
  • ---------- Exploited in Wild
  • ---------- KEV Due Date
  • ---------- First Exploit
CWE
CAPEC
Affected Vendors, Products, and Versions
Vendor Product Version Other Status
Vendor Product Version Other Status <-- --> Vendor Product Version Other Status
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 6.3 < 6.6.28
Search vendor "Linux" for product "Linux Kernel" and version " >= 6.3 < 6.6.28"
en
Affected
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 6.3 < 6.8.7
Search vendor "Linux" for product "Linux Kernel" and version " >= 6.3 < 6.8.7"
en
Affected
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 6.3 < 6.9
Search vendor "Linux" for product "Linux Kernel" and version " >= 6.3 < 6.9"
en
Affected