Message ID | 1669098673-29703-1-git-send-email-quic_srivasam@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2039860wrr; Mon, 21 Nov 2022 22:43:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf5EZPbTdG9jJzblf6UrVHvRfE58r/9HViW3LranJm2/YIV9Dcykrn4eeCSRs+m3kVqGR63l X-Received: by 2002:a17:906:5fd5:b0:7ac:2e16:a8d3 with SMTP id k21-20020a1709065fd500b007ac2e16a8d3mr3750896ejv.667.1669099410405; Mon, 21 Nov 2022 22:43:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669099410; cv=none; d=google.com; s=arc-20160816; b=Yk+3vPSD8k3B5SB288VzS0pl12zbOBHC3U4Jz8tjBRNIfKlIDFBG9aa3poaKC/eSaC rmd51Au3CPfLbbCVO2HR0oaKdyFeFmppYYrJrOXcCEXfDGeH1om3pbmoBclMtcBiFWOZ HijOZpsovdmGSWUtymxRiB3gHd8pCgvpbHkQeZJc761Z/zyueeQ3xTavolOXzSd9YNLL sxMiHJkRqkY5irxfshk0Ct/HTE2cuFOIGpa7HMTpOMdwJ/ANDusKCzJaXGJZCz2DanvQ UddUuK/H7RnN++4+MQzTIJ7OHmT4s2DJz5pCmFQyWdTyk2FwBgn/Shg6l4IN5JFiwCm0 XZGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=G6al7EgrFATCgp+KRSpg6rYdfJ14L7+oK1pxlH/1xPM=; b=PIBAZ/0+TcOW7dbbICXzS1KX52jaHG0bDAfysuhpnMCDpCssezjOE8GBxsxI0Qi1CF kV8GpPlukAa/hCh84jya5glFWFVdNCqorm4OFiv5YcVA/fxAMt9+jINgYdtYzh86zXET SVqGgQACBapd+NMzbKAiYb/b2vZlRt9NCirELbcqefCkCUjlw8uYyBoBVWZSWDLNakwz 8trchKQ+/Md1JbKnln2ajOCXNkDK8cerbQGvs8JBZ53bU0/bpsBi8C0urkoc/zGMUOSD GAG2wO5PaT0mV/1s+6XSvyzqmbKeiuyBDFj6tzHYp63AsqORPNWYdomy0SGQZWdTYJKj GTdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=FXhhwdJT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p2-20020a056402500200b00463b0df4604si11357098eda.488.2022.11.21.22.43.02; Mon, 21 Nov 2022 22:43:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=FXhhwdJT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229515AbiKVGd1 (ORCPT <rfc822;cjcooper78@gmail.com> + 99 others); Tue, 22 Nov 2022 01:33:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230255AbiKVGdY (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 22 Nov 2022 01:33:24 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AC069FD2; Mon, 21 Nov 2022 22:33:23 -0800 (PST) Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AM64hxZ011778; Tue, 22 Nov 2022 06:31:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=qcppdkim1; bh=G6al7EgrFATCgp+KRSpg6rYdfJ14L7+oK1pxlH/1xPM=; b=FXhhwdJTxaPQFymKD/yRr2FSxLG6maIXss6h64W1jKPk2vV17490r82UXtWyDKljmE9s cyAKZIQtR25+FK68uVYVP4IA2TxSlT9EgICGNgpUa+IQnguEJaUC3dFV0u3VL0HEPVcp xRT3xQb+PfNKmQngNmJHTGmUN0kDG4QWX8IoOgPxv4Lhesy8a+bsBOXxgJCEo7CKflyG j9uO+zWaGrio7xuQywWHrbpeY3QEugfExXMEOFw9fge+qfRVyvDhM1JUrgJgAtGRi0wG eydy9eMMoxMYYUtrsxGc7lSP/EVltdBONEvHuOhqjiA8tOBvGEQ9lSnz2l5bjqHUekRI ZQ== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3m0q6x86me-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 22 Nov 2022 06:31:35 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2AM6VYOu025299 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 22 Nov 2022 06:31:34 GMT Received: from hu-srivasam-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Mon, 21 Nov 2022 22:31:28 -0800 From: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com> To: <agross@kernel.org>, <andersson@kernel.org>, <lgirdwood@gmail.com>, <broonie@kernel.org>, <robh+dt@kernel.org>, <quic_plai@quicinc.com>, <bgoswami@quicinc.com>, <perex@perex.cz>, <tiwai@suse.com>, <srinivas.kandagatla@linaro.org>, <quic_rohkumar@quicinc.com>, <linux-arm-msm@vger.kernel.org>, <alsa-devel@alsa-project.org>, <linux-kernel@vger.kernel.org>, <swboyd@chromium.org>, <judyhsiao@chromium.org>, <devicetree@vger.kernel.org>, <lgirdwood@gmail.co> CC: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com> Subject: [PATCH v2] ASoC: soc-pcm: Add NULL check in BE reparenting Date: Tue, 22 Nov 2022 12:01:13 +0530 Message-ID: <1669098673-29703-1-git-send-email-quic_srivasam@quicinc.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 6Vcx3HIsNJoroU2495sFmzlrYThHOoL5 X-Proofpoint-ORIG-GUID: 6Vcx3HIsNJoroU2495sFmzlrYThHOoL5 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-22_03,2022-11-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 lowpriorityscore=0 adultscore=0 clxscore=1015 spamscore=0 impostorscore=0 priorityscore=1501 bulkscore=0 mlxscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211220047 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750177583283600641?= X-GMAIL-MSGID: =?utf-8?q?1750177583283600641?= |
Series |
[v2] ASoC: soc-pcm: Add NULL check in BE reparenting
|
|
Commit Message
Srinivasa Rao Mandadapu
Nov. 22, 2022, 6:31 a.m. UTC
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 <quic_srivasam@quicinc.com>
---
Changes Since V1:
-- Update commit title.
sound/soc/soc-pcm.c | 2 ++
1 file changed, 2 insertions(+)
Comments
On Tue, 22 Nov 2022 12:01:13 +0530, Srinivasa Rao Mandadapu wrote: > Add NULL check in dpcm_be_reparent API, to handle > kernel NULL pointer dereference error. > The issue occurred in fuzzing test. > > Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next Thanks! [1/1] ASoC: soc-pcm: Add NULL check in BE reparenting commit: db8f91d424fe0ea6db337aca8bc05908bbce1498 All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark
On 2022-11-22 7:31 AM, Srinivasa Rao Mandadapu wrote: > 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 <quic_srivasam@quicinc.com> > --- > Changes Since V1: > -- Update commit title. > > 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 493f003..a7810c7 100644 > --- a/sound/soc/soc-pcm.c > +++ b/sound/soc/soc-pcm.c > @@ -1247,6 +1247,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; > > for_each_dpcm_fe(be, stream, dpcm) { > if (dpcm->fe == fe) The explanation provided is hardly satisfactory. The reason I asked, is that be_substream should never be null by the time we get to dpcm_be_reparent(). There is a number of invocations of snd_soc_dpcm_get_substream() within sound/soc/*.c and yet most of them are not checked - as they do not need to be. I believe that the problem may lie elsewhere and this patch just covered things up. Regards, Czarek
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 493f003..a7810c7 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1247,6 +1247,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; for_each_dpcm_fe(be, stream, dpcm) { if (dpcm->fe == fe)