All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] platform: generic: allwinner: avoid buffer overrun
@ 2022-12-27 11:01 Heinrich Schuchardt
  2022-12-27 11:46 ` Bin Meng
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Heinrich Schuchardt @ 2022-12-27 11:01 UTC (permalink / raw)
  To: opensbi

plic_priority_save() and plic_priority_restore() access indexes 1 to num of
the passed array. Avoid a buffer overrun by increasing the used array size
by one.

Addresses-Coverity-ID: 1530251 ("Out-of-bounds access")
Addresses-Coverity-ID: 1530252 ("Out-of-bounds access")
Fixes: 8509e46ca63a ("lib: utils/irqchip: plic: Ensure no out-of-bound access in priority save/restore helpers")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
 platform/generic/allwinner/sun20i-d1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/platform/generic/allwinner/sun20i-d1.c b/platform/generic/allwinner/sun20i-d1.c
index 1da9e5b..9891ad0 100644
--- a/platform/generic/allwinner/sun20i-d1.c
+++ b/platform/generic/allwinner/sun20i-d1.c
@@ -72,7 +72,7 @@ static void sun20i_d1_csr_restore(void)
 #define PLIC_SOURCES			176
 #define PLIC_IE_WORDS			((PLIC_SOURCES + 31) / 32)
 
-static u8 plic_priority[PLIC_SOURCES];
+static u8 plic_priority[PLIC_SOURCES + 1];
 static u32 plic_sie[PLIC_IE_WORDS];
 static u32 plic_threshold;
 
-- 
2.37.2



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

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

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-27 11:01 [PATCH 1/1] platform: generic: allwinner: avoid buffer overrun Heinrich Schuchardt
2022-12-27 11:46 ` Bin Meng
2022-12-27 12:01   ` Heinrich Schuchardt
2022-12-27 12:07     ` Bin Meng
2022-12-27 13:03       ` Andreas Schwab
2022-12-27 13:13         ` Bin Meng
2022-12-27 13:36           ` Andreas Schwab
2022-12-27 13:49             ` Bin Meng
2022-12-27 14:06               ` Andreas Schwab
2022-12-27 18:22           ` Samuel Holland
2022-12-27 18:39             ` Andreas Schwab
2022-12-27 18:49               ` Samuel Holland
2022-12-27 18:52                 ` Andreas Schwab
2022-12-27 19:12                   ` Samuel Holland
2022-12-27 19:31                     ` Andreas Schwab
2022-12-27 12:05 ` Andreas Schwab
2022-12-27 12:28   ` Heinrich Schuchardt
2022-12-27 12:41     ` Bin Meng
2023-01-13 12:04 ` Anup Patel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.