Skip to content

Commit 4cf28e9

Browse files
committed
ASoC: ops: Reject out of bounds values in snd_soc_put_xr_sx()
We don't currently validate that the values being set are within the range we advertised to userspace as being valid, do so and reject any values that are out of range. Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220124153253.3548853-4-broonie@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 4f1e50d commit 4cf28e9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

sound/soc/soc-ops.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,8 @@ int snd_soc_put_xr_sx(struct snd_kcontrol *kcontrol,
879879
long val = ucontrol->value.integer.value[0];
880880
unsigned int i;
881881

882+
if (val < mc->min || val > mc->max)
883+
return -EINVAL;
882884
if (invert)
883885
val = max - val;
884886
val &= mask;

0 commit comments

Comments
 (0)