Subject: CVE-2024-27431: cpumap: Zero-initialise xdp_rxq_info struct before running XDP program

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

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

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

cpumap: Zero-initialise xdp_rxq_info struct before running XDP program

When running an XDP program that is attached to a cpumap entry, we don't
initialise the xdp_rxq_info data structure being used in the xdp_buff
that backs the XDP program invocation. Tobias noticed that this leads to
random values being returned as the xdp_md->rx_queue_index value for XDP
programs running in a cpumap.

This means we're basically returning the contents of the uninitialised
memory, which is bad. Fix this by zero-initialising the rxq data
structure before running the XDP program.

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

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

	Issue introduced in 5.9 with commit 9216477449f3 and fixed in 5.10.213 with commit 5f4e51abfbe6
	Issue introduced in 5.9 with commit 9216477449f3 and fixed in 5.15.152 with commit f0363af9619c
	Issue introduced in 5.9 with commit 9216477449f3 and fixed in 6.1.82 with commit 3420b3ff1ff4
	Issue introduced in 5.9 with commit 9216477449f3 and fixed in 6.6.22 with commit f562e4c4aab0
	Issue introduced in 5.9 with commit 9216477449f3 and fixed in 6.7.10 with commit eaa7cb836659
	Issue introduced in 5.9 with commit 9216477449f3 and fixed in 6.8 with commit 2487007aa3b9

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-27431
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:
	kernel/bpf/cpumap.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/5f4e51abfbe6eb444fa91906a5cd083044278297
	https://git.kernel.org/stable/c/f0363af9619c77730764f10360e36c6445c12f7b
	https://git.kernel.org/stable/c/3420b3ff1ff489c177ea1cb7bd9fbbc4e9a0be95
	https://git.kernel.org/stable/c/f562e4c4aab00986dde3093c4be919c3f2b85a4a
	https://git.kernel.org/stable/c/eaa7cb836659ced2d9f814ac32aa3ec193803ed6
	https://git.kernel.org/stable/c/2487007aa3b9fafbd2cb14068f49791ce1d7ede5