diff options
author | Stefan Wahren <[email protected]> | 2022-07-13 17:49:51 +0200 |
---|---|---|
committer | Stephen Boyd <[email protected]> | 2022-08-23 15:51:10 -0700 |
commit | bc163555603e4ae9c817675ad80d618a4cdbfa2d (patch) | |
tree | 9d88acac9a328fd40681b39fa48f6243688df5f7 /lib/test_fortify/write_overflow-strlcpy-src.c | |
parent | 35f73cca1cecda0c1f8bb7d8be4ce5cd2d46ae8c (diff) |
clk: bcm: rpi: Prevent out-of-bounds access
The while loop in raspberrypi_discover_clocks() relies on the assumption
that the id of the last clock element is zero. Because this data comes
from the Videocore firmware and it doesn't guarantuee such a behavior
this could lead to out-of-bounds access. So fix this by providing
a sentinel element.
Fixes: 93d2725affd6 ("clk: bcm: rpi: Discover the firmware clocks")
Link: https://github.com/raspberrypi/firmware/issues/1688
Suggested-by: Phil Elwell <[email protected]>
Signed-off-by: Stefan Wahren <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Acked-by: Florian Fainelli <[email protected]>
Reviewed-by: Ivan T. Ivanov <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strlcpy-src.c')
0 files changed, 0 insertions, 0 deletions