Subject: CVE-2024-43818: ASoC: amd: Adjust error handling in case of absent codec device

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

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

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

ASoC: amd: Adjust error handling in case of absent codec device

acpi_get_first_physical_node() can return NULL in several cases (no such
device, ACPI table error, reference count drop to 0, etc).
Existing check just emit error message, but doesn't perform return.
Then this NULL pointer is passed to devm_acpi_dev_add_driver_gpios()
where it is dereferenced.

Adjust this error handling by adding error code return.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

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

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

	Issue introduced in 6.0 with commit 02527c3f2300 and fixed in 6.1.103 with commit 1ba9856cf7f6
	Issue introduced in 6.0 with commit 02527c3f2300 and fixed in 6.6.44 with commit 99b642dac24f
	Issue introduced in 6.0 with commit 02527c3f2300 and fixed in 6.10.3 with commit b1173d64edd2
	Issue introduced in 6.0 with commit 02527c3f2300 and fixed in 6.11 with commit 5080808c3339

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-43818
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:
	sound/soc/amd/acp-es8336.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/1ba9856cf7f6492b47c1edf853137f320d583db5
	https://git.kernel.org/stable/c/99b642dac24f6d09ba3ebf1d690be8aefff86164
	https://git.kernel.org/stable/c/b1173d64edd276c957b6d09e1f971c85b38f1519
	https://git.kernel.org/stable/c/5080808c3339de2220c602ab7c7fa23dc6c1a5a3