diff mbox series

[v4,22/30] riscv sigcontext: cfi state struct definition for sigcontext

Message ID 20240912231650.3740732-23-debug@rivosinc.com (mailing list archive)
State Superseded
Headers show
Series riscv control-flow integrity for usermode | expand

Checks

Context Check Description
conchuod/vmtest-fixes-PR fail merge-conflict
conchuod/vmtest-for-next-PR fail PR summary
conchuod/patch-22-test-1 fail .github/scripts/patches/tests/build_rv32_defconfig.sh took 110.89s
conchuod/patch-22-test-2 fail .github/scripts/patches/tests/build_rv64_clang_allmodconfig.sh took 942.32s
conchuod/patch-22-test-3 fail .github/scripts/patches/tests/build_rv64_gcc_allmodconfig.sh took 1152.13s
conchuod/patch-22-test-4 fail .github/scripts/patches/tests/build_rv64_nommu_k210_defconfig.sh took 17.88s
conchuod/patch-22-test-5 fail .github/scripts/patches/tests/build_rv64_nommu_virt_defconfig.sh took 19.78s
conchuod/patch-22-test-6 success .github/scripts/patches/tests/checkpatch.sh took 0.43s
conchuod/patch-22-test-7 success .github/scripts/patches/tests/dtb_warn_rv64.sh took 41.12s
conchuod/patch-22-test-8 success .github/scripts/patches/tests/header_inline.sh took 0.01s
conchuod/patch-22-test-9 success .github/scripts/patches/tests/kdoc.sh took 0.55s
conchuod/patch-22-test-10 success .github/scripts/patches/tests/module_param.sh took 0.01s
conchuod/patch-22-test-11 success .github/scripts/patches/tests/verify_fixes.sh took 0.00s
conchuod/patch-22-test-12 success .github/scripts/patches/tests/verify_signedoff.sh took 0.04s

Commit Message

Deepak Gupta Sept. 12, 2024, 11:16 p.m. UTC
Shadow stack needs to be saved and restored on signal delivery and signal
return.

sigcontext embedded in ucontext is extendible. Defining cfi state in there
which can be used to save cfi state before signal delivery and restore
cfi state on sigreturn

Signed-off-by: Deepak Gupta <debug@rivosinc.com>
---
 arch/riscv/include/uapi/asm/sigcontext.h | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/arch/riscv/include/uapi/asm/sigcontext.h b/arch/riscv/include/uapi/asm/sigcontext.h
index cd4f175dc837..c4d19a10651d 100644
--- a/arch/riscv/include/uapi/asm/sigcontext.h
+++ b/arch/riscv/include/uapi/asm/sigcontext.h
@@ -21,6 +21,9 @@  struct __sc_riscv_v_state {
 	struct __riscv_v_ext_state v_state;
 } __attribute__((aligned(16)));
 
+struct __sc_riscv_cfi_state {
+	unsigned long ss_ptr;	/* shadow stack pointer */
+};
 /*
  * Signal context structure
  *