summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxidongwang <wangxidong_97@163.com>2020-07-05 20:27:38 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-07-16 08:17:25 +0200
commitd917af2fa7a4700e44787c6e29ee6eeea00662e9 (patch)
treef520ccc0f0e91cc28acb4da8d3683e84b210428e
parent384260fd46b5e9b149ed7397106e958c1589b49b (diff)
ALSA: opl3: fix infoleak in opl3
commit ad155712bb1ea2151944cf06a0e08c315c70c1e3 upstream. The stack object “info” in snd_opl3_ioctl() has a leaking problem. It has 2 padding bytes which are not initialized and leaked via “copy_to_user”. Signed-off-by: xidongwang <wangxidong_97@163.com> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/1594006058-30362-1-git-send-email-wangxidong_97@163.com Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--sound/drivers/opl3/opl3_synth.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/drivers/opl3/opl3_synth.c b/sound/drivers/opl3/opl3_synth.c
index d522925fc5c0..1a87f8ea074b 100644
--- a/sound/drivers/opl3/opl3_synth.c
+++ b/sound/drivers/opl3/opl3_synth.c
@@ -105,6 +105,8 @@ int snd_opl3_ioctl(struct snd_hwdep * hw, struct file *file,
{
struct snd_dm_fm_info info;
+ memset(&info, 0, sizeof(info));
+
info.fm_mode = opl3->fm_mode;
info.rhythm = opl3->rhythm;
if (copy_to_user(argp, &info, sizeof(struct snd_dm_fm_info)))