[PATCH 0/3] clk: zynqmp: fix out-of-bounds accesses in firmware clock parsing
Radhey Shyam Pandey
radhey.shyam.pandey at amd.com
Mon Nov 30 22:43:50 PST 2026
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
More information about the linux-arm-kernel
mailing list