Skip to content

Commit 6877f87

Browse files
brooniegregkh
authored andcommitted
ASoC: ops: Reject out of bounds values in snd_soc_put_xr_sx()
commit 4cf28e9 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 038f8b7 commit 6877f87

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
@@ -880,6 +880,8 @@ int snd_soc_put_xr_sx(struct snd_kcontrol *kcontrol,
880880
unsigned int i, regval, regmask;
881881
int err;
882882

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

0 commit comments

Comments
 (0)