linux/sound/core/seq
Takashi Iwai 7f0973e973 ALSA: seq: Fix lockdep warnings due to double mutex locks
The port subscription code uses double mutex locks for source and
destination ports, and this may become racy once when wrongly set up.
It leads to lockdep warning splat, typically triggered by fuzzer like
syzkaller, although the actual deadlock hasn't been seen, so far.

This patch simplifies the handling by reducing to two single locks, so
that no lockdep warning will be trigger any longer.

By splitting to two actions, a still-in-progress element shall be
added in one list while handling another.  For ignoring this element,
a new check is added in deliver_to_subscribers().

Along with it, the code to add/remove the subscribers list element was
cleaned up and refactored.

BugLink: http://lkml.kernel.org/r/CACT4Y+aKQXV7xkBW9hpQbzaDO7LrUvohxWh-UwMxXjDy-yBD=A@mail.gmail.com
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Tested-by: Dmitry Vyukov <dvyukov@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-03 14:51:51 +01:00
..
oss ALSA: seq: Degrade the error message for too many opens 2016-01-25 11:52:23 +01:00
Kconfig
Makefile
seq.c
seq_clientmgr.c ALSA: seq: Fix lockdep warnings due to double mutex locks 2016-02-03 14:51:51 +01:00
seq_clientmgr.h
seq_compat.c ALSA: seq: Fix snd_seq_call_port_info_ioctl in compat mode 2016-01-18 14:39:13 +01:00
seq_device.c
seq_dummy.c
seq_fifo.c
seq_fifo.h
seq_info.c
seq_info.h
seq_lock.c
seq_lock.h
seq_memory.c
seq_memory.h
seq_midi.c
seq_midi_emul.c
seq_midi_event.c
seq_ports.c ALSA: seq: Fix lockdep warnings due to double mutex locks 2016-02-03 14:51:51 +01:00
seq_ports.h
seq_prioq.c
seq_prioq.h
seq_queue.c
seq_queue.h
seq_system.c
seq_system.h
seq_timer.c ALSA: seq: Fix yet another races among ALSA timer accesses 2016-02-01 12:23:29 +01:00
seq_timer.h
seq_virmidi.c ALSA: rawmidi: Make snd_rawmidi_transmit() race-free 2016-02-03 14:51:28 +01:00