Linux clock framework development
 help / color / mirror / Atom feed
* [PATCH 0/3] clk: zynqmp: fix out-of-bounds accesses in firmware clock parsing
@ 2026-12-01  6:43 Radhey Shyam Pandey
  2026-12-01  6:43 ` [PATCH 1/3] clk: zynqmp: Fix off-by-one loop bound in zynqmp_clock_get_topology() Radhey Shyam Pandey
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Radhey Shyam Pandey @ 2026-12-01  6:43 UTC (permalink / raw)
  To: sboyd, bmasney+clk, jbrunet+clk, michal.simek, shubhrajyoti.datta
  Cc: linux-clk, linux-arm-kernel, git, Radhey Shyam Pandey

The ZynqMP clock driver builds its clock tree from PM firmware query
responses. The parsing helpers in clkc.c bound their writes by loop
arithmetic alone and never validate the values firmware returns, so a
response can be written past the end of the destination array or used
as an unchecked table index.

All three issues have been present since the driver was added:

  1/3  The topology fetch loop runs one iteration too many, writing up
       to three entries past the MAX_NODES topology array.

  2/3  The parent lookup is bounded by the count of resolved parents,
       which lags the write index, so parents[] can be overrun.

  3/3  The 4-bit topology type from firmware indexes clk_topology[] and
       clk_type_postfix[], which hold only seven entries; an
       out-of-range value can reach a function-pointer dereference.

Valid firmware responses are unaffected by this series.

Beesam Sridhar Sagar (3):
  clk: zynqmp: Fix off-by-one loop bound in zynqmp_clock_get_topology()
  clk: zynqmp: Fix unbounded parent array overflow in clock parent
    lookup
  clk: zynqmp: Fix unchecked type index into clock topology tables

 drivers/clk/zynqmp/clkc.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)


base-commit: 19cc08c1a6a650f8e54c0461ff198be6448f425d
-- 
2.43.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-12-01 13:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01  6:43 [PATCH 0/3] clk: zynqmp: fix out-of-bounds accesses in firmware clock parsing Radhey Shyam Pandey
2026-12-01  6:43 ` [PATCH 1/3] clk: zynqmp: Fix off-by-one loop bound in zynqmp_clock_get_topology() Radhey Shyam Pandey
2026-12-01 13:21   ` Prasanna Kumar T S M
2026-12-01  6:43 ` [PATCH 2/3] clk: zynqmp: Fix unbounded parent array overflow in clock parent lookup Radhey Shyam Pandey
2026-12-01 13:34   ` Prasanna Kumar T S M
2026-12-01  6:43 ` [PATCH 3/3] clk: zynqmp: Fix unchecked type index into clock topology tables Radhey Shyam Pandey
2026-12-01  6:54   ` sashiko-bot
2026-12-01 13:21   ` Prasanna Kumar T S M

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox