linux/sound/pci
Takashi Iwai f495222e28 ALSA: hda - Register irq handler after the chip initialization
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 b61749a89f
("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>
2019-04-30 12:18:28 +02:00
..
ac97 ALSA: pci: Remove superfluous snd_info_register() calls 2019-02-06 18:11:54 +01:00
ali5451 ALSA: pci: Clean up with new procfs helpers 2019-02-06 18:11:56 +01:00
asihpi ALSA: pci: Clean up with new procfs helpers 2019-02-06 18:11:56 +01:00
au88x0 ALSA: au88xx: Add fall-through annotations 2018-10-12 09:31:34 +02:00
aw2 ALSA: pci: Drop superfluous PCM preallocation error checks 2019-02-06 10:29:09 +01:00
ca0106 Merge branch 'topic/memory-device-fixes-2' into for-next 2019-02-08 14:12:15 +01:00
cs46xx ALSA: cs46xx: Clean up proc file creations 2019-02-06 18:11:59 +01:00
cs5535audio ALSA: pci: Remove superfluous snd_pcm_suspend*() calls 2019-01-15 17:47:15 +01:00
ctxfi ALSA: pci: Remove superfluous snd_pcm_suspend*() calls 2019-01-15 17:47:15 +01:00
echoaudio ALSA: echoaudio: add a check for ioremap_nocache 2019-03-16 10:29:02 +01:00
emu10k1 ALSA: emu10k1: Drop superfluous id-uniquification behavior 2019-04-17 07:16:12 +02:00
hda ALSA: hda - Register irq handler after the chip initialization 2019-04-30 12:18:28 +02:00
ice1712 ALSA: pci: Clean up with new procfs helpers 2019-02-06 18:11:56 +01:00
korg1212 ALSA: pci: Clean up with new procfs helpers 2019-02-06 18:11:56 +01:00
lola ALSA: pci: Clean up with new procfs helpers 2019-02-06 18:11:56 +01:00
lx6464es Merge branch 'topic/memory-device-fixes-2' into for-next 2019-02-08 14:12:15 +01:00
mixart ALSA: pci: Clean up with new procfs helpers 2019-02-06 18:11:56 +01:00
nm256 ALSA: pci: Remove superfluous snd_pcm_suspend*() calls 2019-01-15 17:47:15 +01:00
oxygen ALSA: pci: Clean up with new procfs helpers 2019-02-06 18:11:56 +01:00
pcxhr ALSA: pci: Clean up with new procfs helpers 2019-02-06 18:11:56 +01:00
riptide ALSA: pci: Clean up with new procfs helpers 2019-02-06 18:11:56 +01:00
rme9652 Merge branch 'topic/memory-device-fixes-2' into for-next 2019-02-08 14:12:15 +01:00
trident ALSA: pci: Clean up with new procfs helpers 2019-02-06 18:11:56 +01:00
vx222 ALSA: vx222: Fix invalid endian conversions 2018-07-26 08:23:28 +02:00
ymfpci ALSA: pci: Clean up with new procfs helpers 2019-02-06 18:11:56 +01:00
ad1889.c Merge branch 'topic/memory-device-fixes-2' into for-next 2019-02-08 14:12:15 +01:00
ad1889.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ak4531_codec.c ALSA: pci: Clean up with new procfs helpers 2019-02-06 18:11:56 +01:00
als300.c ALSA: pci: Remove superfluous snd_pcm_suspend*() calls 2019-01-15 17:47:15 +01:00
als4000.c ALSA: pci: Remove superfluous snd_pcm_suspend*() calls 2019-01-15 17:47:15 +01:00
atiixp_modem.c ALSA: pci: Clean up with new procfs helpers 2019-02-06 18:11:56 +01:00
atiixp.c ALSA: pci: Clean up with new procfs helpers 2019-02-06 18:11:56 +01:00
azt3328.c ALSA: pci: Remove superfluous snd_pcm_suspend*() calls 2019-01-15 17:47:15 +01:00
azt3328.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bt87x.c ALSA: pci: Drop superfluous PCM preallocation error checks 2019-02-06 10:29:09 +01:00
cmipci.c ALSA: pci: Clean up with new procfs helpers 2019-02-06 18:11:56 +01:00
cs4281.c ALSA: pci: Clean up with new procfs helpers 2019-02-06 18:11:56 +01:00
cs5530.c ASoC: sb16: Simplify snd_sb16dsp_pcm() 2015-01-02 16:28:35 +01:00
ens1370.c ALSA: pci: Clean up with new procfs helpers 2019-02-06 18:11:56 +01:00
ens1371.c
es1938.c ALSA: pci: Remove superfluous snd_pcm_suspend*() calls 2019-01-15 17:47:15 +01:00
es1968.c ALSA: pci: Remove superfluous snd_pcm_suspend*() calls 2019-01-15 17:47:15 +01:00
fm801.c ALSA: pci: Remove superfluous snd_pcm_suspend*() calls 2019-01-15 17:47:15 +01:00
intel8x0.c ALSA: pci: Clean up with new procfs helpers 2019-02-06 18:11:56 +01:00
intel8x0m.c ALSA: pci: Clean up with new procfs helpers 2019-02-06 18:11:56 +01:00
Kconfig docs: Fix some broken references 2018-06-15 18:10:01 -03:00
maestro3.c ALSA: pci: Remove superfluous snd_pcm_suspend*() calls 2019-01-15 17:47:15 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rme32.c ALSA: pci: Clean up with new procfs helpers 2019-02-06 18:11:56 +01:00
rme96.c ALSA: pci: Clean up with new procfs helpers 2019-02-06 18:11:56 +01:00
sis7019.c ALSA: pci: Remove superfluous snd_pcm_suspend*() calls 2019-01-15 17:47:15 +01:00
sis7019.h
sonicvibes.c ALSA: pci: Clean up with new procfs helpers 2019-02-06 18:11:56 +01:00
via82xx_modem.c Merge branch 'topic/memory-device-fixes-2' into for-next 2019-02-08 14:12:15 +01:00
via82xx.c ALSA: pci: Clean up with new procfs helpers 2019-02-06 18:11:56 +01:00