From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:41648 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932102AbeAKHTE (ORCPT ); Thu, 11 Jan 2018 02:19:04 -0500 Subject: Patch "ALSA: pcm: Add missing error checks in OSS emulation plugin builder" has been added to the 4.9-stable tree To: tiwai@suse.de, gregkh@linuxfoundation.org Cc: , From: Date: Thu, 11 Jan 2018 08:18:47 +0100 Message-ID: <15156551275366@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: Add missing error checks in OSS emulation plugin builder to the 4.9-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-add-missing-error-checks-in-oss-emulation-plugin-builder.patch and it can be found in the queue-4.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 6708913750344a900f2e73bfe4a4d6dbbce4fe8d Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 4 Jan 2018 16:39:27 +0100 Subject: ALSA: pcm: Add missing error checks in OSS emulation plugin builder From: Takashi Iwai commit 6708913750344a900f2e73bfe4a4d6dbbce4fe8d upstream. In the OSS emulation plugin builder where the frame size is parsed in the plugin chain, some places miss the possible errors returned from the plugin src_ or dst_frames callback. This patch papers over such places. Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/core/oss/pcm_plugin.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) --- a/sound/core/oss/pcm_plugin.c +++ b/sound/core/oss/pcm_plugin.c @@ -591,18 +591,26 @@ snd_pcm_sframes_t snd_pcm_plug_write_tra snd_pcm_sframes_t frames = size; plugin = snd_pcm_plug_first(plug); - while (plugin && frames > 0) { + while (plugin) { + if (frames <= 0) + return frames; if ((next = plugin->next) != NULL) { snd_pcm_sframes_t frames1 = frames; - if (plugin->dst_frames) + if (plugin->dst_frames) { frames1 = plugin->dst_frames(plugin, frames); + if (frames1 <= 0) + return frames1; + } if ((err = next->client_channels(next, frames1, &dst_channels)) < 0) { return err; } if (err != frames1) { frames = err; - if (plugin->src_frames) + if (plugin->src_frames) { frames = plugin->src_frames(plugin, frames1); + if (frames <= 0) + return frames; + } } } else dst_channels = NULL; Patches currently in stable-queue which might be from tiwai@suse.de are queue-4.9/alsa-pcm-remove-incorrect-snd_bug_on-usages.patch queue-4.9/alsa-aloop-fix-inconsistent-format-due-to-incomplete-rule.patch queue-4.9/alsa-pcm-add-missing-error-checks-in-oss-emulation-plugin-builder.patch queue-4.9/alsa-pcm-abort-properly-at-pending-signal-in-oss-read-write-loops.patch queue-4.9/alsa-pcm-allow-aborting-mutex-lock-at-oss-read-write-loops.patch queue-4.9/alsa-aloop-fix-racy-hw-constraints-adjustment.patch queue-4.9/alsa-aloop-release-cable-upon-open-error-path.patch