From: sashiko-bot@kernel.org
To: "Krzysztof Kozlowski" <krzysztof.kozlowski@oss.qualcomm.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH 1/2] interconnect: qcom: x1e80100: Revert ABI break
Date: Wed, 20 May 2026 19:08:06 +0000 [thread overview]
Message-ID: <20260520190807.509871F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260520184944.182148-3-krzysztof.kozlowski@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Returning directly on `-EPROBE_DEFER` during QoS clock initialization bypasses node cleanup, leaking nodes and causing a Use-After-Free on probe retry.
--
commit dc792c2aa6455fa0377849e9d95a326611b7bb15
Author: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
interconnect: qcom: x1e80100: Revert ABI break
This patch reverts the enablement of QoS configuration for the x1e80100
interconnect driver. It removes the QoS box definitions and the requirement
for QoS clocks, as QoS is not mandatory for the device to operate.
Closes: https://krzk.eu/#/builders/102/builds/70/steps/23/logs/warnings__3_
> diff --git a/drivers/interconnect/qcom/x1e80100.c b/drivers/interconnect/qcom/x1e80100.c
> index 8075e0ff20597..2ba2823c7860e 100644
> --- a/drivers/interconnect/qcom/x1e80100.c
> +++ b/drivers/interconnect/qcom/x1e80100.c
[ ... ]
> @@ -1795,21 +1466,11 @@ static struct qcom_icc_node * const aggre1_noc_nodes[] = {
> [SLAVE_A1NOC_SNOC] = &qns_a1noc_snoc,
> };
>
> -static const struct regmap_config x1e80100_aggre1_noc_regmap_config = {
> - .reg_bits = 32,
> - .reg_stride = 4,
> - .val_bits = 32,
> - .max_register = 0x14400,
> - .fast_io = true,
> -};
> -
> static const struct qcom_icc_desc x1e80100_aggre1_noc = {
> - .config = &x1e80100_aggre1_noc_regmap_config,
> .nodes = aggre1_noc_nodes,
> .num_nodes = ARRAY_SIZE(aggre1_noc_nodes),
> .bcms = aggre1_noc_bcms,
> .num_bcms = ARRAY_SIZE(aggre1_noc_bcms),
> - .qos_requires_clocks = true,
> };
[Severity: High]
This is a pre-existing issue, but it looks like reverting the
qos_requires_clocks flag here might be masking a severe structural flaw
in qcom_icc_rpmh_probe() that triggers a use-after-free on probe retry.
In qcom_icc_rpmh_probe(), interconnect nodes are created via
icc_node_create_dyn() and added to the provider, with their pointers stored
in the driver's statically allocated qnodes definitions (qn->node).
If the subsequent call to devm_clk_bulk_get_all() returns -EPROBE_DEFER
(which only happens when qos_requires_clocks is true), the function
executes return dev_err_probe(...) and returns immediately. This completely
bypasses the err_remove_nodes cleanup path which calls icc_nodes_remove().
Because of this bypass:
1. The provider struct is freed by devres, but the nodes remain registered
globally in icc_idr with a dangling node->provider pointer.
2. On probe retry, the driver sees qn->node is already non-NULL and reuses
the old node.
3. The subsequent icc_node_add() hits WARN_ON(node->provider) (since it
points to the freed provider) and returns early without updating the pointer.
4. Any later interconnect operation (like qcom_icc_set()) dereferences the
dangling node->provider, leading to a guaranteed use-after-free.
Does this framework bug explain why enabling the clocks broke the ABI and
caused warnings?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260520184944.182148-3-krzysztof.kozlowski@oss.qualcomm.com?part=1
next prev parent reply other threads:[~2026-05-20 19:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-20 18:49 [PATCH 1/2] interconnect: qcom: x1e80100: Revert ABI break Krzysztof Kozlowski
2026-05-20 18:49 ` [PATCH 2/2] dt-bindings: interconnect: qcom,x1e80100-rpmh: " Krzysztof Kozlowski
2026-05-20 19:08 ` sashiko-bot [this message]
2026-05-20 19:20 ` [PATCH 1/2] interconnect: qcom: x1e80100: " Krzysztof Kozlowski
2026-05-21 8:00 ` Konrad Dybcio
2026-05-21 10:27 ` Krzysztof Kozlowski
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=20260520190807.509871F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski@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