CVE-2024-56774 btrfs: add a sanity check for btrfs root in btrfs_search_slot()

Medium 5.5 Published Updated

A null pointer dereference in the Linux kernel btrfs filesystem can cause a denial of service when using rescue mode with corrupted extent trees.

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

CVE-2024-56774 is a medium-severity vulnerability in Linux kernel, published on 8 Jan 2025. 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: add a sanity check for btrfs root in btrfs_search_slot()

Syzbot reports a null-ptr-deref in btrfs_search_slot().

The reproducer is using rescue=ibadroots, and the extent tree root is corrupted thus the extent tree is NULL.

When scrub tries to search the extent tree to gather the needed extent info, btrfs_search_slot() doesn't check if the target root is NULL or not, resulting the null-ptr-deref.

Add sanity check for btrfs root before using it in btrfs_search_slot().

Weakness: CWE-476

Which versions are affected by CVE-2024-56774?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-56774?

Apply the vendor's patch.

Is CVE-2024-56774 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as AZL-55334, AZL-55369, BELL-CVE-2024-56774, DEBIAN-CVE-2024-56774, GHSA-phf7-cpqm-749x, UBUNTU-CVE-2024-56774.

Is CVE-2024-56774 in your software?

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

Check your SBOMs for free