[PATCH 0/8] Reset more security-related CSRs

Radim Krčmář rkrcmar at ventanamicro.com
Tue Apr 15 06:19:01 PDT 2025


Hello,

there is a possible security hole in the initial state of many CSRs that
control isolation between privilege levels.

[1,2/8] are making the rest easier to implement.
The vulnerabilities get fixed in [3,4,8/8].
[5/8] fixes a loosely-related opensbi bug.

Radim Krčmář (8):
  lib: sbi: add 64 bit csr macros
  lib: sbi: use 64 bit csr macros
  lib: sbi_hart: reset hstatus
  lib: sbi_hart: reset sstateen and hstateen
  lib: sbi_hart: fix sstateen emulation
  lib: sbi_hart: reset mstateen0
  lib: sbi_hart: add Ssstateen extension
  lib: sbi_hart: properly reset Ssstateen

 include/sbi/riscv_asm.h | 21 +++++++++++++++++++
 include/sbi/sbi_hart.h  |  4 +++-
 lib/sbi/sbi_hart.c      | 46 +++++++++++++++++++++++++++--------------
 lib/sbi/sbi_timer.c     |  7 +------
 4 files changed, 55 insertions(+), 23 deletions(-)

-- 
2.48.1




More information about the opensbi mailing list