u-boot/drivers/clk/sunxi
Samuel Holland 6827aba348 clk: sunxi: Prevent out-of-bounds gate array access
Because the gate arrays are not given explicit sizes, the arrays are
only as large as the highest-numbered gate described in the driver.
However, only a subset of the CCU clocks are needed by U-Boot. So there
are valid clock specifiers with indexes greater than the size of the
arrays. Referencing any of these clocks causes out-of-bounds access.
Fix this by checking the identifier against the size of the array.

Fixes: 0d47bc7056 ("clk: Add Allwinner A64 CLK driver")
Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2022-07-18 09:37:49 +01:00
..
clk_a10.c clk: sunxi: Store the array sizes in the CCU descriptor 2022-07-18 09:37:49 +01:00
clk_a10s.c clk: sunxi: Store the array sizes in the CCU descriptor 2022-07-18 09:37:49 +01:00
clk_a23.c clk: sunxi: Store the array sizes in the CCU descriptor 2022-07-18 09:37:49 +01:00
clk_a31.c clk: sunxi: Store the array sizes in the CCU descriptor 2022-07-18 09:37:49 +01:00
clk_a31_r.c clk: sunxi: Store the array sizes in the CCU descriptor 2022-07-18 09:37:49 +01:00
clk_a64.c clk: sunxi: Store the array sizes in the CCU descriptor 2022-07-18 09:37:49 +01:00
clk_a80.c clk: sunxi: Store the array sizes in the CCU descriptor 2022-07-18 09:37:49 +01:00
clk_a83t.c clk: sunxi: Store the array sizes in the CCU descriptor 2022-07-18 09:37:49 +01:00
clk_f1c100s.c clk: sunxi: Store the array sizes in the CCU descriptor 2022-07-18 09:37:49 +01:00
clk_h3.c clk: sunxi: Store the array sizes in the CCU descriptor 2022-07-18 09:37:49 +01:00
clk_h6.c clk: sunxi: Store the array sizes in the CCU descriptor 2022-07-18 09:37:49 +01:00
clk_h6_r.c clk: sunxi: Store the array sizes in the CCU descriptor 2022-07-18 09:37:49 +01:00
clk_h616.c clk: sunxi: Store the array sizes in the CCU descriptor 2022-07-18 09:37:49 +01:00
clk_r40.c clk: sunxi: Store the array sizes in the CCU descriptor 2022-07-18 09:37:49 +01:00
clk_sun6i_rtc.c clk: sunxi: Add additional RTC compatible strings 2022-06-26 11:22:53 +01:00
clk_sunxi.c clk: sunxi: Prevent out-of-bounds gate array access 2022-07-18 09:37:49 +01:00
clk_v3s.c clk: sunxi: Store the array sizes in the CCU descriptor 2022-07-18 09:37:49 +01:00
Kconfig clk: sunxi: implement clock driver for suniv f1c100s 2022-05-23 00:37:51 +01:00
Makefile clk: sunxi: implement clock driver for suniv f1c100s 2022-05-23 00:37:51 +01:00