Subject: CVE-2024-50069: pinctrl: apple: check devm_kasprintf() returned value

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

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

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

pinctrl: apple: check devm_kasprintf() returned value

devm_kasprintf() can return a NULL pointer on failure but this returned
value is not checked. Fix this lack and check the returned value.

Found by code review.

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

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

	Issue introduced in 5.16 with commit a0f160ffcb83 and fixed in 6.1.114 with commit 0a4d4dbef622
	Issue introduced in 5.16 with commit a0f160ffcb83 and fixed in 6.6.58 with commit fad940e2dd78
	Issue introduced in 5.16 with commit a0f160ffcb83 and fixed in 6.11.5 with commit 4d2296fb7c80
	Issue introduced in 5.16 with commit a0f160ffcb83 and fixed in 6.12-rc4 with commit 665a58fe663a

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-50069
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/pinctrl/pinctrl-apple-gpio.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/0a4d4dbef622ac8796a6665e0080da2685f9220a
	https://git.kernel.org/stable/c/fad940e2dd789155f99ecafa71a7baf6f96530bc
	https://git.kernel.org/stable/c/4d2296fb7c80fdc9925d29a8e85d617cad08731a
	https://git.kernel.org/stable/c/665a58fe663ac7a9ea618dc0b29881649324b116