linux-stable/sound/core
Takashi Iwai dc7497795e ALSA: seq: Fix concurrent access to queue current tick/time
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>
2020-02-14 15:53:09 +01:00
..
oss ALSA: oss: More constifications 2020-01-05 16:14:58 +01:00
seq ALSA: seq: Fix concurrent access to queue current tick/time 2020-02-14 15:53:09 +01:00
compress_offload.c ALSA: core: Constify snd_device_ops definitions 2020-01-03 09:23:51 +01:00
control.c ALSA: control: potential uninitialized return value 2020-01-08 07:20:28 +01:00
control_compat.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
ctljack.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
device.c ALSA: core: Treat snd_device_ops as const 2020-01-03 09:23:50 +01:00
hrtimer.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
hwdep.c ALSA: core: Constify snd_device_ops definitions 2020-01-03 09:23:51 +01:00
hwdep_compat.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
info.c proc: convert everything to "struct proc_ops" 2020-02-04 03:05:26 +00:00
info_oss.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
init.c ALSA: pcm: Set per-card upper limit of PCM buffer allocations 2020-01-21 07:11:55 +01:00
isadma.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
jack.c ALSA: jack: More constification 2020-01-05 16:14:57 +01:00
Kconfig ALSA: control: Add verification for kctl accesses 2020-01-04 09:37:59 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
memalloc.c ALSA: memalloc: Add vmalloc buffer allocation support 2019-11-06 15:43:33 +01:00
memory.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
misc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
pcm.c ALSA: pcm: More constifications 2020-01-05 16:14:29 +01:00
pcm_compat.c ALSA: pcm: Fix sparse warnings wrt snd_pcm_state_t 2020-01-31 16:23:13 +01:00
pcm_dmaengine.c ASoC: pcm_dmaengine: Extract snd_dmaengine_pcm_refine_runtime_hwparams 2019-10-01 12:18:25 +01:00
pcm_drm_eld.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pcm_iec958.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pcm_lib.c ALSA: pcm: More constifications 2020-01-05 16:14:29 +01:00
pcm_local.h ALSA: pcm: Make snd_pcm_hw_constraints_init() and _complete() static 2020-01-16 17:29:33 +01:00
pcm_memory.c ALSA: pcm: Set per-card upper limit of PCM buffer allocations 2020-01-21 07:11:55 +01:00
pcm_misc.c ALSA: pcm: More constifications 2020-01-05 16:14:29 +01:00
pcm_native.c ALSA: pcm: Fix double hw_free calls 2020-02-13 16:30:22 +01:00
pcm_param_trace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pcm_timer.c ALSA: timer: Constify snd_timer_hardware definitions 2020-01-03 09:24:07 +01:00
pcm_trace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rawmidi.c ALSA: rawmidi: More constification 2020-01-05 16:14:58 +01:00
rawmidi_compat.c ALSA: Avoid using timespec for struct snd_rawmidi_status 2019-12-11 22:06:16 +01:00
seq_device.c ALSA: core: Constify snd_device_ops definitions 2020-01-03 09:23:51 +01:00
sgbuf.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
sound.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
sound_oss.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
timer.c ALSA: timer: fix nsec/sec initialization confusion 2020-01-12 09:08:22 +01:00
timer_compat.c ALSA: Avoid using timespec for struct snd_timer_tread 2019-12-13 11:25:57 +01:00
vmaster.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 372 2019-06-05 17:37:10 +02:00