Skip to content

Support for zisslpcfi in opensbi

Deepak Gupta opensbi 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2include: adding support for zsslpcfi encodingsinclude/sbi/riscv_encoding.h include/sbi/sbi_hart.h+6 -01 reply
2/2lib: sbi: zsslpcfi detection and elp cfi state reflect back in statusinclude/sbi/riscv_encoding.h lib/sbi/sbi_hart.c lib/sbi/sbi_trap.c+41 -02 replies
2/2lib: sbi: zsslpcfi detection and elp cfi state reflect back in status+0 -01 reply
2/2lib: sbi: zsslpcfi detection and elp cfi state reflect back in status+0 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH Zisslpcfi 0/2] Support for zisslpcfi in opensbi

Zisslpcfi [1] extension extends risc-v architecture to mitigate against control-flow integrity attacks (ROP/JOP/COP).

Zisslpcfi uses bits (b23-b29) in (m/s/vs) status CSR for enabling cfi in lesser privileged mode and record cfi state. One such state is expected landing pad (ELP). If forward cfi is enabled, indirect call/jmp updates hart's ELP state (1bit) to true. ELP state is cleared only by a landing pad instruction else trap is delivered with ELP state recorded in sstatus CSR.

This two patch series adds following changes to opensbi
- Adds support in opensbi to detect zisslpcfi
- trap redirection updates ELP state accordingly

[1] - https://github.com/riscv/riscv-cfi

Deepak Gupta (2):
include: adding support for zsslpcfi encodings
lib: sbi: zsslpcfi detection and elp cfi state reflect back in status

 include/sbi/riscv_encoding.h |  6 ++++++
 include/sbi/sbi_hart.h       |  2 ++
 lib/sbi/sbi_hart.c           | 21 +++++++++++++++++++++
 lib/sbi/sbi_trap.c           | 18 ++++++++++++++++++
 4 files changed, 47 insertions(+)
Signature · 1 line
2.25.1