android_kernel_oneplus_msm8998/sound/pci/emu10k1
Gustavo A. R. Silva e8ed54c8c3 ALSA: emu10k1: Fix potential Spectre v1 vulnerabilities
commit 5ae4f61f012a097df93de2285070ec8e34716d29 upstream.

ipcm->substream is indirectly controlled by user-space, hence leading to
a potential exploitation of the Spectre variant 1 vulnerability.

This issue was detected with the help of Smatch:

sound/pci/emu10k1/emufx.c:1031 snd_emu10k1_ipcm_poke() warn: potential spectre issue 'emu->fx8010.pcm' [r] (local cap)
sound/pci/emu10k1/emufx.c:1075 snd_emu10k1_ipcm_peek() warn: potential spectre issue 'emu->fx8010.pcm' [r] (local cap)

Fix this by sanitizing ipcm->substream before using it to index emu->fx8010.pcm

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

Cc: stable@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-13 10:05:29 +01:00
..
emu10k1.c ALSA: emu10k1: Fix card shortname string buffer overflow 2015-04-27 13:00:09 +02:00
emu10k1_callback.c ALSA: emu10k1: Emu10k2 32 bit DMA mode 2015-04-29 07:27:30 +02:00
emu10k1_main.c ALSA: emu10k1: Fix/cleanup ifdef CONFIG_PROC_FS 2015-05-29 07:56:42 +02:00
emu10k1_patch.c ALSA: emu10k1: Use standard printk helpers 2014-02-26 16:45:27 +01:00
emu10k1_synth.c ALSA: seq: Define driver object in each driver 2015-02-12 14:15:54 +01:00
emu10k1_synth_local.h
emu10k1x.c ALSA: emu10k1: Remove always NULL parameters 2015-01-02 16:32:45 +01:00
emufx.c ALSA: emu10k1: Fix potential Spectre v1 vulnerabilities 2019-01-13 10:05:29 +01:00
emumixer.c ALSA: emu10k1: rename Audigy Analog Capture Boost control 2015-07-08 09:40:44 +02:00
emumpu401.c ALSA: emu10k1: Use standard printk helpers 2014-02-26 16:45:27 +01:00
emupcm.c ALSA: emu10k1: add error handling for snd_ctl_add 2018-08-06 16:24:30 +02:00
emuproc.c ALSA: emu10k1: Fix/cleanup ifdef CONFIG_PROC_FS 2015-05-29 07:56:42 +02:00
io.c ALSA: emu10k1: Fix possible NULL dereference 2014-03-05 12:15:56 +01:00
irq.c ALSA: emu10k1: Use standard printk helpers 2014-02-26 16:45:27 +01:00
Makefile ALSA: emu10k1: Fix/cleanup ifdef CONFIG_PROC_FS 2015-05-29 07:56:42 +02:00
memory.c ALSA: emu10k1: Rate-limit error messages about page errors 2018-08-06 16:24:35 +02:00
p16v.c ALSA: emu10k1: Delete an unnecessary check before the function call "kfree" 2015-01-04 15:12:08 +01:00
p16v.h
p17v.h
timer.c
tina2.h
voice.c ALSA: emu10k1: Use standard printk helpers 2014-02-26 16:45:27 +01:00