CVE-2024-47705 block: fix potential invalid pointer dereference in blk_add_partition

Medium 5.5 Published Updated

A null pointer dereference in the Linux kernel block layer can cause a system crash, requiring a kernel patch to resolve.

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

CVE-2024-47705 is a medium-severity vulnerability in Linux kernel, published on 21 Oct 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:

block: fix potential invalid pointer dereference in blk_add_partition

The blk_add_partition() function initially used a single if-condition (IS_ERR(part)) to check for errors when adding a partition. This was modified to handle the specific case of -ENXIO separately, allowing the function to proceed without logging the error in this case. However, this change unintentionally left a path where md_autodetect_dev() could be called without confirming that part is a valid pointer.

This commit separates the error handling logic by splitting the initial if-condition, improving code readability and handling specific error scenarios explicitly. The function now distinguishes the general error case from -ENXIO without altering the existing behavior of md_autodetect_dev() calls.

Weakness: CWE-476

Which versions are affected by CVE-2024-47705?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-47705?

Apply the vendor's patch.

Is CVE-2024-47705 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as AZL-51150, AZL-51219, BELL-CVE-2024-47705, DEBIAN-CVE-2024-47705, GHSA-5vwr-fpff-94gx, UBUNTU-CVE-2024-47705.

Is CVE-2024-47705 in your software?

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

Check your SBOMs for free