Subject: CVE-2023-52871: soc: qcom: llcc: Handle a second device without data corruption

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

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

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

soc: qcom: llcc: Handle a second device without data corruption

Usually there is only one llcc device. But if there were a second, even
a failed probe call would modify the global drv_data pointer. So check
if drv_data is valid before overwriting it.

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

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

	Issue introduced in 4.19 with commit a3134fb09e0b and fixed in 5.4.261 with commit cc1a1dcb411f
	Issue introduced in 4.19 with commit a3134fb09e0b and fixed in 5.10.201 with commit 5e5b85ea0f4b
	Issue introduced in 4.19 with commit a3134fb09e0b and fixed in 5.15.139 with commit 995ee1e84e8d
	Issue introduced in 4.19 with commit a3134fb09e0b and fixed in 6.1.63 with commit f0ef883cae30
	Issue introduced in 4.19 with commit a3134fb09e0b and fixed in 6.5.12 with commit 3565684309e5
	Issue introduced in 4.19 with commit a3134fb09e0b and fixed in 6.6.2 with commit 1143bfb9b055
	Issue introduced in 4.19 with commit a3134fb09e0b and fixed in 6.7 with commit f1a1bc8775b2

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-52871
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/soc/qcom/llcc-qcom.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/cc1a1dcb411fe224f48553cfdcdfe6e61395b69c
	https://git.kernel.org/stable/c/5e5b85ea0f4bc484bfe4cc73ead51fa48d2366a0
	https://git.kernel.org/stable/c/995ee1e84e8db7fa5dcdde7dfe0bd7bb6f9bbb8c
	https://git.kernel.org/stable/c/f0ef883cae309bc5e8cdfcdbc1b4822732ce20a8
	https://git.kernel.org/stable/c/3565684309e54fa998ea27f37028d67cc3e1dff2
	https://git.kernel.org/stable/c/1143bfb9b055897975aeaea254da148e19524493
	https://git.kernel.org/stable/c/f1a1bc8775b26345aba2be278118999e7f661d3d