Skip to contentSkip to conversation

CVE-2025-40191: drm/amdkfd: Fix kfd process ref leaking when userptr unmapping

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Nov 12, 2025

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

drm/amdkfd: Fix kfd process ref leaking when userptr unmapping

kfd_lookup_process_by_pid hold the kfd process reference to ensure it doesn't get destroyed while sending the segfault event to user space.

Calling kfd_lookup_process_by_pid as function parameter leaks the kfd process refcount and miss the NULL pointer check if app process is already destroyed.

The Linux kernel CVE team has assigned CVE-2025-40191 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 6.16 with commit 2d274bf7099bc5e95fabaa93f23d0eb2977187ad and fixed in 6.17.4 with commit 60f6112fc9b3ba0eae519f10702c0c13bab45742
	Issue introduced in 6.16 with commit 2d274bf7099bc5e95fabaa93f23d0eb2977187ad and fixed in 6.18-rc1 with commit 58e6fc2fb94f0f409447e5d46cf6a417b6397fbc

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2025-40191

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/60f6112fc9b3ba0eae519f10702c0c13bab45742
	https://git.kernel.org/stable/c/58e6fc2fb94f0f409447e5d46cf6a417b6397fbc