From: sashiko-bot@kernel.org
To: "Harendra Gautam" <harendra.gautam@oss.qualcomm.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v9 09/10] ASoC: qcom: Add Shikra QAIF support
Date: Tue, 13 Oct 2026 11:41:25 +0000 [thread overview]
Message-ID: <sashiko-outbox-169638@kernel.org> (raw)
In-Reply-To: <20261013-b4-qaif-shikra-audio-v9-9-f3022e28f2fd@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] asoc: qcom: qaif: uninitialized stack read on zero iommu-cells
--
commit 205b884308f0fc7a573192d7a53b7c016d2a1163
Author: Harendra Gautam <harendra.gautam@oss.qualcomm.com>
ASoC: qcom: Add Shikra QAIF support
Add the Shikra variant data for the Qualcomm Audio Interface driver so
the common QAIF code can bind to the Shikra QAIF device and expose the
SoC-specific DAIs.
> diff --git a/sound/soc/qcom/qaif-shikra.c b/sound/soc/qcom/qaif-shikra.c
> new file mode 100644
> index 0000000000000..2db3995a2de04
> --- /dev/null
> +++ b/sound/soc/qcom/qaif-shikra.c
[ ... ]
> +static const struct of_device_id shikra_qaif_cpu_device_id[] = {
> + { .compatible = "qcom,shikra-qaif-cpu", .data = &shikra_qaif_data },
> + {}
> +};
> +MODULE_DEVICE_TABLE(of, shikra_qaif_cpu_device_id);
> +
> +static struct platform_driver shikra_qaif_cpu_platform_driver = {
> + .driver = {
> + .name = "shikra-qaif-cpu",
> + .of_match_table = shikra_qaif_cpu_device_id,
> + .pm = pm_ptr(&asoc_qcom_qaif_pm_ops),
> + },
> + .probe = asoc_qcom_qaif_cpu_platform_probe,
[Severity: Medium]
When probing this new device, could this lead to an uninitialized kernel stack
memory read?
If a device tree is provided where the target iommus node has
"#iommu-cells = <0>", of_parse_phandle_with_args() returns successfully
with args_count = 0 without zeroing out the args array.
In sound/soc/qcom/qaif-platform.c:asoc_qcom_qaif_platform_register(),
which is reachable from this probe path:
ret = of_parse_phandle_with_args(pdev->dev.of_node,
"iommus", "#iommu-cells", 0,
&iommu_spec);
if (ret)
return dev_err_probe(&pdev->dev, ret,
"failed to parse iommus property\n");
sid = iommu_spec.args[0];
Because the iommu_spec structure is allocated on the stack, reading
iommu_spec.args[0] here fetches uninitialized kernel stack data without
checking if args_count > 0. This stack data is then masked with
QAIF_CSID_MASK and programmed into a hardware register, causing a minor
information leak and potential IOMMU configuration failure.
> +};
> +module_platform_driver(shikra_qaif_cpu_platform_driver);
> +
> +MODULE_DESCRIPTION("Qualcomm Audio Interface (QAIF) Shikra variant driver");
> +MODULE_AUTHOR("Harendra Gautam <harendra.gautam@oss.qualcomm.com>");
> +MODULE_LICENSE("GPL");
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261013-b4-qaif-shikra-audio-v9-0-f3022e28f2fd@oss.qualcomm.com?part=9
next prev parent reply other threads:[~2026-10-13 11:41 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 5:51 [PATCH v9 00/10] ASoC: qcom: Add QAIF driver for Shikra audio platform Harendra Gautam
2026-10-13 5:51 ` [PATCH v9 01/10] ASoC: dt-bindings: qcom,shikra-qaif-cpu: Add binding Harendra Gautam
2026-10-13 10:52 ` sashiko-bot
2026-10-13 5:51 ` [PATCH v9 02/10] ASoC: qcom: Add QAIF shared data structures and variant interface Harendra Gautam
2026-10-13 5:51 ` [PATCH v9 03/10] ASoC: qcom: Add QAIF hardware register map Harendra Gautam
2026-10-13 11:02 ` sashiko-bot
2026-10-13 5:51 ` [PATCH v9 04/10] ASoC: qcom: Add QAIF CPU DAI ops, regmap, DT parsing and platform init Harendra Gautam
2026-10-13 11:05 ` sashiko-bot
2026-10-13 5:51 ` [PATCH v9 05/10] ASoC: soc-core: Add snd_soc_of_xlate_dai_name() generic helper Harendra Gautam
2026-10-13 5:51 ` [PATCH v9 06/10] ASoC: qcom: Switch lpass-cpu and qaif-cpu to snd_soc_of_xlate_dai_name() Harendra Gautam
2026-10-13 5:51 ` [PATCH v9 07/10] ASoC: qcom: Add QAIF PCM operations Harendra Gautam
2026-10-13 11:31 ` sashiko-bot
2026-10-13 5:51 ` [PATCH v9 08/10] ASoC: qcom: Add QAIF IRQ handling and platform register Harendra Gautam
2026-10-13 11:28 ` sashiko-bot
2026-10-13 5:51 ` [PATCH v9 09/10] ASoC: qcom: Add Shikra QAIF support Harendra Gautam
2026-10-13 11:41 ` sashiko-bot [this message]
2026-10-13 5:51 ` [PATCH v9 10/10] MAINTAINERS: Add Qualcomm QAIF driver entry Harendra Gautam
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=sashiko-outbox-169638@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=harendra.gautam@oss.qualcomm.com \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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