Subject: CVE-2021-47446: drm/msm/a4xx: fix error handling in a4xx_gpu_init()

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

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

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

drm/msm/a4xx: fix error handling in a4xx_gpu_init()

This code returns 1 on error instead of a negative error.  It leads to
an Oops in the caller.  A second problem is that the check for
"if (ret != -ENODATA)" cannot be true because "ret" is set to 1.

The Linux kernel CVE team has assigned CVE-2021-47446 to this issue.

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

	Issue introduced in 5.11 with commit 5785dd7a8ef0 and fixed in 5.14.14 with commit 3962d626eb3e
	Issue introduced in 5.11 with commit 5785dd7a8ef0 and fixed in 5.15 with commit 980d74e7d03c

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-2021-47446
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/msm/adreno/a4xx_gpu.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/3962d626eb3e3b23ebb2e2a61537fa764acbfe11
	https://git.kernel.org/stable/c/980d74e7d03ccf2eaa11d133416946bd880c7c08