Subject: CVE-2024-42097: ALSA: emux: improve patch ioctl data validation

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

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

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

ALSA: emux: improve patch ioctl data validation

In load_data(), make the validation of and skipping over the main info
block match that in load_guspatch().

In load_guspatch(), add checking that the specified patch length matches
the actually supplied data, like load_data() already did.

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

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

	Fixed in 4.19.317 with commit 40d7def67841
	Fixed in 5.4.279 with commit 79d9a000f022
	Fixed in 5.10.221 with commit d23982ea9aa4
	Fixed in 5.15.162 with commit 7a18293fd8d8
	Fixed in 6.1.97 with commit d0ff2443fcbb
	Fixed in 6.6.37 with commit d8f5ce3cb9ad
	Fixed in 6.9.8 with commit 87039b83fb7b
	Fixed in 6.10 with commit 89b32ccb12ae

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-42097
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:
	sound/synth/emux/soundfont.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/40d7def67841343c10f8642a41031fecbb248bab
	https://git.kernel.org/stable/c/79d9a000f0220cdaba1682d2a23c0d0c61d620a3
	https://git.kernel.org/stable/c/d23982ea9aa438f35a8c8a6305943e98a8db90f6
	https://git.kernel.org/stable/c/7a18293fd8d8519c2f7a03753bc1583b18e3db69
	https://git.kernel.org/stable/c/d0ff2443fcbb472206d45a5d2a90cc694065804e
	https://git.kernel.org/stable/c/d8f5ce3cb9adf0c72e2ad6089aba02d7a32469c2
	https://git.kernel.org/stable/c/87039b83fb7bfd7d0e0499aaa8e6c049906b4d14
	https://git.kernel.org/stable/c/89b32ccb12ae67e630c6453d778ec30a592a212f