Subject: CVE-2024-38584: net: ti: icssg_prueth: Fix NULL pointer dereference in prueth_probe()

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

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

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

net: ti: icssg_prueth: Fix NULL pointer dereference in prueth_probe()

In the prueth_probe() function, if one of the calls to emac_phy_connect()
fails due to of_phy_connect() returning NULL, then the subsequent call to
phy_attached_info() will dereference a NULL pointer.

Check the return code of emac_phy_connect and fail cleanly if there is an
error.

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

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

	Issue introduced in 6.6 with commit 128d5874c082 and fixed in 6.6.33 with commit 5cd17f0e74cb
	Issue introduced in 6.6 with commit 128d5874c082 and fixed in 6.8.12 with commit b0a82ebabbdc
	Issue introduced in 6.6 with commit 128d5874c082 and fixed in 6.9.3 with commit 1e1d5bd7f468
	Issue introduced in 6.6 with commit 128d5874c082 and fixed in 6.10 with commit b31c7e780861

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-38584
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/net/ethernet/ti/icssg/icssg_prueth.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/5cd17f0e74cb99d209945b9f1f06d411aa667eb1
	https://git.kernel.org/stable/c/b0a82ebabbdc4c307f781bb0e5cd617949a3900d
	https://git.kernel.org/stable/c/1e1d5bd7f4682e6925dd960aba2a1aa1d93da53a
	https://git.kernel.org/stable/c/b31c7e78086127a7fcaa761e8d336ee855a920c6