From: sashiko-bot@kernel.org
To: "Raviteja Laggyshetty" <raviteja.laggyshetty@oss.qualcomm.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v2 2/2] interconnect: qcom: add Maili interconnect provider driver
Date: Mon, 22 Jun 2026 06:44:30 +0000 [thread overview]
Message-ID: <20260622064430.A34FA1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260622-maili_icc-v2-2-18b5ac08c04f@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Use-After-Free on driver unbind/rebind due to stale pointers in statically allocated driver structures.
--
commit 9266119e904a5c675879f8849d752743c3590271
Author: Raviteja Laggyshetty <raviteja.laggyshetty@oss.qualcomm.com>
interconnect: qcom: add Maili interconnect provider driver
Add driver for the Qualcomm interconnect buses found in Maili
based platforms. The topology consists of several NoCs that are
controlled by a remote processor that collects the aggregated
bandwidth for each master-slave pairs.
> diff --git a/drivers/interconnect/qcom/maili.c b/drivers/interconnect/qcom/maili.c
> new file mode 100644
> --- /dev/null
> +++ b/drivers/interconnect/qcom/maili.c
[ ... ]
> +static struct platform_driver qnoc_driver = {
> + .probe = qcom_icc_rpmh_probe,
> + .remove = qcom_icc_rpmh_remove,
[Severity: High]
This isn't a bug introduced by this patch, but I noticed the framework
functions used here might leave dangling pointers in the static data structures
introduced by this patch.
During a driver unbind, qcom_icc_rpmh_remove() frees the dynamically allocated
nodes associated with the provider:
qcom_icc_rpmh_remove() {
...
icc_nodes_remove(&qp->provider);
}
However, the qn->node pointers in the statically allocated driver structures
added in this patch are never cleared. If the driver is subsequently rebound
via sysfs, qcom_icc_rpmh_probe() sees the stale pointer and skips allocation:
qcom_icc_rpmh_probe() {
...
if (!qn->node)
qn->node = icc_node_create_dyn();
node = qn->node;
...
}
Does this code result in a use-after-free when the freed node memory is
accessed during the rebind?
> + .driver = {
> + .name = "qnoc-maili",
> + .of_match_table = qnoc_of_match,
> + .sync_state = icc_sync_state,
> + },
> +};
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260622-maili_icc-v2-0-18b5ac08c04f@oss.qualcomm.com?part=2
prev parent reply other threads:[~2026-06-22 6:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-22 6:34 [PATCH v2 0/2] interconnect: qcom: Add support for upcoming Maili SoC Raviteja Laggyshetty
2026-06-22 6:34 ` [PATCH v2 1/2] dt-bindings: interconnect: qcom: document the RPMh Network-On-Chip interconnect in " Raviteja Laggyshetty
2026-06-22 6:34 ` [PATCH v2 2/2] interconnect: qcom: add Maili interconnect provider driver Raviteja Laggyshetty
2026-06-22 6:44 ` sashiko-bot [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=20260622064430.A34FA1F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=raviteja.laggyshetty@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