CVE-2024-35878 of: module: prevent NULL pointer dereference in vsnprintf()

Medium 5.3 Published Updated

A NULL pointer dereference in the Linux kernel's of_modalias function can cause a kernel oops, leading to denial of service.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-35878?

CVE-2024-35878 is a medium-severity vulnerability in Linux kernel, published on 19 May 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

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

of: module: prevent NULL pointer dereference in vsnprintf()

In of_modalias(), we can get passed the str and len parameters which would cause a kernel oops in vsnprintf() since it only allows passing a NULL ptr when the length is also 0. Also, we need to filter out the negative values of the len parameter as these will result in a really huge buffer since snprintf() takes size_t parameter while ours is ssize_t...

Found by Linux Verification Center (linuxtesting.org) with the Svace static analysis tool.

Weakness: CWE-476

Which versions are affected by CVE-2024-35878?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-35878?

Apply the vendor's patch.

Is CVE-2024-35878 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2024-35878, DEBIAN-CVE-2024-35878, GHSA-q6m5-rpfj-c92f, ROOT-OS-DEBIAN-11-CVE-2024-35878, ROOT-OS-DEBIAN-12-CVE-2024-35878, ROOT-OS-UBUNTU-2204-CVE-2024-35878 and 1 more.

Is CVE-2024-35878 in your software?

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

Check your SBOMs for free