Commit 3ddd703a authored by xidongwang's avatar xidongwang Committed by Khalid Elmously

ALSA: opl3: fix infoleak in opl3

BugLink: https://bugs.launchpad.net/bugs/1888690

commit ad155712 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: default avatarxidongwang <wangxidong_97@163.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/1594006058-30362-1-git-send-email-wangxidong_97@163.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent d27bfad3
...@@ -104,6 +104,8 @@ int snd_opl3_ioctl(struct snd_hwdep * hw, struct file *file, ...@@ -104,6 +104,8 @@ int snd_opl3_ioctl(struct snd_hwdep * hw, struct file *file,
{ {
struct snd_dm_fm_info info; struct snd_dm_fm_info info;
memset(&info, 0, sizeof(info));
info.fm_mode = opl3->fm_mode; info.fm_mode = opl3->fm_mode;
info.rhythm = opl3->rhythm; info.rhythm = opl3->rhythm;
if (copy_to_user(argp, &info, sizeof(struct snd_dm_fm_info))) if (copy_to_user(argp, &info, sizeof(struct snd_dm_fm_info)))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment