mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 11:21:26 -04:00
ASoC: fsl_easrc: Check the variable range in fsl_easrc_iec958_put_bits()
Add check of input value's range in fsl_easrc_iec958_put_bits(),
otherwise the wrong value may be written from user space.
Fixes: 955ac62405 ("ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://patch.msgid.link/20260401094226.2900532-10-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
committed by
Mark Brown
parent
64a496ba97
commit
00541b86fb
@@ -54,6 +54,9 @@ static int fsl_easrc_iec958_put_bits(struct snd_kcontrol *kcontrol,
|
||||
unsigned int regval = ucontrol->value.integer.value[0];
|
||||
int ret;
|
||||
|
||||
if (regval < EASRC_WIDTH_16_BIT || regval > EASRC_WIDTH_24_BIT)
|
||||
return -EINVAL;
|
||||
|
||||
ret = (easrc_priv->bps_iec958[mc->regbase] != regval);
|
||||
|
||||
easrc_priv->bps_iec958[mc->regbase] = regval;
|
||||
|
||||
Reference in New Issue
Block a user