]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ASoC: Validate written enum values in custom controls
authorMark Brown <broonie@kernel.org>
Thu, 11 Jun 2026 19:44:46 +0000 (20:44 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 11 Jun 2026 19:44:46 +0000 (20:44 +0100)
HyeongJun An <sammiee5311@gmail.com> says:

Some custom ASoC kcontrol put() handlers use the written enum value
(ucontrol->value.enumerated.item[0]) to index a table or compute a bit
shift before validating that the value is within the control's enum range.
An out-of-range value written from userspace is therefore consumed before
it is rejected.

This is the same class addressed for the Meson codecs in commit
1e001206804b ("ASoC: meson: g12a-tohdmitx: Validate written enum values")
and commit 3150b70e944e ("ASoC: meson: g12a-toacodec: Validate written
enum values").

Fix four more instances:
 - hdac_hdmi reads e->texts[item] before validation.
 - aiu converts the item before validating it.
 - fsl_audmix converts the item and uses the result before validation.
 - tegra210_ahub reads e->values[item] before validation.

Link: https://patch.msgid.link/20260609124317.38046-1-sammiee5311@gmail.com

Trivial merge