From: Cezary Rojewski <cezary.rojewski@intel.com>
To: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
Cc: <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>
Subject: Re: [PATCH v2] ASoC: soc-pcm: Add NULL check in BE reparenting
Date: Wed, 23 Nov 2022 10:16:40 +0100 [thread overview]
Message-ID: <07fdc7fb-2a1a-ac70-e0c5-ba9b2fca6464@intel.com> (raw)
In-Reply-To: <1669098673-29703-1-git-send-email-quic_srivasam@quicinc.com>
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
prev parent reply other threads:[~2022-11-23 9:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-22 6:31 [PATCH v2] ASoC: soc-pcm: Add NULL check in BE reparenting Srinivasa Rao Mandadapu
2022-11-22 14:35 ` Mark Brown
2022-11-23 9:16 ` Cezary Rojewski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=07fdc7fb-2a1a-ac70-e0c5-ba9b2fca6464@intel.com \
--to=cezary.rojewski@intel.com \
--cc=agross@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=andersson@kernel.org \
--cc=bgoswami@quicinc.com \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=judyhsiao@chromium.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=quic_plai@quicinc.com \
--cc=quic_rohkumar@quicinc.com \
--cc=quic_srivasam@quicinc.com \
--cc=robh+dt@kernel.org \
--cc=srinivas.kandagatla@linaro.org \
--cc=swboyd@chromium.org \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox