From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796324927; b=Sz3d6SSxrxQP7Cn99HzDtb41jUmm+r5w2NH78co9ePnSJdgeDJP84ByoVWm0AUB2cHb1 wUtZ/EdaMnG6UUyYEsFQkVC6MmWBwYlYVcupFkJs7vXv93XDNWO387we6QMGpnzdfg/7+ CNlAm5PI0kejsznEoJ/TJvreu5Rie5LBku8fZ94EVcGt34T56QYieDSOqqaI9wvhpdrS9 7wyflfPt/wZr++ITeHnYCSd76d50QeEnL/IVGkbpa6JgDdQ/V1qIDH3RDO/50PiNIBIU2 c/Q8mzT5G4/LbN81nnovQWd/iaIsGoKANmDWfdaJ/Y0TXYD0MpAKoMQPfPgsoMe6lFg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796324927; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=oAO0mzR5llSr0tUu16fdfAM4dmXP//hdcamsdjaA+gw=; b=vGLPitY3FmBw2HLOq6nWgnuYNRmBdbe+7vU7pGuCYHSziyyewWacILd3SdfgfH7KKtSs rMBKld/BXrB9kJkQIWUmNfBEtXQaPmPp7JpLdu6MB6dlFmxwPcef0fe76Qgqq6g+wv3sM bjBy2z1oa7R2i4Fx/czYez+tjjgCyq/mX8jPsLO4x8aQnTOU+v7m+JvzrgWAmFr4aPuUf 6hJLbsRR3atZHm4ulqB8YrqcHqbtkOZa0eU6Dy293+aQ2wxornCgtrkJwvI7Ota461c0l itOwNYLrmuZxyxl5fxaYt8aqvT60urndcWCQXY76u+D49k+worWLfnsdQznEMvqhtcQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="gobEM/9m"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D162A606A330 for ; Thu, 3 Dec 2026 19:08:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=gobEM/9m Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D8EA1F000C2; Thu, 3 Dec 2026 19:08:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796324927; bh=oAO0mzR5llSr0tUu16fdfAM4dmXP//hdcamsdjaA+gw=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=gobEM/9mZD59fz8+IpM12FNOZKZJ7iqgNI9ziikzx8A8AEvo4jQiaEF219EX27TLq ona1okdEK7hhQ+kTWhoqNDEfuWujELi81ZZSc6wcHissg6DyMRqETbw1HHpph8Ueum p9l28KJERKKb6NWS695oqUN25SVeVIvdbnY2nLJ/21frAlAVvclLNigMIr9K/RNhBb MatzazLCqOo8bkApULl3KSYViexUt9rdbzS0NGVWXrJ6HjnoGwkHmwrTLUoQh/gFea 5KrzE6NMgXu8dLav+FMVPMBSZy6Lypliochh6SC7HRpqT7GEB2XX27Z9JxSVJBNS9V puB83PW0mcIcg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v3 4/7] arm64: dts: st: add D1 domain for STM32MP25 family Reply-To: sashiko-reviews@lists.linux.dev To: "Patrick Delaunay" Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261203181556.v3.4.I1233f0c68bba42732eb6dc470b5eebaf6db441a7@changeid> References: <20261203171721.1525015-1-patrick.delaunay@foss.st.com> <20261203181556.v3.4.I1233f0c68bba42732eb6dc470b5eebaf6db441a7@changeid> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 19:08:46 +0000 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 3 potential issues to consider: - [Medium] pmdomain: st: OF node reference leak in stm32mp_pm_domain_probe() - [Medium] pmdomain: st: UAF on d1_pd unbind when pm_genpd_remove() returns -EBUSY - [Low] arm64: dts: st: undocumented RET_PD power-domains assignment on hpdma1-3 -- commit 4d68b237fb4210955e34085639d48ea0038b974b Author: Patrick Delaunay arm64: dts: st: add D1 domain for STM32MP25 family This commit adds the d1_pd power-controller node to the STM32MP25 device tree, assigns STM32MP25 peripherals to it, and assigns the HPDMA controllers to RET_PD. > diff --git a/arch/arm64/boot/dts/st/stm32mp251.dtsi b/arch/arm64/boot/dts= /st/stm32mp251.dtsi > index bf1542818be25..49bc5ca9cf710 100644 > --- a/arch/arm64/boot/dts/st/stm32mp251.dtsi > +++ b/arch/arm64/boot/dts/st/stm32mp251.dtsi > @@ -152,6 +152,12 @@ v2m0: v2m@48090000 { > }; > }; > =20 > + d1_pd: power-controller { > + compatible =3D "st,stm32mp-pm-domain"; > + #power-domain-cells =3D <0>; > + power-domains =3D <&CLUSTER_PD>; > + }; > + > psci { > compatible =3D "arm,psci-1.0"; > method =3D "smc"; [Severity: Medium] Does activating st,stm32mp-pm-domain leak an OF node reference on CLUSTER_PD in stm32mp_pm_domain_probe()? In drivers/pmdomain/st/stm32mp-pm-domain.c, stm32mp_pm_domain_probe() takes a reference on link->domain.np via of_parse_phandle_with_args(). Later error returns (such as -EPROBE_DEFER from of_genpd_add_subdomain()) and stm32mp_pm_domain_genpd_remove_subdomain() never call of_node_put(). Registering a devm action to release link->domain.np right after of_parse_phandle_with_args() would cover both probe deferral and teardown. [ ... ] > @@ -209,6 +215,7 @@ hpdma: dma-controller@40400000 { > , > ; > clocks =3D <&scmi_clk CK_SCMI_HPDMA1>; > + power-domains =3D <&RET_PD>; > #dma-cells =3D <3>; > }; [Severity: Low] Should the RET_PD assignment on hpdma, hpdma2, and hpdma3 be split into its own commit or documented in the commit message? The changelog only describes adding d1_pd and assigning peripherals to D1. Because hpdma, hpdma2, and hpdma3 are enabled by default and stm32-dma3 holds runtime PM references while channels are allocated, attaching them to RET_PD affects when RET_PD can power off during idle. [ ... ] > @@ -273,7 +282,7 @@ ommanager: ommanager@40500000 { > <&scmi_reset RST_SCMI_OSPI2>; > reset-names =3D "omm", "ospi1", "ospi2"; > access-controllers =3D <&rifsc 111>; > - power-domains =3D <&CLUSTER_PD>; > + power-domains =3D <&d1_pd>; > #address-cells =3D <2>; > #size-cells =3D <1>; > st,syscfg-amcr =3D <&syscfg 0x2c00 0x7>; [Severity: Medium] Can unbinding or unloading the stm32mp_pm_domain driver trigger a use-after-free of pd now that STM32MP25 peripherals attach to d1_pd? stm32mp_pm_domain_driver uses module_platform_driver() without setting suppress_bind_attrs =3D true, and its devm teardown action stm32mp_pm_domain_genpd_remove() discards the return value of pm_genpd_remove(). If d1_pd is unbound while consumers remain attached (for example under fw_devlink=3Doff, where device links do not unbind consumers first), genpd_remove() returns -EBUSY and leaves pd in gpd_list. Devres then frees pd, causing a use-after-free on the next genpd traversal or detach. Setting suppress_bind_attrs =3D true and making the driver built-in would avoid freeing a still-registered generic_pm_domain. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203171721.1525= 015-1-patrick.delaunay@foss.st.com?part=3D4