Subject: CVE-2024-46799: net: ethernet: ti: am65-cpsw: Fix NULL dereference on XDP_TX

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

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

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

net: ethernet: ti: am65-cpsw: Fix NULL dereference on XDP_TX

If number of TX queues are set to 1 we get a NULL pointer
dereference during XDP_TX.

~# ethtool -L eth0 tx 1
~# ./xdp-trafficgen udp -A <ipv6-src> -a <ipv6-dst> eth0 -t 2
Transmitting on eth0 (ifindex 2)
[  241.135257] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000030

Fix this by using actual TX queues instead of max TX queues
when picking the TX channel in am65_cpsw_ndo_xdp_xmit().

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

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

	Issue introduced in 6.10 with commit 8acacc40f733 and fixed in 6.10.10 with commit 2e7189d2b1de
	Issue introduced in 6.10 with commit 8acacc40f733 and fixed in 6.11 with commit 0a50c35277f9

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-46799
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/am65-cpsw-nuss.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/2e7189d2b1de51fc2567676cd4f96c0fe0960b9f
	https://git.kernel.org/stable/c/0a50c35277f96481a5a6ed5faf347f282040c57d