kernel_optimize_test/sound/core
Takashi Iwai bd7d88b087 ALSA: seq: Fix race of snd_seq_timer_open()
commit 83e197a8414c0ba545e7e3916ce05f836f349273 upstream.

The timer instance per queue is exclusive, and snd_seq_timer_open()
should have managed the concurrent accesses.  It looks as if it's
checking the already existing timer instance at the beginning, but
it's not right, because there is no protection, hence any later
concurrent call of snd_seq_timer_open() may override the timer
instance easily.  This may result in UAF, as the leftover timer
instance can keep running while the queue itself gets closed, as
spotted by syzkaller recently.

For avoiding the race, add a proper check at the assignment of
tmr->timeri again, and return -EBUSY if it's been already registered.

Reported-by: syzbot+ddc1260a83ed1cbf6fb5@syzkaller.appspotmail.com
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/000000000000dce34f05c42f110c@google.com
Link: https://lore.kernel.org/r/20210610152059.24633-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-06-16 12:01:38 +02:00
..
oss
seq ALSA: seq: Fix race of snd_seq_timer_open() 2021-06-16 12:01:38 +02:00
compress_offload.c
control_compat.c
control.c
ctljack.c
device.c
hrtimer.c
hwdep_compat.c
hwdep.c
info_oss.c
info.c
init.c ALSA: core: remove redundant spin_lock pair in snd_card_disconnect 2021-05-14 09:50:31 +02:00
isadma.c
jack.c
Kconfig
Makefile
memalloc.c
memory.c
misc.c
pcm_compat.c
pcm_dmaengine.c
pcm_drm_eld.c
pcm_iec958.c
pcm_lib.c
pcm_local.h
pcm_memory.c
pcm_misc.c
pcm_native.c ALSA: pcm: Don't call sync_stop if it hasn't been stopped 2021-03-04 11:37:19 +01:00
pcm_param_trace.h
pcm_timer.c
pcm_trace.h
pcm.c
rawmidi_compat.c
rawmidi.c
seq_device.c
sgbuf.c
sound_oss.c
sound.c
timer_compat.c
timer.c ALSA: timer: Fix master timer notification 2021-06-10 13:39:25 +02:00
vmaster.c