Skip to content

Commit 32abd01

Browse files
TE-N-ShengjiuWanggregkh
authored andcommitted
ASoC: fsl_easrc: Check the variable range in fsl_easrc_iec958_put_bits()
[ Upstream commit 00541b8 ] Add check of input value's range in fsl_easrc_iec958_put_bits(), otherwise the wrong value may be written from user space. Fixes: 955ac62 ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 8dd0ea9 commit 32abd01

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

sound/soc/fsl/fsl_easrc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ static int fsl_easrc_iec958_put_bits(struct snd_kcontrol *kcontrol,
5454
unsigned int regval = ucontrol->value.integer.value[0];
5555
int ret;
5656

57+
if (regval < EASRC_WIDTH_16_BIT || regval > EASRC_WIDTH_24_BIT)
58+
return -EINVAL;
59+
5760
ret = (easrc_priv->bps_iec958[mc->regbase] != regval);
5861

5962
easrc_priv->bps_iec958[mc->regbase] = regval;

0 commit comments

Comments
 (0)