From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:41292 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932193AbeAKHSF (ORCPT ); Thu, 11 Jan 2018 02:18:05 -0500 Subject: Patch "ALSA: pcm: Abort properly at pending signal in OSS read/write loops" has been added to the 4.14-stable tree To: tiwai@suse.de, gregkh@linuxfoundation.org Cc: , From: Date: Thu, 11 Jan 2018 08:18:01 +0100 Message-ID: <151565508130169@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled ALSA: pcm: Abort properly at pending signal in OSS read/write loops to the 4.14-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: alsa-pcm-abort-properly-at-pending-signal-in-oss-read-write-loops.patch and it can be found in the queue-4.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 29159a4ed7044c52e3e2cf1a9fb55cec4745c60b Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 8 Jan 2018 13:58:31 +0100 Subject: ALSA: pcm: Abort properly at pending signal in OSS read/write loops From: Takashi Iwai 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 Signed-off-by: Greg Kroah-Hartman --- sound/core/oss/pcm_oss.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c @@ -1381,6 +1381,10 @@ static ssize_t snd_pcm_oss_write1(struct tmp != runtime->oss.period_bytes) break; } + if (signal_pending(current)) { + tmp = -ERESTARTSYS; + goto err; + } } mutex_unlock(&runtime->oss.params_lock); return xfer; @@ -1466,6 +1470,10 @@ static ssize_t snd_pcm_oss_read1(struct bytes -= tmp; xfer += tmp; } + if (signal_pending(current)) { + tmp = -ERESTARTSYS; + goto err; + } } mutex_unlock(&runtime->oss.params_lock); return xfer; Patches currently in stable-queue which might be from tiwai@suse.de are queue-4.14/alsa-pcm-remove-incorrect-snd_bug_on-usages.patch queue-4.14/alsa-aloop-fix-inconsistent-format-due-to-incomplete-rule.patch queue-4.14/alsa-pcm-workaround-for-weird-pulseaudio-behavior-on-rewind-error.patch queue-4.14/alsa-pcm-add-missing-error-checks-in-oss-emulation-plugin-builder.patch queue-4.14/alsa-pcm-abort-properly-at-pending-signal-in-oss-read-write-loops.patch queue-4.14/alsa-pcm-allow-aborting-mutex-lock-at-oss-read-write-loops.patch queue-4.14/alsa-aloop-fix-racy-hw-constraints-adjustment.patch queue-4.14/alsa-aloop-release-cable-upon-open-error-path.patch