CVE-2024-35954 scsi: sg: Avoid sg device teardown race

High 7.8 Published Updated

A race condition in the Linux kernel SCSI generic driver causes a null pointer dereference, leading to a kernel crash and denial of service.

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

CVE-2024-35954 is a high-severity vulnerability in Linux kernel, published on 20 May 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:

scsi: sg: Avoid sg device teardown race

sg_remove_sfp_usercontext() must not use sg_device_destroy() after calling scsi_device_put().

sg_device_destroy() is accessing the parent scsi_device request_queue which will already be set to NULL when the preceding call to scsi_device_put() removed the last reference to the parent scsi_device.

The resulting NULL pointer exception will then crash the kernel.

Weakness: CWE-476

Which versions are affected by CVE-2024-35954?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-35954?

Apply the vendor's patch.

Is CVE-2024-35954 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2024-35954, DEBIAN-CVE-2024-35954, GHSA-v35f-xcmj-3g2x, UBUNTU-CVE-2024-35954.

Is CVE-2024-35954 in your software?

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

Check your SBOMs for free