Subject: CVE-2024-35817: drm/amdgpu: amdgpu_ttm_gart_bind set gtt bound flag

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

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

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

drm/amdgpu: amdgpu_ttm_gart_bind set gtt bound flag

Otherwise after the GTT bo is released, the GTT and gart space is freed
but amdgpu_ttm_backend_unbind will not clear the gart page table entry
and leave valid mapping entry pointing to the stale system page. Then
if GPU access the gart address mistakely, it will read undefined value
instead page fault, harder to debug and reproduce the real issue.

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

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

	Fixed in 5.15.154 with commit 5d5f1a7f3b10
	Fixed in 6.1.84 with commit 589c414138a1
	Fixed in 6.6.24 with commit 6fcd12cb9088
	Fixed in 6.7.12 with commit e8d27caef2c8
	Fixed in 6.8.3 with commit 5cdce3dda3b3
	Fixed in 6.9 with commit 6c6064cbe58b

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-35817
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_ttm.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/5d5f1a7f3b1039925f79c7894f153c2a905201fb
	https://git.kernel.org/stable/c/589c414138a1bed98e652c905937d8f790804efe
	https://git.kernel.org/stable/c/6fcd12cb90888ef2d8af8d4c04e913252eee4ef3
	https://git.kernel.org/stable/c/e8d27caef2c829a306e1f762fb95f06e8ec676f6
	https://git.kernel.org/stable/c/5cdce3dda3b3dacde902f63a8ee72c2b7f91912d
	https://git.kernel.org/stable/c/6c6064cbe58b43533e3451ad6a8ba9736c109ac3