linux/sound/isa/sb
Takashi Iwai 1c2b951915 ALSA: sb: Fix potential ABBA deadlock in CSP driver
SB16 CSP driver may hit potentially a typical ABBA deadlock in two
code paths:

 In snd_sb_csp_stop():
     spin_lock_irqsave(&p->chip->mixer_lock, flags);
     spin_lock(&p->chip->reg_lock);

 In snd_sb_csp_load():
     spin_lock_irqsave(&p->chip->reg_lock, flags);
     spin_lock(&p->chip->mixer_lock);

Also the similar pattern is seen in snd_sb_csp_start().

Although the practical impact is very small (those states aren't
triggered in the same running state and this happens only on a real
hardware, decades old ISA sound boards -- which must be very difficult
to find nowadays), it's a real scenario and has to be fixed.

This patch addresses those deadlocks by splitting the locks in
snd_sb_csp_start() and snd_sb_csp_stop() for avoiding the nested
locks.

Reported-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/7b0fcdaf-cd4f-4728-2eae-48c151a92e10@gmail.com
Link: https://lore.kernel.org/r/20210716132723.13216-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-07-17 09:55:10 +02:00
..
emu8000_callback.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
emu8000_local.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
emu8000_patch.c ALSA: sb: Fix assignment in if condition 2021-06-09 17:29:35 +02:00
emu8000_pcm.c ALSA: sb: Fix assignment in if condition 2021-06-09 17:29:35 +02:00
emu8000_synth.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
emu8000.c ALSA: sb: Minor coding style fixes 2021-06-09 17:29:37 +02:00
jazz16.c module: remove never implemented MODULE_SUPPORTED_DEVICE 2021-03-17 13:16:18 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sb8_main.c ALSA: sb: Fix assignment in if condition 2021-06-09 17:29:35 +02:00
sb8_midi.c ALSA: sb: Fix assignment in if condition 2021-06-09 17:29:35 +02:00
sb8.c ASoC: Fixes for v5.13 2021-06-24 10:02:45 +02:00
sb16_csp.c ALSA: sb: Fix potential ABBA deadlock in CSP driver 2021-07-17 09:55:10 +02:00
sb16_main.c ASoC: Fixes for v5.13 2021-06-24 10:02:45 +02:00
sb16.c ALSA: sb: Fix assignment in if condition 2021-06-09 17:29:35 +02:00
sb_common.c ALSA: sb: Fix assignment in if condition 2021-06-09 17:29:35 +02:00
sb_mixer.c ALSA: sb: Fix assignment in if condition 2021-06-09 17:29:35 +02:00
sbawe.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00