CVE-2024-35977: platform/chrome: cros_ec_uart: properly fix race condition
In the Linux kernel, the following vulnerability has been resolved:
platform/chrome: crosecuart: properly fix race condition
The crosecuartprobe() function calls devmserdevdeviceopen() before it calls serdevdevicesetclientops(). This can trigger a NULL pointer dereference:
BUG: kernel NULL pointer dereference, address: 0000000000000000 ... Call Trace: <TASK> ... ? ttyportreceivebuf
A simplified version of crashing code is as follows:
static inline sizet serdevcontrollerreceivebuf(struct serdevcontroller ctrl, const u8 data, sizet count) { struct serdevdevice serdev = ctrl->serdev;
if (!serdev || !serdev->ops->receivebuf) // CRASH! return 0;
return serdev->ops->receivebuf(serdev, data, count); }
It assumes that if SERPORTACTIVE is set and serdev exists, serdev->ops will also exist. This conflicts with the existing crosecuartprobe() logic, as it first calls devmserdevdeviceopen() (which sets SERPORTACTIVE), and only later sets serdev->ops via serdevdevicesetclientops().
Commit 01f95d42b8f4 ("platform/chrome: crosecuart: 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 devmserdevdeviceopen().
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2024-35977?
The severity of CVE-2024-35977 is classified as high due to the potential for a NULL pointer dereference that could lead to a denial of service.
How do I fix CVE-2024-35977?
To fix CVE-2024-35977, update your Linux kernel to a fixed version such as 5.10.223-1, 6.1.123-1, or later.
Which Linux kernel versions are affected by CVE-2024-35977?
CVE-2024-35977 affects Linux kernel versions between 6.3 and 6.6.28 as well as 6.7 and 6.8.7, including 6.9-rc1, 6.9-rc2, and 6.9-rc3.
What is the nature of the vulnerability described in CVE-2024-35977?
CVE-2024-35977 is a race condition vulnerability that occurs in the cros_ec_uart_probe() function of the Linux kernel.
Is there a specific package in Debian that addresses CVE-2024-35977?
Yes, Debian provides several packages including linux version 5.10.223-1 and 6.1.123-1 that address CVE-2024-35977.