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 ALSA: pcm: oss: Fix a few more UBSAN fixes 2020-12-30 11:54:07 +01:00
seq ALSA: seq: Fix race of snd_seq_timer_open() 2021-06-16 12:01:38 +02:00
compress_offload.c ALSA: compress_offload: remove redundant initialization 2020-09-03 09:26:27 +02:00
control_compat.c ALSA: compat_ioctl: avoid compat_alloc_user_space 2020-09-21 10:37:07 +02:00
control.c ALSA: ctl: fix error path at adding user-defined element set 2020-11-13 11:33:55 +01:00
ctljack.c
device.c
hrtimer.c ALSA: timer: Replace tasklet with work 2020-09-09 18:32:52 +02:00
hwdep_compat.c ALSA: compat_ioctl: avoid compat_alloc_user_space 2020-09-21 10:37:07 +02:00
hwdep.c ALSA: compat_ioctl: avoid compat_alloc_user_space 2020-09-21 10:37:07 +02:00
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 ALSA: core: memalloc: add page alignment for iram 2020-12-30 11:54:08 +01:00
memory.c
misc.c
pcm_compat.c
pcm_dmaengine.c ALSA: fix kernel-doc markups 2020-10-26 15:26:31 +01:00
pcm_drm_eld.c
pcm_iec958.c
pcm_lib.c ALSA: fix kernel-doc markups 2020-10-26 15:26:31 +01:00
pcm_local.h ALSA: pcm: Call sync_stop at disconnection 2021-03-04 11:37:19 +01:00
pcm_memory.c ALSA: core: pcm_memory: dereference pointer after NULL checks 2020-09-03 09:24:58 +02:00
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 ALSA: pcm: Call sync_stop at disconnection 2021-03-04 11:37:19 +01:00
rawmidi_compat.c
rawmidi.c ALSA: rawmidi: Access runtime->avail always in spinlock 2021-01-06 14:56:52 +01:00
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 ALSA: Replace the word "slave" in vmaster API 2020-07-20 10:10:47 +02:00