CVE-2024-36932 thermal/debugfs: Prevent use-after-free from occurring after cdev removal

Medium 5.5 Published Updated

A race condition in the Linux kernel thermal debugfs subsystem allows a use-after-free, 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-36932?

CVE-2024-36932 is a medium-severity use after free vulnerability in Linux kernel, published on 30 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:

thermal/debugfs: Prevent use-after-free from occurring after cdev removal

Since thermal_debug_cdev_remove() does not run under cdev->lock, it can run in parallel with thermal_debug_cdev_state_update() and it may free the struct thermal_debugfs object used by the latter after it has been checked against NULL.

If that happens, thermal_debug_cdev_state_update() will access memory that has been freed already causing the kernel to crash.

Address this by using cdev->lock in thermal_debug_cdev_remove() around the cdev->debugfs value check (in case the same cdev is removed at the same time in two different threads) and its reset to NULL.

Cc :6.8+ <[email protected]> # 6.8+

Weakness: CWE-416

Which versions are affected by CVE-2024-36932?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-36932?

Apply the vendor's patch.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2024-36932 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2024-36932, DEBIAN-CVE-2024-36932, UBUNTU-CVE-2024-36932.

Is CVE-2024-36932 in your software?

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

Check your SBOMs for free