ALSA: seq: Don't handle loop timeout at snd_seq_pool_done()
commit37fe8bb8a94b139dfae8d52c3e3490a78ae91b06
authorTakashi Iwai <tiwai@suse.de>
Mon, 6 Feb 2017 14:09:48 +0000 (6 15:09 +0100)
committerSasha Levin <alexander.levin@verizon.com>
Mon, 6 Mar 2017 22:31:13 +0000 (6 17:31 -0500)
tree8a2d3544c4816547fcbb20dcd5bb0e7b40db29c0
parent762cd3a51cfcf231b7ff559af547c9dd82e8648e
ALSA: seq: Don't handle loop timeout at snd_seq_pool_done()

[ Upstream commit 37a7ea4a9b81f6a864c10a7cb0b96458df5310a3 ]

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>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
sound/core/seq/seq_memory.c