On Thu, 23 Oct 2025, Deepak Gupta via B4 Relay wrote:
From: Deepak Gupta debug@rivosinc.com
As discussed extensively in the changelog for the addition of this syscall on x86 ("x86/shstk: Introduce map_shadow_stack syscall") the existing mmap() and madvise() syscalls do not map entirely well onto the security requirements for shadow stack memory since they lead to windows where memory is allocated but not yet protected or stacks which are not properly and safely initialised. Instead a new syscall map_shadow_stack() has been defined which allocates and initialises a shadow stack page.
This patch implements this syscall for riscv. riscv doesn't require token to be setup by kernel because user mode can do that by itself. However to provide compatibility and portability with other architectues, user mode can specify token set flag.
Reviewed-by: Zong Li zong.li@sifive.com Signed-off-by: Deepak Gupta debug@rivosinc.com
This patch introduces a 'checkpatch.pl --strict' message:
CHECK: Lines should not end with a '(' #78: FILE: arch/riscv/kernel/usercfi.c:36: + asm goto(
I'll fix it up here in the event that v22 goes in, but please do the same on your side in case a new version is needed.
thanks,
- Paul