Subject: CVE-2023-52870: clk: mediatek: clk-mt6765: Add check for mtk_alloc_clk_data

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

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

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

clk: mediatek: clk-mt6765: Add check for mtk_alloc_clk_data

Add the check for the return value of mtk_alloc_clk_data() in order to
avoid NULL pointer dereference.

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

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

	Issue introduced in 5.8 with commit 1aca9939bf72 and fixed in 5.10.201 with commit 2617aa8ceaf3
	Issue introduced in 5.8 with commit 1aca9939bf72 and fixed in 5.15.139 with commit 533ca5153ad6
	Issue introduced in 5.8 with commit 1aca9939bf72 and fixed in 6.1.63 with commit dd1f30d68fa9
	Issue introduced in 5.8 with commit 1aca9939bf72 and fixed in 6.5.12 with commit 10cc81124407
	Issue introduced in 5.8 with commit 1aca9939bf72 and fixed in 6.6.2 with commit b5ff3e89b4e7
	Issue introduced in 5.8 with commit 1aca9939bf72 and fixed in 6.7 with commit b82681042724

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-52870
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/clk/mediatek/clk-mt6765.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/2617aa8ceaf30e41d3eb7f5fef3445542bef193a
	https://git.kernel.org/stable/c/533ca5153ad6c7b7d47ae0114b14d0333964b946
	https://git.kernel.org/stable/c/dd1f30d68fa98eb672c0a259297b761656a9025f
	https://git.kernel.org/stable/c/10cc81124407d862f0f747db4baa9c006510b480
	https://git.kernel.org/stable/c/b5ff3e89b4e7f46ad2aa0de7e08d18e6f87d71bc
	https://git.kernel.org/stable/c/b82681042724924ae3ba0f2f2eeec217fa31e830