linux/sound/core/seq
Takashi Iwai cdd04c8ac5 ALSA: seq: Don't break snd_use_lock_sync() loop by timeout
commit 4e7655fd4f upstream.

The snd_use_lock_sync() (thus its implementation
snd_use_lock_sync_helper()) has the 5 seconds timeout to break out of
the sync loop.  It was introduced from the beginning, just to be
"safer", in terms of avoiding the stupid bugs.

However, as Ben Hutchings suggested, this timeout rather introduces a
potential leak or use-after-free that was apparently fixed by the
commit 2d7d54002e ("ALSA: seq: Fix race during FIFO resize"):
for example, snd_seq_fifo_event_in() -> snd_seq_event_dup() ->
copy_from_user() could block for a long time, and snd_use_lock_sync()
goes timeout and still leaves the cell at releasing the pool.

For fixing such a problem, we remove the break by the timeout while
still keeping the warning.

Suggested-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2017-07-18 18:40:35 +01:00
..
oss ALSA: seq: oss: Don't drain at closing a client 2016-03-24 10:01:02 +00:00
Kconfig ALSA: clean up the logic for building sequencer modules 2009-05-29 11:49:42 +02:00
Makefile ALSA: OSS sequencer should be initialized after snd_seq_system_client_init 2009-07-19 19:10:01 +02:00
seq.c device.h: cleanup users outside of linux/include (C files) 2012-03-11 14:27:37 -04:00
seq_clientmgr.c ALSA: seq: Fix racy cell insertions during snd_seq_pool_done() 2017-07-18 18:40:19 +01:00
seq_clientmgr.h [ALSA] sound/core/seq: move declarations of globally visible variables to proper headers 2008-01-31 17:29:35 +01:00
seq_compat.c ALSA: seq: Fix snd_seq_call_port_info_ioctl in compat mode 2016-02-02 19:09:59 +00:00
seq_device.c ALSA: seq: Use standard printk helpers 2014-02-14 08:14:18 +01:00
seq_dummy.c ALSA: seq-dummy: remove deadlock-causing events on close 2015-02-04 10:58:17 +00:00
seq_fifo.c ALSA: seq: Fix race during FIFO resize 2017-07-18 18:40:22 +01:00
seq_fifo.h [ALSA] Remove xxx_t typedefs: Sequencer 2006-01-03 12:17:52 +01:00
seq_info.c sound: Add export.h for THIS_MODULE/EXPORT_SYMBOL where needed 2011-10-31 19:31:22 -04:00
seq_info.h [ALSA] Optimize for config without PROC_FS (seq and oss parts) 2006-01-03 12:30:05 +01:00
seq_lock.c ALSA: seq: Don't break snd_use_lock_sync() loop by timeout 2017-07-18 18:40:35 +01:00
seq_lock.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
seq_memory.c ALSA: seq: Fix racy cell insertions during snd_seq_pool_done() 2017-07-18 18:40:19 +01:00
seq_memory.h ALSA: seq: Fix racy cell insertions during snd_seq_pool_done() 2017-07-18 18:40:19 +01:00
seq_midi.c ALSA: core: Fix format string mismatch in seq_midi.c 2014-04-28 12:18:47 +02:00
seq_midi_emul.c ALSA: seq: Use standard printk helpers 2014-02-14 08:14:18 +01:00
seq_midi_event.c sound: Add module.h to the previously silent sound users 2011-10-31 19:31:21 -04:00
seq_ports.c ALSA: seq: Fix double port list deletion 2016-03-04 10:26:41 +00:00
seq_ports.h [ALSA] Remove xxx_t typedefs: Sequencer 2006-01-03 12:17:52 +01:00
seq_prioq.c ALSA: seq: Drop superfluous error/debug messages after malloc failures 2016-03-04 10:26:40 +00:00
seq_prioq.h [ALSA] Remove xxx_t typedefs: Sequencer 2006-01-03 12:17:52 +01:00
seq_queue.c ALSA: seq: Fix race at creating a queue 2017-03-16 02:27:11 +00:00
seq_queue.h [ALSA] semaphore -> mutex (core part) 2006-03-22 10:24:50 +01:00
seq_system.c sound: Add export.h for THIS_MODULE/EXPORT_SYMBOL where needed 2011-10-31 19:31:22 -04:00
seq_system.h [ALSA] Remove xxx_t typedefs: Sequencer 2006-01-03 12:17:52 +01:00
seq_timer.c ALSA: seq: Drop superfluous error/debug messages after malloc failures 2016-03-04 10:26:40 +00:00
seq_timer.h [ALSA] sound/core/seq: move declarations of globally visible variables to proper headers 2008-01-31 17:29:35 +01:00
seq_virmidi.c ALSA: rawmidi: Make snd_rawmidi_transmit() race-free 2016-02-25 00:18:43 +00:00