ALSA: seq: Fix race at timer setup and close
authorTakashi Iwai <tiwai@suse.de>
Tue, 12 Jan 2016 14:36:27 +0000 (15:36 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 12 Jan 2016 16:50:41 +0000 (17:50 +0100)
commit3567eb6af614dac436c4b16a8d426f9faed639b3
tree4f2b3091ad80d3b49bd54b9951fa8743e2f6cfee
parent030e2c78d3a91dd0d27fef37e91950dde333eba1
ALSA: seq: Fix race at timer setup and close

ALSA sequencer code has an open race between the timer setup ioctl and
the close of the client.  This was triggered by syzkaller fuzzer, and
a use-after-free was caught there as a result.

This patch papers over it by adding a proper queue->timer_mutex lock
around the timer-related calls in the relevant code path.

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Tested-by: Dmitry Vyukov <dvyukov@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/seq/seq_queue.c