]> git.karo-electronics.de Git - linux-beck.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Feb 2017 23:25:41 +0000 (15:25 -0800)
commit5024b2fb8e49091044e450a0548979bb711588d6
treeef24bbe8e0fa498264157ade3c800860a609ef56
parent2e0feb524caccbe9c061997f63b97e4f695e816e
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/core/seq/seq_queue.c