OrangePi_CM5/sound/core/seq
Takashi Iwai 5a2972600a ALSA: seq: Fix concurrent access to queue current tick/time
commit dc7497795e upstream.

snd_seq_check_queue() passes the current tick and time of the given
queue as a pointer to snd_seq_prioq_cell_out(), but those might be
updated concurrently by the seq timer update.

Fix it by retrieving the current tick and time via the proper helper
functions at first, and pass those values to snd_seq_prioq_cell_out()
later in the loops.

snd_seq_timer_get_cur_time() takes a new argument and adjusts with the
current system time only when it's requested so; this update isn't
needed for snd_seq_check_queue(), as it's called either from the
interrupt handler or right after queuing.

Also, snd_seq_timer_get_cur_tick() is changed to read the value in the
spinlock for the concurrency, too.

Reported-by: syzbot+fd5e0eaa1a32999173b2@syzkaller.appspotmail.com
Link: https://lore.kernel.org/r/20200214111316.26939-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-28 16:39:00 +01:00
..
oss ALSA: seq: fix incorrect order of dest_client/dest_ports arguments 2019-07-10 09:53:42 +02:00
Kconfig
…
Makefile
…
seq.c
…
seq_clientmgr.c ALSA: seq: Fix concurrent access to queue current tick/time 2020-02-28 16:39:00 +01:00
seq_clientmgr.h
…
seq_compat.c
…
seq_dummy.c
…
seq_fifo.c ALSA: seq: Fix potential concurrent access to the deleted pool 2019-09-06 10:22:09 +02:00
seq_fifo.h ALSA: seq: Fix potential concurrent access to the deleted pool 2019-09-06 10:22:09 +02:00
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 ALSA: seq: Mark expected switch fall-through 2018-08-04 08:30:36 +02:00
seq_midi_event.c
…
seq_ports.c ALSA: seq: Fix race of get-subscription call vs port-delete ioctls 2019-06-19 08:18:01 +02:00
seq_ports.h ALSA: seq: Fix race of get-subscription call vs port-delete ioctls 2019-06-19 08:18:01 +02:00
seq_prioq.c
…
seq_prioq.h
…
seq_queue.c ALSA: seq: Fix concurrent access to queue current tick/time 2020-02-28 16:39:00 +01:00
seq_queue.h ALSA: seq: Drop unused 64bit division macros 2018-08-01 22:54:37 +02:00
seq_system.c ALSA: seq: Do error checks at creating system ports 2019-11-20 18:45:27 +01:00
seq_system.h
…
seq_timer.c ALSA: seq: Fix concurrent access to queue current tick/time 2020-02-28 16:39:00 +01:00
seq_timer.h ALSA: seq: Fix concurrent access to queue current tick/time 2020-02-28 16:39:00 +01:00
seq_virmidi.c ALSA: seq: virmidi: Fix discarding the unsubscribed output 2018-08-14 22:50:52 +02:00