aboutsummaryrefslogtreecommitdiff
path: root/lib/utils
diff options
context:
space:
mode:
authorAtish Patra <atishp@rivosinc.com>2022-07-20 14:50:33 -0700
committerAnup Patel <anup@brainfault.org>2022-07-30 11:22:50 +0530
commit83db3af5f93dbbffb599af41c58e26a24b1abc1c (patch)
tree955e10549dd22cb3029950be3c5cc372ce384ad6 /lib/utils
parent1545afd342f2e22aaf91c4760dc5706965ec7fdf (diff)
downloadopensbi-83db3af5f93dbbffb599af41c58e26a24b1abc1c.zip
opensbi-83db3af5f93dbbffb599af41c58e26a24b1abc1c.tar.gz
opensbi-83db3af5f93dbbffb599af41c58e26a24b1abc1c.tar.bz2
lib: sbi: Add the bound check for events during config match
Currently, there is no sanity check for firmware event code. We don't see any issue as Linux kernel driver does a bound check on firmware events already. However, OpenSBI can't assume sane supervisor mode software always. Thus, an invalid event idx can cause a buffer overflow error. For hardware events, the match will fail for invalid event code anyways. However, a search is unecessary if event code is invalid. Add a event ID validation function to solve the issue. Signed-off-by: Atish Patra <atishp@rivosinc.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'lib/utils')
0 files changed, 0 insertions, 0 deletions