Skip to contentSkip to conversation

CVE-2024-35928: drm/amd/amdgpu: Fix potential ioremap() memory leaks in amdgpu_device_init()

DISCUSSION Greg Kroah-Hartman 1 participant 1 message May 19, 2024

lore
Share & tools
lore
#0 lore raw

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

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

drm/amd/amdgpu: Fix potential ioremap() memory leaks in amdgpu_device_init()

This ensures that the memory mapped by ioremap for adev->rmmio, is properly handled in amdgpu_device_init(). If the function exits early due to an error, the memory is unmapped. If the function completes successfully, the memory remains mapped.

Reported by smatch:
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4337 amdgpu_device_init() warn: 'adev->rmmio' from ioremap() not released on lines: 4035,4045,4051,4058,4068,4337

The Linux kernel CVE team has assigned CVE-2024-35928 to this issue.

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

	Fixed in 6.1.86 with commit c5f9fe2c1e50
	Fixed in 6.6.27 with commit 14ac934db851
	Fixed in 6.8.6 with commit aa665c3a2aca
	Fixed in 6.9 with commit eb4f139888f6

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-2024-35928

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_device.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/c5f9fe2c1e5023fa096189a8bfba6420aa035587
	https://git.kernel.org/stable/c/14ac934db851642ea8cd1bd4121c788a8899ef69
	https://git.kernel.org/stable/c/aa665c3a2aca2ffe31b9645bda278e96dfc3b55c
	https://git.kernel.org/stable/c/eb4f139888f636614dab3bcce97ff61cefc4b3a7