diff options
| author | Samuel Holland <[email protected]> | 2022-05-09 00:29:32 -0500 |
|---|---|---|
| committer | Andre Przywara <[email protected]> | 2022-07-18 09:37:49 +0100 |
| commit | 6827aba3482d214afea3b3bc4cb2f5bddb606929 (patch) | |
| tree | c8e87a3d76f1f69ef2d1ca93d2106fbc402ca22c /include/clk | |
| parent | 49b2b0a2b6782609a9977095d9c80391de463044 (diff) | |
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: 0d47bc705651 ("clk: Add Allwinner A64 CLK driver")
Signed-off-by: Samuel Holland <[email protected]>
Reviewed-by: Andre Przywara <[email protected]>
Signed-off-by: Andre Przywara <[email protected]>
Diffstat (limited to 'include/clk')
0 files changed, 0 insertions, 0 deletions
