Subject: CVE-2023-52814: drm/amdgpu: Fix potential null pointer derefernce

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

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

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

drm/amdgpu: Fix potential null pointer derefernce

The amdgpu_ras_get_context may return NULL if device
not support ras feature, so add check before using.

The Linux kernel CVE team has assigned CVE-2023-52814 to this issue.

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

	Fixed in 5.10.202 with commit b93a25de28af
	Fixed in 5.15.140 with commit c11cf5e117f5
	Fixed in 6.1.64 with commit 9b70fc7d70e8
	Fixed in 6.5.13 with commit b0702ee4d811
	Fixed in 6.6.3 with commit da46e63482fd
	Fixed in 6.7 with commit 80285ae1ec87

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-2023-52814
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/b93a25de28af153312f0fc979b0663fc4bd3442b
	https://git.kernel.org/stable/c/c11cf5e117f50f5a767054600885acd981449afe
	https://git.kernel.org/stable/c/9b70fc7d70e8ef7c4a65034c9487f58609e708a1
	https://git.kernel.org/stable/c/b0702ee4d811708251cdf54d4a1d3e888d365111
	https://git.kernel.org/stable/c/da46e63482fdc5e35c008865c22ac64027f6f0c2
	https://git.kernel.org/stable/c/80285ae1ec8717b597b20de38866c29d84d321a1