CVE-2024-38576 rcu: Fix buffer overflow in print_cpu_stall_info()

High 7.0 Published Updated

A buffer overflow in the Linux kernel's RCU stall reporting can cause a crash when large time differences occur, requiring a kernel patch.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2024-38576?

CVE-2024-38576 is a high-severity memory corruption vulnerability in Linux kernel, published on 19 Jun 2024. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

In the Linux kernel, the following vulnerability has been resolved:

rcu: Fix buffer overflow in print_cpu_stall_info()

The rcuc-starvation output from print_cpu_stall_info() might overflow the buffer if there is a huge difference in jiffies difference. The situation might seem improbable, but computers sometimes get very confused about time, which can result in full-sized integers, and, in this case, buffer overflow.

Also, the unsigned jiffies difference is printed using %ld, which is normally for signed integers. This is intentional for debugging purposes, but it is not obvious from the code.

This commit therefore changes sprintf() to snprintf() and adds a clarifying comment about intention of %ld format.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Weakness: CWE-120

Which versions are affected by CVE-2024-38576?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-38576?

Apply the vendor's patch.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is CVE-2024-38576 being exploited?

There is no known exploitation of CVE-2024-38576 in the wild and no public exploit code.

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2024-38576, DEBIAN-CVE-2024-38576, GHSA-xwrr-9h7c-8mxc, UBUNTU-CVE-2024-38576.

Is CVE-2024-38576 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free