]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ALSA: seq: Fix racy access for queue timer in proc read
authorTakashi Iwai <tiwai@suse.de>
Wed, 15 Jan 2020 20:37:33 +0000 (21:37 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 28 Apr 2020 18:03:27 +0000 (19:03 +0100)
commit664629181917a295dd357fa0c2aa85527f0694af
treebd0296ccfc377c47660176595b5ab8b1aed8df42
parent142a3566ff01658cdd00e190e3412901633cb680
ALSA: seq: Fix racy access for queue timer in proc read

commit 60adcfde92fa40fcb2dbf7cc52f9b096e0cd109a upstream.

snd_seq_info_timer_read() reads the information of the timer assigned
for each queue, but it's done in a racy way which may lead to UAF as
spotted by syzkaller.

This patch applies the missing q->timer_mutex lock while accessing the
timer object as well as a slight code change to adapt the standard
coding style.

Reported-by: syzbot+2b2ef983f973e5c40943@syzkaller.appspotmail.com
Link: https://lore.kernel.org/r/20200115203733.26530-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
sound/core/seq/seq_timer.c