ALSA: seq: Don't handle loop timeout at snd_seq_pool_done()
authorTakashi Iwai <tiwai@suse.de>
Mon, 6 Feb 2017 14:09:48 +0000 (15:09 +0100)
committerDanny Wood <danwood76@gmail.com>
Tue, 29 Jan 2019 13:16:51 +0000 (13:16 +0000)
commitf17eddf268146828b4f25afad87ce606d96ab132
tree961bd2f4622e702ca3f972459f172bfe6ac887c2
parent1cdc3d06d918b601a8a7357e175749a18a168d09
ALSA: seq: Don't handle loop timeout at snd_seq_pool_done()

commit 37a7ea4a9b81f6a864c10a7cb0b96458df5310a3 upstream.

snd_seq_pool_done() syncs with closing of all opened threads, but it
aborts the wait loop with a timeout, and proceeds to the release
resource even if not all threads have been closed.  The timeout was 5
seconds, and if you run a crazy stuff, it can exceed easily, and may
result in the access of the invalid memory address -- this is what
syzkaller detected in a bug report.

As a fix, let the code graduate from naiveness, simply remove the loop
timeout.

BugLink: http://lkml.kernel.org/r/CACT4Y+YdhDV2H5LLzDTJDVF-qiYHUHhtRaW4rbb4gUhTCQB81w@mail.gmail.com
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Willy Tarreau <w@1wt.eu>
sound/core/seq/seq_memory.c