Linux clock framework development
 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 v18 8/8] arm64: dts: qcom: Add SM7250 devicetree file
Date: Sun, 06 Dec 2026 05:33:50 +0000	[thread overview]
Message-ID: <sashiko-outbox-252179@kernel.org> (raw)
In-Reply-To: <20261206-sm7250-v18-8-954befb935bb@gmail.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] cpufreq: qcom-hw: partial init, leak, and UAF on SM7250
  without LMh
- [Low] arm64: dts: qcom: confirm SM7250 GICv3 maintenance interrupt PPI
--

commit cb376f816df13b1a2189685d1e1a3775d709b831
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 CPUs, PSCI, reserved memory, clocks, interrupts, and serial
console support.

> diff --git a/arch/arm64/boot/dts/qcom/sm7250.dtsi b/arch/arm64/boot/dts/qcom/sm7250.dtsi
> new file mode 100644
> index 0000000000000..e02ca97e5167e
> --- /dev/null
> +++ b/arch/arm64/boot/dts/qcom/sm7250.dtsi

[ ... ]

> +		intc: interrupt-controller@17a00000 {
> +			compatible = "arm,gic-v3";
> +			reg = <0x0 0x17a00000 0x0 0x10000>,     /* GICD */
> +			      <0x0 0x17a60000 0x0 0x100000>;    /* GICR * 8 */
> +			#interrupt-cells = <3>;
> +			interrupt-controller;
> +			interrupts = <GIC_PPI 8 IRQ_TYPE_LEVEL_HIGH>;
> +		};

[Severity: Low]
Does SM7250 wire the GICv3 virtual CPU interface maintenance interrupt to
GIC_PPI 9 (INTID 25) rather than GIC_PPI 8 (INTID 24)?

This rests on an SoC integration detail that cannot be confirmed from the
kernel source alone.  Sibling Kryo 4xx devicetrees such as sm8150.dtsi
and sc7180.dtsi specify GIC_PPI 9, matching DEFAULT_MI_INTID (25) in
arch/arm64/kvm/vgic/vgic-init.c.

Because gic_of_setup_kvm_info() maps the first interrupt of this node as
gic_v3_kvm_info.maint_irq, KVM will register its handler on the wrong PPI
and miss VGIC maintenance interrupts if the hardware actually uses PPI 9.

[ ... ]

> +		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";
> +			clocks = <&rpmhcc RPMH_CXO_CLK>, <&gcc GPLL0>;
> +			clock-names = "xo", "alternate";
> +			#freq-domain-cells = <1>;
> +			#clock-cells = <1>;
> +		};

[Severity: Medium]
Can having two interrupts-extended entries for three frequency domains
cause a use-after-free on data->policy when the LMh driver is not bound?

With CONFIG_QCOM_LMH=n (or if lmh_cluster0/lmh_cluster1 are not yet
registered), qcom_cpufreq_hw_cpu_init() sets data->policy and allocates
policy->freq_table and OPPs before qcom_cpufreq_hw_lmh_init() fails with
-EPROBE_DEFER on domains 0 and 1.

cpufreq_policy_online() skips cpufreq_driver->exit() on init failure and
cpufreq_online() frees policy, leaving data->policy dangling and leaking
the frequency tables and OPPs for CPUs 0..6.

Domain 2 (CPU 7) has no third interrupt entry, so
platform_get_irq_optional() returns -ENXIO, which
qcom_cpufreq_hw_lmh_init() treats as success.  cpufreq_register_driver()
then returns 0 instead of deferring, leaving CPUs 0..6 without cpufreq.

Because qcom_cpufreq0 and qcom_cpufreq1 remain registered, any later rate
query hits a use-after-free in qcom_cpufreq_hw_recalc_rate() ->
__qcom_cpufreq_hw_get(data->policy).

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261206-sm7250-v18-0-954befb935bb@gmail.com?part=8

      reply	other threads:[~2026-12-06  5:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-06  5:15 [PATCH v18 0/8] Add initial support for Qualcomm SM7250 SoC Sreeshankar K
2026-12-06  5:15 ` [PATCH v18 1/8] dt-bindings: clock: Add SM7250 global clock controller Sreeshankar K
2026-12-06  5:15 ` [PATCH v18 2/8] clk: qcom: Add Global Clock Controller (GCC) driver for SM7250 Sreeshankar K
2026-12-06  5:39   ` sashiko-bot
2026-12-06  5:15 ` [PATCH v18 3/8] thermal/qcom/lmh: Switch to match data for SoC CPU-to-node mappings Sreeshankar K
2026-12-06  5:15 ` [PATCH v18 4/8] dt-bindings: thermal: lmh: Document SM7250 LMh Sreeshankar K
2026-12-06  5:15 ` [PATCH v18 5/8] thermal/qcom/lmh: Add support for Qualcomm SM7250 Sreeshankar K
2026-12-06  5:15 ` [PATCH v18 6/8] dt-bindings: firmware: qcom,scm: Document SM7250 SCM Sreeshankar K
2026-12-06  5:15 ` [PATCH v18 7/8] dt-bindings: cpufreq: qcom-hw: Document SM7250 cpufreq hardware Sreeshankar K
2026-12-06  5:15 ` [PATCH v18 8/8] arm64: dts: qcom: Add SM7250 devicetree file Sreeshankar K
2026-12-06  5:33   ` 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-252179@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox