CVE-2024-26791 btrfs: dev-replace: properly validate device names

High 7.1 Published Updated

A missing validation in the Linux kernel's btrfs device replacement allows out-of-bounds reads, potentially causing a system crash.

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-26791?

CVE-2024-26791 is a high-severity vulnerability in Linux kernel, published on 4 Apr 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:

btrfs: dev-replace: properly validate device names

There's a syzbot report that device name buffers passed to device replace are not properly checked for string termination which could lead to a read out of bounds in getname_kernel().

Add a helper that validates both source and target device name buffers. For devid as the source initialize the buffer to empty string in case something tries to read it later.

This was originally analyzed and fixed in a different way by Edward Adam Davis (see links).

Weakness: CWE-125

Which versions are affected by CVE-2024-26791?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-26791?

Apply the vendor's patch.

Is CVE-2024-26791 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2024-26791, DEBIAN-CVE-2024-26791, GHSA-7vqv-4gqw-665q, UBUNTU-CVE-2024-26791.

Is CVE-2024-26791 in your software?

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

Check your SBOMs for free