android_kernel_oneplus_msm8998/sound/pci
Takashi Iwai 750c55e69c ALSA: hda - Register irq handler after the chip initialization
[ Upstream commit f495222e28275222ab6fd93813bd3d462e16d340 ]

Currently the IRQ handler in HD-audio controller driver is registered
before the chip initialization.  That is, we have some window opened
between the azx_acquire_irq() call and the CORB/RIRB setup.  If an
interrupt is triggered in this small window, the IRQ handler may
access to the uninitialized RIRB buffer, which leads to a NULL
dereference Oops.

This is usually no big problem since most of Intel chips do register
the IRQ via MSI, and we've already fixed the order of the IRQ
enablement and the CORB/RIRB setup in the former commit b61749a89f82
("sound: enable interrupt after dma buffer initialization"), hence the
IRQ won't be triggered in that room.  However, some platforms use a
shared IRQ, and this may allow the IRQ trigger by another source.

Another possibility is the kdump environment: a stale interrupt might
be present in there, the IRQ handler can be falsely triggered as well.

For covering this small race, let's move the azx_acquire_irq() call
after hda_intel_init_chip() call.  Although this is a bit radical
change, it can cover more widely than checking the CORB/RIRB setup
locally in the callee side.

Reported-by: Liwei Song <liwei.song@windriver.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-06-22 08:18:20 +02:00
..
ac97 ALSA: ac97: Fix incorrect bit shift at AC97-SPSA control write 2018-12-13 09:21:27 +01:00
ali5451
asihpi ALSA: asihpi: Hardening for potential Spectre v1 2018-05-02 07:53:41 -07:00
au88x0 ALSA: au88x0: avoid theoretical uninitialized access 2017-10-08 10:14:20 +02:00
aw2
ca0106 ALSA: ca0106: Disable IZD on SB0570 DAC to fix audio pops 2018-11-21 09:27:30 +01:00
cs46xx ALSA: cs46xx: Potential NULL dereference in probe 2019-01-13 10:05:32 +01:00
cs5535audio ALSA: cs5535audio: Fix invalid endian conversion 2018-08-22 07:48:36 +02:00
ctxfi ALSA: ctxfi: Fix the incorrect check of dma_set_mask() call 2017-03-30 09:35:15 +02:00
echoaudio ALSA: echoaudio: add a check for ioremap_nocache 2019-04-27 09:33:56 +02:00
emu10k1 ALSA: emu10k1: Fix potential Spectre v1 vulnerabilities 2019-01-13 10:05:29 +01:00
hda ALSA: hda - Register irq handler after the chip initialization 2019-06-22 08:18:20 +02:00
ice1712
korg1212
lola
lx6464es
mixart
nm256
oxygen
pcxhr
riptide
rme9652 ALSA: rme9652: Fix potential Spectre v1 vulnerability 2019-01-13 10:05:29 +01:00
trident ALSA: trident: Suppress gcc string warning 2018-12-13 09:21:30 +01:00
vx222 ALSA: vx222: Fix invalid endian conversions 2018-08-22 07:48:36 +02:00
ymfpci
ad1889.c
ad1889.h
ak4531_codec.c
als300.c
als4000.c
atiixp.c
atiixp_modem.c
azt3328.c
azt3328.h
bt87x.c
cmipci.c
cs4281.c
cs5530.c
ens1370.c
ens1371.c
es1938.c
es1968.c
fm801.c ALSA: fm801: add error handling for snd_ctl_add 2018-08-06 16:24:30 +02:00
intel8x0.c
intel8x0m.c
Kconfig
maestro3.c
Makefile
rme32.c
rme96.c
sis7019.c
sis7019.h
sonicvibes.c
via82xx.c
via82xx_modem.c