]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ALSA: seq: Fix race at creating a queue
authorTakashi Iwai <tiwai@suse.de>
Wed, 8 Feb 2017 11:35:39 +0000 (12:35 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 16 Mar 2017 02:27:11 +0000 (02:27 +0000)
commitfbe20cd70e1b964cc4959ba28765e06b5b25d038
tree8e5f16d69eae81c26ee3f0fe1807a92576b0fc44
parent0c68b1b69d50a97df1947684637c7a60f15f08e8
ALSA: seq: Fix race at creating a queue

commit 4842e98f26dd80be3623c4714a244ba52ea096a8 upstream.

When a sequencer queue is created in snd_seq_queue_alloc(),it adds the
new queue element to the public list before referencing it.  Thus the
queue might be deleted before the call of snd_seq_queue_use(), and it
results in the use-after-free error, as spotted by syzkaller.

The fix is to reference the queue object at the right time.

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
sound/core/seq/seq_queue.c