Commit 88294471 authored by Dan Carpenter's avatar Dan Carpenter Committed by Wenyu Huang
Browse files

ASoC: max9759: fix underflow in speaker_gain_control_put()

stable inclusion
from stable-v4.19.316
commit a0f49d12547d45ea8b0f356a96632dd503941c1e
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IA72GH
CVE: CVE-2022-48717

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-4.19.y&id=a0f49d12547d45ea8b0f356a96632dd503941c1e



--------------------------------

commit 4c907bcd upstream.

Check for negative values of "priv->gain" to prevent an out of bounds
access.  The concern is that these might come from the user via:
  -> snd_ctl_elem_write_user()
    -> snd_ctl_elem_write()
      -> kctl->put()

Fixes: fa8d9151 ("ASoC: max9759: Add Amplifier Driver")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20220119123101.GA9509@kili


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarWenyu Huang <huangwenyu5@huawei.com>
parent b380339b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment