]> exis.tech > repos - linux.git/commit
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)
commited8676d99fe6a11e9231d70bc4990ad289359765
tree80918086a63534bf0f16d74bd71570d72562ae90
parentc5827903973901278e51f1efed8bfd49d0228233
parent1d8aabb413b5638670dfd1162169edc0ba276a2e
ASoC: Validate written enum values in custom controls

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