lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260128-ops-parent-enable-fix-v1-1-ff39cc37f98d@collabora.com>
Date: Wed, 28 Jan 2026 19:38:50 +0100
From: Nicolas Frattaroli <nicolas.frattaroli@...labora.com>
To: Mark Brown <broonie@...nel.org>, 
 Alexander Stein <alexander.stein@...tq-group.com>, 
 Michael Turquette <mturquette@...libre.com>, 
 Stephen Boyd <sboyd@...nel.org>, 
 AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>, 
 Chen-Yu Tsai <wenst@...omium.org>, Abel Vesa <abelvesa@...nel.org>, 
 Peng Fan <peng.fan@....com>, Shawn Guo <shawnguo@...nel.org>, 
 Sascha Hauer <s.hauer@...gutronix.de>, 
 Pengutronix Kernel Team <kernel@...gutronix.de>, 
 Fabio Estevam <festevam@...il.com>
Cc: linux-clk@...r.kernel.org, linux-kernel@...r.kernel.org, 
 kernel@...labora.com, imx@...ts.linux.dev, 
 linux-arm-kernel@...ts.infradead.org, 
 Nicolas Frattaroli <nicolas.frattaroli@...labora.com>
Subject: [PATCH 1/2] clk: Disable CLK_OPS_PARENT_ENABLED parent only after
 CRITICAL check

The call to clk_core_enable_lock done by __clk_core_init after checking
the clock flags for CLK_IS_CRITICAL enables the parent clock.

In Commit 669917676e93 ("clk: Respect CLK_OPS_PARENT_ENABLE during
recalc"), the parent gets disabled before this check, if the flag
CLK_OPS_PARENT_ENABLED is set on the clock. This results in a situation
where critical clocks have their parent briefly disabled, which kills
the system.

Fix this by moving the balancing operation to after the CLK_IS_CRITICAL
check, which should resolve the problem.

Fixes: 669917676e93 ("clk: Respect CLK_OPS_PARENT_ENABLE during recalc")
Reported-by: Mark Brown <broonie@...nel.org>
Closes: https://lore.kernel.org/r/036da7ce-6487-4a6e-9b15-97c6d3bcdcec@sirena.org.uk/
Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@...labora.com>
---
 drivers/clk/clk.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 1b0f9d567f48..8f5ef9ce77d2 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -4056,9 +4056,6 @@ static int __clk_core_init(struct clk_core *core)
 		rate = 0;
 	core->rate = core->req_rate = rate;
 
-	if (core->flags & CLK_OPS_PARENT_ENABLE)
-		clk_core_disable_unprepare(core->parent);
-
 	/*
 	 * Enable CLK_IS_CRITICAL clocks so newly added critical clocks
 	 * don't get accidentally disabled when walking the orphan tree and
@@ -4081,6 +4078,9 @@ static int __clk_core_init(struct clk_core *core)
 		}
 	}
 
+	if (core->flags & CLK_OPS_PARENT_ENABLE)
+		clk_core_disable_unprepare(core->parent);
+
 	clk_core_reparent_orphans_nolock();
 out:
 	clk_pm_runtime_put(core);

-- 
2.52.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ