• Takashi Iwai's avatar
    ALSA: virmidi: Fix too long output trigger loop · 50e9ffb1
    Takashi Iwai authored
    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: default avatarDae R. Jeong <threeearcat@gmail.com>
    Reported-by: syzbot+619d9f40141d826b097e@syzkaller.appspotmail.com
    Cc: <stable@vger.kernel.org>
    Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    50e9ffb1
seq_virmidi.c 14.5 KB