]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: seq: Fix race at closing in virmidi driver
authorTakashi Iwai <tiwai@suse.de>
Mon, 1 Feb 2016 11:06:42 +0000 (12:06 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 1 Feb 2016 11:21:46 +0000 (12:21 +0100)
commit667a3d9f6b51333405d1845b25868af1921a77af
tree61e6e56dc08107b25eafb2ada7e583f51378139d
parent8fbad5fc28b1719f8f968b853a45dc3f24cf4d74
ALSA: seq: Fix race at closing in virmidi driver

The virmidi driver has an open race at closing its assigned rawmidi
device, and this may lead to use-after-free in
snd_seq_deliver_single_event().

Plug the hole by properly protecting the linked list deletion and
calling in the right order in snd_virmidi_input_close().

BugLink: http://lkml.kernel.org/r/CACT4Y+Zd66+w12fNN85-425cVQT=K23kWbhnCEcMB8s3us-Frw@mail.gmail.com
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_virmidi.c