Received: by 2002:a17:90a:1609:0:0:0:0 with SMTP id n9csp855203pja; Wed, 1 Apr 2020 09:54:33 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuiYPvoZP5S8ulJmqiHpV38D0BWmaEIdlcp0wnyvOB8vdGar1kINxxub9uwGEEz+0KLLF6i X-Received: by 2002:a9d:404b:: with SMTP id o11mr17905598oti.120.1585760073789; Wed, 01 Apr 2020 09:54:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585760073; cv=none; d=google.com; s=arc-20160816; b=jh50cprNepMF0kr7dW8rdTFtvtHuzR/IaOC7Zo4FQs8c/GkINOluLaZl9RJEk36rJh u/nbUIcedeJ7GaCqnqCnGnOdLY+Eh1U2ertVnmrUXfVf3eq+taN5LC/+nMWjdwleSC58 LaoyJz02gVCGE71tvLQmb5xepkP7LrB53e4qGVRfnbzZ6c7sho8oTrYhrKgRlp1CPNwC 2dwRgCf+7gmZHX7RXslZQIPyj8WU1x9tGgByPdP9tyquBVpEZk9M0KL+ich7VNuaCqEP uxkfdYf8cR9woOqMALksFlfTOZFW+3dz4DG0Q5ssD6esV0WHGdqy2R9gF/p/6jWsk+iN zZHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WD7NUJhRHXmI7iQhKayQs9q2fyYVEJ4Rf4285/zIwM4=; b=Xx/H6ml/mQmryRtO/MJhTUDpi/ZgKOScAfsxDS0DEnax2I+4I+Uo8qcBFCICcdHPZU 3AawDCerZYC0TQMIIkQ+eqwuBQYJ/P21p6FaLQIPrkva9PB4aoS9RKnpFEjkvqCLypn1 dWq80VYNvxGvnVM6IPHiax78FLH6R0bbdwmX7JgmhXNPwulL1wiElvugmq/9UolaRjP3 ab4MpyI7kIWYL1TpkRmqwqqtm/W/ZqIevH1FuJCYpTAve4gdIsbc2V5BBZ/I9MEGh/fd 1DHNmbPJ1uJW/ROJC441BEJcMwC+t7N56TTzp5wd2uqBMMWJODLz/sUQgtxObR7mtLFd efYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=psyCTuUZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j25si1052882oii.86.2020.04.01.09.54.21; Wed, 01 Apr 2020 09:54:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=psyCTuUZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388439AbgDAQcg (ORCPT + 99 others); Wed, 1 Apr 2020 12:32:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:58998 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733165AbgDAQce (ORCPT ); Wed, 1 Apr 2020 12:32:34 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 90C73214DB; Wed, 1 Apr 2020 16:32:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585758754; bh=wyLKa9e4fnj7moQyCDcCfUz9jCeCcmM9gRIIhMtIa1U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=psyCTuUZ+ohMLiyV0sAe3IPKatUPFrOcRVlFtDO9KFtasDe/3+XzqnrLb/zRmoI4z wgCSx/x6IKyAVUsEhdH2NwkG0oO/SeFeIwDQ9cBxJMfMrKzF1Xmqdj39w2M452yD+v ZoDhqR4WBjPcXu706l0VmEuoe/YTSZVJxO5ZVGx0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+2a59ee7a9831b264f45e@syzkaller.appspotmail.com, Takashi Iwai Subject: [PATCH 4.4 17/91] ALSA: pcm: oss: Remove WARNING from snd_pcm_plug_alloc() checks Date: Wed, 1 Apr 2020 18:17:13 +0200 Message-Id: <20200401161518.992882251@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200401161512.917494101@linuxfoundation.org> References: <20200401161512.917494101@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Takashi Iwai commit 5461e0530c222129dfc941058be114b5cbc00837 upstream. The return value checks in snd_pcm_plug_alloc() are covered with snd_BUG_ON() macro that may trigger a kernel WARNING depending on the kconfig. But since the error condition can be triggered by a weird user space parameter passed to OSS layer, we shouldn't give the kernel stack trace just for that. As it's a normal error condition, let's remove snd_BUG_ON() macro usage there. Reported-by: syzbot+2a59ee7a9831b264f45e@syzkaller.appspotmail.com Cc: Link: https://lore.kernel.org/r/20200312155730.7520-1-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/core/oss/pcm_plugin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/sound/core/oss/pcm_plugin.c +++ b/sound/core/oss/pcm_plugin.c @@ -111,7 +111,7 @@ int snd_pcm_plug_alloc(struct snd_pcm_su while (plugin->next) { if (plugin->dst_frames) frames = plugin->dst_frames(plugin, frames); - if (snd_BUG_ON((snd_pcm_sframes_t)frames <= 0)) + if ((snd_pcm_sframes_t)frames <= 0) return -ENXIO; plugin = plugin->next; err = snd_pcm_plugin_alloc(plugin, frames); @@ -123,7 +123,7 @@ int snd_pcm_plug_alloc(struct snd_pcm_su while (plugin->prev) { if (plugin->src_frames) frames = plugin->src_frames(plugin, frames); - if (snd_BUG_ON((snd_pcm_sframes_t)frames <= 0)) + if ((snd_pcm_sframes_t)frames <= 0) return -ENXIO; plugin = plugin->prev; err = snd_pcm_plugin_alloc(plugin, frames);