CVE-2025-21842 amdkfd: properly free gang_ctx_bo when failed to init user queue
A type mismatch in the amdkfd driver causes a null pointer dereference when user queue initialization fails, leading to a kernel crash.
- 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-2025-21842?
CVE-2025-21842 is a high-severity vulnerability in Linux kernel, published on 7 Mar 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:
amdkfd: properly free gang_ctx_bo when failed to init user queue
The destructor of a gtt bo is declared as void amdgpu_amdkfd_free_gtt_mem(struct amdgpu_device *adev, void **mem_obj); Which takes void** as the second parameter.
GCC allows passing void* to the function because void* can be implicitly casted to any other types, so it can pass compiling.
However, passing this void* parameter into the function's execution process(which expects void** and dereferencing void**) will result in errors.
Which versions are affected by CVE-2025-21842?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2025-21842?
Apply the vendor's patch.
Is CVE-2025-21842 being exploited?
There is no known exploitation of CVE-2025-21842 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as BELL-CVE-2025-21842, DEBIAN-CVE-2025-21842, GHSA-583x-9h9h-f6f6, UBUNTU-CVE-2025-21842.