CVE-2024-49876 drm/xe: fix UAF around queue destruction

High 7.8 Published Updated

A use-after-free vulnerability in the Linux kernel's Xe GPU driver allows attackers to potentially execute code or escalate privileges via improper queue destruction timing.

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

CVE-2024-49876 is a high-severity use after free 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:

drm/xe: fix UAF around queue destruction

We currently do stuff like queuing the final destruction step on a random system wq, which will outlive the driver instance. With bad timing we can teardown the driver with one or more work workqueue still being alive leading to various UAF splats. Add a fini step to ensure user queues are properly torn down. At this point GuC should already be nuked so queue itself should no longer be referenced from hw pov.

v2 (Matt B) - Looks much safer to use a waitqueue and then just wait for the xa_array to become empty before triggering the drain.

(cherry picked from commit 861108666cc0e999cffeab6aff17b662e68774e3)

Weakness: CWE-416

Which versions are affected by CVE-2024-49876?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-49876?

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-49876 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2024-49876, DEBIAN-CVE-2024-49876, GHSA-j994-f74j-cwf3, UBUNTU-CVE-2024-49876.

Is CVE-2024-49876 in your software?

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

Check your SBOMs for free