]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
ALSA: seq: Fix race during FIFO resize
authorTakashi Iwai <tiwai@suse.de>
Fri, 24 Mar 2017 16:07:57 +0000 (17:07 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 21 Apr 2017 08:11:26 +0000 (10:11 +0200)
commit5516375433831da8c04d056b605975ab1e530ff7
treebbd7b36d186818e7ff61baf28d1bbbfc8e8a148d
parent9cc7f1ba35de83a1ff8275133a8b2db00b3b771a
ALSA: seq: Fix race during FIFO resize

BugLink: http://bugs.launchpad.net/bugs/1681875
commit 2d7d54002e396c180db0c800c1046f0a3c471597 upstream.

When a new event is queued while processing to resize the FIFO in
snd_seq_fifo_clear(), it may lead to a use-after-free, as the old pool
that is being queued gets removed.  For avoiding this race, we need to
close the pool to be deleted and sync its usage before actually
deleting it.

The issue was spotted by syzkaller.

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
sound/core/seq/seq_fifo.c