Subject: CVE-2024-38562: wifi: nl80211: Avoid address calculations via out of bounds array indexing

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

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

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

wifi: nl80211: Avoid address calculations via out of bounds array indexing

Before request->channels[] can be used, request->n_channels must be set.
Additionally, address calculations for memory after the "channels" array
need to be calculated from the allocation base ("request") rather than
via the first "out of bounds" index of "channels", otherwise run-time
bounds checking will throw a warning.

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

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

	Issue introduced in 6.6 with commit e3eac9f32ec0 and fixed in 6.6.33 with commit ed74398642fc
	Issue introduced in 6.6 with commit e3eac9f32ec0 and fixed in 6.8.12 with commit 4e2a5566462b
	Issue introduced in 6.6 with commit e3eac9f32ec0 and fixed in 6.9.3 with commit 8fa4d56564ee
	Issue introduced in 6.6 with commit e3eac9f32ec0 and fixed in 6.10 with commit 838c7b8f1f27

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-38562
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:
	net/wireless/nl80211.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/ed74398642fcb19f6ff385c35a7d512c6663e17b
	https://git.kernel.org/stable/c/4e2a5566462b53db7d4c4722da86eedf0b8f546c
	https://git.kernel.org/stable/c/8fa4d56564ee7cc2ee348258d88efe191d70dd7f
	https://git.kernel.org/stable/c/838c7b8f1f278404d9d684c34a8cb26dc41aaaa1