]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: virmidi: Fix too long output trigger loop
authorTakashi Iwai <tiwai@suse.de>
Thu, 26 Jul 2018 12:27:59 +0000 (14:27 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 27 Jul 2018 06:59:25 +0000 (08:59 +0200)
commit506f064ea46a0dff84271c10ec37e4dfe024b54a
tree08e78c81cff8ff31ef01923c4ea5436732c4eed2
parente1edcbf28f1cddb43f08f806e03d8cd4face56f6
ALSA: virmidi: Fix too long output trigger loop

The virmidi output trigger tries to parse the all available bytes and
process sequencer events as much as possible.  In a normal situation,
this is supposed to be relatively short, but a program may give a huge
buffer and it'll take a long time in a single spin lock, which may
eventually lead to a soft lockup.

This patch simply adds a workaround, a cond_resched() call in the loop
if applicable.  A better solution would be to move the event processor
into a work, but let's put a duct-tape quickly at first.

Reported-and-tested-by: Dae R. Jeong <threeearcat@gmail.com>
Reported-by: syzbot+619d9f40141d826b097e@syzkaller.appspotmail.com
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/seq/seq_virmidi.c