ALSA: pcm: Abort properly at pending signal in OSS read/write loops
authorTakashi Iwai <tiwai@suse.de>
Mon, 8 Jan 2018 12:58:31 +0000 (13:58 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 3 Mar 2018 15:50:56 +0000 (15:50 +0000)
commit60c444b1c6af1cc3e0b34da57a5dd2d96d2d6da2
tree6df8dbbccd3cbbe4b3f14ad72ddac21ff077ed31
parentf5df4e3a6342a9686a2d08820394b2aad3eed737
ALSA: pcm: Abort properly at pending signal in OSS read/write loops

commit 29159a4ed7044c52e3e2cf1a9fb55cec4745c60b upstream.

The loops for read and write in PCM OSS emulation have no proper check
of pending signals, and they keep processing even after user tries to
break.  This results in a very long delay, often seen as RCU stall
when a huge unprocessed bytes remain queued.  The bug could be easily
triggered by syzkaller.

As a simple workaround, this patch adds the proper check of pending
signals and aborts the loop appropriately.

Reported-by: syzbot+993cb4cfcbbff3947c21@syzkaller.appspotmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
sound/core/oss/pcm_oss.c