]> git.baikalelectronics.ru Git - 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)
committerTakashi Iwai <tiwai@suse.de>
Fri, 24 Mar 2017 16:11:00 +0000 (17:11 +0100)
commita15f95ffaefa6e20b28ef5c99960d4595f6284de
tree69d989dd2752c6a076e74d3d2431aaf2129ebe53
parentec8774f86276e25caabc1917fd547ac19bb3d3a6
ALSA: seq: Fix race during FIFO resize

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>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/seq/seq_fifo.c