aboutsummaryrefslogtreecommitdiff
path: root/lib/utils
diff options
context:
space:
mode:
authorAtish Patra <atishp@rivosinc.com>2022-07-20 14:50:34 -0700
committerAnup Patel <anup@brainfault.org>2022-07-30 11:25:48 +0530
commit860a376817f687db31b586ec7bcf9a1db1bce7b3 (patch)
treef967f0e5423218d4e879257fa05500670f15ede0 /lib/utils
parent83db3af5f93dbbffb599af41c58e26a24b1abc1c (diff)
downloadopensbi-860a376817f687db31b586ec7bcf9a1db1bce7b3.zip
opensbi-860a376817f687db31b586ec7bcf9a1db1bce7b3.tar.gz
opensbi-860a376817f687db31b586ec7bcf9a1db1bce7b3.tar.bz2
lib: sbi: Fix possible buffer overrun in counter validation
The active_events array is accessed with counter ID passed from the supervisor software before the counter ID bound check. This may cause a buffer overrun if a supervisor passes an invalid counter ID. Fix this by moving the access part after the bound check. Reported-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Signed-off-by: Atish Patra <atishp@rivosinc.com> Reviewed-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'lib/utils')
0 files changed, 0 insertions, 0 deletions