Skip to contentSkip to conversation

CVE-2026-63878: drm/amdgpu: check num_entries in GEM_OP GET_MAPPING_INFO

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Jul 19

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/amdgpu: check num_entries in GEM_OP GET_MAPPING_INFO

kvcalloc(args->num_entries, sizeof(*vm_entries), GFP_KERNEL) at amdgpu_gem.c:1050 uses the user-supplied num_entries directly without any upper bounds check. Since num_entries is a __u32 and sizeof(drm_amdgpu_gem_vm_entry) is 32 bytes, a large num_entries produces an allocation exceeding INT_MAX, triggering WARNING in __kvmalloc_node_noprof(), causing a kernel WARNING, TAINT_WARN, and panic on CONFIG_PANIC_ON_WARN=y systems.

Add a size bounds check before we invoke the kvzalloc() to reject oversized num_entries early with -EINVAL.

(cherry picked from commit 1fe7bf5457f6efd7be60b17e23163ba54341d73d)

The Linux kernel CVE team has assigned CVE-2026-63878 to this issue.

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

	Issue introduced in 6.18 with commit 4d82724f7f2b847eb0454b1aab5450545b39abd4 and fixed in 6.18.35 with commit f059b4c493df3e54fe3ffe4658009c31864275da
	Issue introduced in 6.18 with commit 4d82724f7f2b847eb0454b1aab5450545b39abd4 and fixed in 7.0.12 with commit 967a00b8e06a7734aded23861faba9ee2462be87
	Issue introduced in 6.18 with commit 4d82724f7f2b847eb0454b1aab5450545b39abd4 and fixed in 7.1 with commit a1ba4594232c87c3b8defd6f89a2e40f8b08395d

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-2026-63878

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_gem.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/f059b4c493df3e54fe3ffe4658009c31864275da
	https://git.kernel.org/stable/c/967a00b8e06a7734aded23861faba9ee2462be87
	https://git.kernel.org/stable/c/a1ba4594232c87c3b8defd6f89a2e40f8b08395d