Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5C79FC433FE for ; Mon, 28 Nov 2022 17:44:17 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 05F4C1736; Mon, 28 Nov 2022 18:43:25 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 05F4C1736 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1669657455; bh=AuLd3sjbpowRys+MOonoJBhaxU3YsOhUU6SmRGUiprE=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=mDX3WPjYflACut5A6RLgkVmm3ubNRwEYuhM06DKeEkU2YmyEIq4luk9GL8r9gqzwG fG6sfB3uL+5GE2PYFrgxkHOq+a6XdYL3khE77Ai29+6sX3ZFlyCmJfqjjFz8WU8spp E90P5TS4KonvrB4419e9HrmKyON5hYwRUQAt12bw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 02F80F8055B; Mon, 28 Nov 2022 18:43:05 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 52B9DF8027D; Mon, 28 Nov 2022 18:43:03 +0100 (CET) Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 3277DF8024C for ; Mon, 28 Nov 2022 18:42:56 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3277DF8024C Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Fl4UvhwZ" Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BBBB4B80E9F; Mon, 28 Nov 2022 17:42:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E594C43149; Mon, 28 Nov 2022 17:42:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669657374; bh=AuLd3sjbpowRys+MOonoJBhaxU3YsOhUU6SmRGUiprE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fl4UvhwZqV+6knxNqSVD5nDl6negPs0tS7c5pQcJPDIRW3nz0SVXBUFOGpJrMo2xj e59mv3ekF9U+BSSFjxI8bmNaRY2nIAl7h/GnFi8dIRel8eQ2q4pWJTd+4lrR1JHEcn IMTBejhv3n7dz/ww28EzgPOMOboBXICT1v3PWp66SmaWTiwASq0ihnLTTXwluaeQ4N J8EkVN5wg8U8lhkuQsJGxr6hSRSzA3waaeU7wuNUQYXqjE5a8zdkk3RV5ZXuDErT2P kLC4glnS0wC1tM+ccJJIAOZy32E91bkFmwnKW4AOSKmJ5tVTmk5xtR8WddcxwW52Eb 0CkIc5RrQ5OuA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 08/12] ASoC: soc-pcm: Add NULL check in BE reparenting Date: Mon, 28 Nov 2022 12:42:31 -0500 Message-Id: <20221128174235.1442841-8-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221128174235.1442841-1-sashal@kernel.org> References: <20221128174235.1442841-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Cc: Sasha Levin , alsa-devel@alsa-project.org, lgirdwood@gmail.com, tiwai@suse.com, Mark Brown , Srinivasa Rao Mandadapu X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Srinivasa Rao Mandadapu [ Upstream commit db8f91d424fe0ea6db337aca8bc05908bbce1498 ] Add NULL check in dpcm_be_reparent API, to handle kernel NULL pointer dereference error. The issue occurred in fuzzing test. Signed-off-by: Srinivasa Rao Mandadapu Link: https://lore.kernel.org/r/1669098673-29703-1-git-send-email-quic_srivasam@quicinc.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/soc-pcm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index c03b653bf6ff..1fabb285b016 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1266,6 +1266,8 @@ static void dpcm_be_reparent(struct snd_soc_pcm_runtime *fe, return; be_substream = snd_soc_dpcm_get_substream(be, stream); + if (!be_substream) + return; list_for_each_entry(dpcm, &be->dpcm[stream].fe_clients, list_fe) { if (dpcm->fe == fe) -- 2.35.1