All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Sreeshankar K" <sreeshankar0910@gmail.com>
Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v16 8/8] arm64: dts: qcom: Add SM7250 devicetree file
Date: Tue, 01 Dec 2026 12:53:23 +0000	[thread overview]
Message-ID: <sashiko-outbox-243314@kernel.org> (raw)
In-Reply-To: <20261201-sm7250-v16-8-ff2a373e16d3@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] cpufreq: qcom-hw: partial init, leak, and UAF in
  qcom_cpufreq_hw_cpu_init()
--

commit 9eb185d5af4636bf5669a2288a3efc15b5e70184
Author: Sreeshankar K <sreeshankar0910@gmail.com>

arm64: dts: qcom: Add SM7250 devicetree file

This commit adds the base devicetree file for the Qualcomm SM7250 SoC,
including CPU, PSCI, memory, clock, interrupt, and serial nodes.

> diff --git a/arch/arm64/boot/dts/qcom/sm7250.dtsi b/arch/arm64/boot/dts/qcom/sm7250.dtsi
> new file mode 100644
> index 0000000000000..a47143c091bb0
> --- /dev/null
> +++ b/arch/arm64/boot/dts/qcom/sm7250.dtsi
> @@ -0,0 +1,803 @@

[ ... ]

> +		cpufreq_hw: cpufreq@18323000 {
> +			compatible = "qcom,sm7250-cpufreq-hw", "qcom,cpufreq-hw";
> +			reg = <0 0x18323000 0 0x1000>,
> +			      <0 0x18325800 0 0x1000>,
> +			      <0 0x18327800 0 0x1000>;
> +			reg-names = "freq-domain0",
> +				    "freq-domain1",
> +				    "freq-domain2";
> +			interrupts-extended = <&lmh_cluster0 0>,
> +					      <&lmh_cluster1 0>;
> +			interrupt-names = "dcvsh-irq-0",
> +					  "dcvsh-irq-1";

[Severity: Medium]
Can defining three frequency domains with only two LMh interrupts leave
CPUs 0..6 without cpufreq management and cause a use-after-free on
data->policy when the LMh interrupt domains are unavailable (for example,
when CONFIG_QCOM_LMH=n)?

In qcom_cpufreq_hw_lmh_init(), platform_get_irq_optional(pdev, index)
returns -EPROBE_DEFER for domains 0 and 1 when lmh_cluster0 and
lmh_cluster1 have not registered their IRQ domains, but returns -ENXIO for
domain 2 (CPU 7), which qcom_cpufreq_hw_lmh_init() treats as success:

drivers/cpufreq/qcom-cpufreq-hw.c:qcom_cpufreq_hw_cpu_init() {
	...
	data->policy = policy;

	ret = qcom_cpufreq_hw_read_lut(cpu_dev, policy);
	...
	return qcom_cpufreq_hw_lmh_init(policy, index);
}

When qcom_cpufreq_hw_lmh_init() fails for CPUs 0..6, cpufreq_online()
frees each failed policy without calling cpufreq_driver->exit().  This
leaks policy->freq_table and the dynamic OPPs added by
qcom_cpufreq_hw_read_lut(), and leaves qcom_cpufreq.data[0..1].policy
pointing to freed memory that qcom_cpufreq_hw_recalc_rate() dereferences.
Because CPU 7 succeeds, cpufreq_register_driver() returns 0 instead of
propagating -EPROBE_DEFER, leaving CPUs 0..6 permanently unmanaged.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261201-sm7250-v16-0-ff2a373e16d3@gmail.com?part=8

      reply	other threads:[~2026-12-01 12:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 12:37 [PATCH v16 0/8] Add initial support for Qualcomm SM7250 SoC Sreeshankar K
2026-12-01 12:37 ` [PATCH v16 1/8] dt-bindings: clock: Add SM7250 global clock controller Sreeshankar K
2026-12-01 12:37 ` [PATCH v16 2/8] clk: qcom: Add Global Clock Controller (GCC) driver for SM7250 Sreeshankar K
2026-12-01 12:37 ` [PATCH v16 3/8] thermal/qcom/lmh: Switch to match data for SoC CPU-to-node mappings Sreeshankar K
2026-12-01 12:43   ` sashiko-bot
2026-12-01 13:21   ` Konrad Dybcio
2026-12-01 12:37 ` [PATCH v16 4/8] dt-bindings: thermal: lmh: Document SM7250 LMh Sreeshankar K
2026-12-01 12:37 ` [PATCH v16 5/8] thermal/qcom/lmh: Add support for Qualcomm SM7250 Sreeshankar K
2026-12-01 13:21   ` Konrad Dybcio
2026-12-01 12:37 ` [PATCH v16 6/8] dt-bindings: firmware: qcom,scm: Document SM7250 SCM Sreeshankar K
2026-12-01 12:37 ` [PATCH v16 7/8] dt-bindings: cpufreq: qcom-hw: Document SM7250 cpufreq hardware Sreeshankar K
2026-12-01 12:38 ` [PATCH v16 8/8] arm64: dts: qcom: Add SM7250 devicetree file Sreeshankar K
2026-12-01 12:53   ` 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=sashiko-outbox-243314@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=sreeshankar0910@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.