linux_dsm_epyc7002/sound/synth/emux
Gustavo A. R. Silva 4aea96f423 ALSA: emux: Fix potential Spectre v1 vulnerabilities
info.mode and info.port are indirectly controlled by user-space,
hence leading to a potential exploitation of the Spectre variant 1
vulnerability.

These issues were detected with the help of Smatch:

sound/synth/emux/emux_hwdep.c:72 snd_emux_hwdep_misc_mode() warn: potential spectre issue 'emu->portptrs[i]->ctrls' [w] (local cap)
sound/synth/emux/emux_hwdep.c:75 snd_emux_hwdep_misc_mode() warn: potential spectre issue 'emu->portptrs' [w] (local cap)
sound/synth/emux/emux_hwdep.c:75 snd_emux_hwdep_misc_mode() warn: potential spectre issue 'emu->portptrs[info.port]->ctrls' [w] (local cap)

Fix this by sanitizing both info.mode and info.port before using them
to index emu->portptrs[i]->ctrls, emu->portptrs[info.port]->ctrls and
emu->portptrs.

Notice that given that speculation windows are large, the policy is
to kill the speculation on the first load and not worry if it can be
completed with a dependent load/store [1].

[1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Cc: stable@vger.kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-12-13 09:13:04 +01:00
..
emux_effect.c ALSA: seq: Allow the tristate build of OSS emulation 2017-06-09 22:09:45 +02:00
emux_hwdep.c ALSA: emux: Fix potential Spectre v1 vulnerabilities 2018-12-13 09:13:04 +01:00
emux_nrpn.c ALSA: emux: constify nrpn_conv_table structures 2016-01-06 10:19:49 +01:00
emux_oss.c ALSA: emux: remove unused redundant variable p2 2017-10-16 13:37:38 +02:00
emux_proc.c ALSA: emux: Fix/cleanup old ifdef CONFIG_PROC_FS 2015-05-29 07:58:11 +02:00
emux_seq.c ALSA: emux: Delete two error messages for a failed memory allocation in snd_emux_create_port() 2017-08-10 17:55:13 +02:00
emux_synth.c ALSA: emux: Convert timers to use timer_setup() 2017-10-24 21:01:33 +02:00
emux_voice.h ALSA: emux: Convert timers to use timer_setup() 2017-10-24 21:01:33 +02:00
emux.c ALSA: synth: Remove empty init and exit 2018-08-03 16:11:53 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
soundfont.c ALSA: Include linux/uaccess.h and linux/bitopts.h instead of asm/* 2015-01-28 17:25:07 +01:00