Subject: CVE-2022-49005: ASoC: ops: Fix bounds check for _sx controls

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

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

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

ASoC: ops: Fix bounds check for _sx controls

For _sx controls the semantics of the max field is not the usual one, max
is the number of steps rather than the maximum value. This means that our
check in snd_soc_put_volsw_sx() needs to just check against the maximum
value.

The Linux kernel CVE team has assigned CVE-2022-49005 to this issue.

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

	Issue introduced in 4.9.300 with commit 9e5c40b5706d and fixed in 4.9.335 with commit e46adadf1924
	Issue introduced in 4.14.265 with commit 4977491e4b3a and fixed in 4.14.301 with commit 4a95a49f2630
	Issue introduced in 4.19.228 with commit 9a12fcbf3c62 and fixed in 4.19.268 with commit 46bab25cc023
	Issue introduced in 5.4.178 with commit c33402b056de and fixed in 5.4.226 with commit 73dce3c1d48c
	Issue introduced in 5.10.99 with commit 038f8b7caa74 and fixed in 5.10.158 with commit b50c96418972
	Issue introduced in 5.15.22 with commit e8e07c5e25a2 and fixed in 5.15.82 with commit 98b15c706644
	Issue introduced in 5.17 with commit 4f1e50d6a9cf and fixed in 6.0.12 with commit 325d94d16e31
	Issue introduced in 5.17 with commit 4f1e50d6a9cf and fixed in 6.1 with commit 698813ba8c58
	Issue introduced in 5.16.8 with commit ef6cd9eeb380

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-2022-49005
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/soc/soc-ops.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/e46adadf19248d59af3aa6bc52e09115bf479bf7
	https://git.kernel.org/stable/c/4a95a49f26308782b4056401989ecd7768fda8fa
	https://git.kernel.org/stable/c/46bab25cc0230df60d1c02b651cc5640a14b08df
	https://git.kernel.org/stable/c/73dce3c1d48c4662bdf3ccbde1492c2cb4bfd8ce
	https://git.kernel.org/stable/c/b50c9641897274c3faef5f95ac852f54b94be2e8
	https://git.kernel.org/stable/c/98b15c706644bebc19d2e77ccc360cc51444f6d0
	https://git.kernel.org/stable/c/325d94d16e3131b54bdf07356e4cd855e0d853fc
	https://git.kernel.org/stable/c/698813ba8c580efb356ace8dbf55f61dac6063a8