WSL2-Linux-Kernel/sound/oss
Alexey Khoroshilov bc26d4d06e sound/oss: fix deadlock in sequencer_ioctl(SNDCTL_SEQ_OUTOFBAND)
A deadlock can be initiated by userspace via ioctl(SNDCTL_SEQ_OUTOFBAND)
on /dev/sequencer with TMR_ECHO midi event.

In this case the control flow is:
sound_ioctl()
-> case SND_DEV_SEQ:
   case SND_DEV_SEQ2:
     sequencer_ioctl()
     -> case SNDCTL_SEQ_OUTOFBAND:
          spin_lock_irqsave(&lock,flags);
          play_event();
          -> case EV_TIMING:
               seq_timing_event()
               -> case TMR_ECHO:
                    seq_copy_to_input()
                    -> spin_lock_irqsave(&lock,flags);

It seems that spin_lock_irqsave() around play_event() is not necessary,
because the only other call location in seq_startplay() makes the call
without acquiring spinlock.

So, the patch just removes spinlocks around play_event().
By the way, it removes unreachable code in seq_timing_event(),
since (seq_mode == SEQ_2) case is handled in the beginning.

Compile tested only.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-04-18 09:05:55 +02:00
..
dmasound sound: dmasound_atari: Remove obsolete IRQ_TYPE_SLOW 2015-01-15 13:44:51 +01:00
.gitignore oss: remove maui_boot.h from .gitignore and dontdiff 2012-09-01 08:36:09 -07:00
CHANGELOG
Kconfig x86, platforms: Remove SGI Visual Workstation 2014-02-27 08:07:39 -08:00
Makefile x86, platforms: Remove SGI Visual Workstation 2014-02-27 08:07:39 -08:00
README.FIRST
ad1848.c sound/oss: Remove uncompilable DBG macro use 2014-04-04 18:20:10 +02:00
ad1848.h
ad1848_mixer.h
aedsp16.c
audio.c sound: Remove unnecessary semicolon 2012-10-06 16:47:53 +02:00
bin2hex.c
coproc.h
dev_table.c sound: Deparenthesize negative error returns 2015-03-24 11:41:37 +01:00
dev_table.h
dmabuf.c sound: oss: remove last sleep_on users 2014-01-14 16:12:07 +01:00
hex2hex.c
kahlua.c PCI: Remove DEFINE_PCI_DEVICE_TABLE macro use 2014-08-12 12:15:14 -06:00
midi_ctrl.h
midi_synth.c
midi_synth.h
midibuf.c sound: oss: midibuf: fix sleep_on races 2014-01-14 16:11:44 +01:00
mpu401.c sound: oss: mpu401.c: Cleaning up variable is set more than once 2014-06-25 14:32:03 +02:00
mpu401.h
msnd.c
msnd.h
msnd_classic.c
msnd_classic.h
msnd_pinnacle.c sound/oss: use current->state helpers 2015-01-15 08:32:27 +01:00
msnd_pinnacle.h
opl3.c sound/oss/opl3: remove some stray whitespace 2015-02-25 20:08:15 +01:00
opl3_hw.h
os.h Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
pas2.h sound: Move prototype declaration to header file oss/pas2.h from oss/pas2_card.c 2014-02-07 18:24:42 +01:00
pas2_card.c sound: Move prototype declaration to header file oss/pas2.h from oss/pas2_card.c 2014-02-07 18:24:42 +01:00
pas2_midi.c
pas2_mixer.c sound/oss: Remove uncompilable DBG macro use 2014-04-04 18:20:10 +02:00
pas2_pcm.c sound/oss: Remove uncompilable DBG macro use 2014-04-04 18:20:10 +02:00
pss.c sound: oss: Deletion of unnecessary checks before the function call "vfree" 2015-01-04 15:11:56 +01:00
sb.h
sb_audio.c sound: oss/sb_audio: cap value in sb201_audio_set_speed() 2012-11-18 10:24:49 +01:00
sb_card.c
sb_card.h
sb_common.c sound/oss: Remove uncompilable DBG macro use 2014-04-04 18:20:10 +02:00
sb_ess.c sound/sb_ess: white space cleanups 2015-02-25 20:08:21 +01:00
sb_ess.h
sb_midi.c sound/sb_midi: a couple indenting fixes 2015-02-25 20:08:27 +01:00
sb_mixer.c sound: Remove unnecessary semicolon 2012-10-06 16:47:53 +02:00
sb_mixer.h
sequencer.c sound/oss: fix deadlock in sequencer_ioctl(SNDCTL_SEQ_OUTOFBAND) 2015-04-18 09:05:55 +02:00
sleep.h sound: oss: remove last sleep_on users 2014-01-14 16:12:07 +01:00
sound_calls.h
sound_config.h sound/oss: Remove uncompilable DBG macro use 2014-04-04 18:20:10 +02:00
sound_firmware.h
sound_timer.c
soundcard.c sound/oss: Remove uncompilable DBG macro use 2014-04-04 18:20:10 +02:00
soundvers.h
swarm_cs4297a.c sound/oss: use current->state helpers 2015-01-15 08:32:27 +01:00
sys_timer.c sound: sys_timer: indent poll_def_tmr() correctly 2015-02-25 20:08:07 +01:00
trix.c sound: oss: Deletion of unnecessary checks before the function call "vfree" 2015-01-04 15:11:56 +01:00
tuning.h
uart401.c sound: oss: uart401: remove unneeded NULL check 2014-11-22 21:48:33 +01:00
uart6850.c sound: Remove unnecessary semicolon 2012-10-06 16:47:53 +02:00
ulaw.h
v_midi.c sound: Deparenthesize negative error returns 2015-03-24 11:41:37 +01:00
v_midi.h
vidc.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
vidc.h
vidc_fill.S
waveartist.c sound: oss: Remove typedefs wanc_info and wavnc_port_info 2014-08-06 16:42:40 +02:00
waveartist.h

README.FIRST

The modular sound driver patches were funded by Red Hat Software 
(www.redhat.com). The sound driver here is thus a modified version of 
Hannu's code. Please bear that in mind when considering the appropriate
forums for bug reporting. 

Alan Cox