]> git.ipfire.org Git - thirdparty/linux.git/commit
riscv: create a Kconfig fragment for shadow stack and landing pad support
authorDeepak Gupta <debug@rivosinc.com>
Mon, 26 Jan 2026 04:09:56 +0000 (21:09 -0700)
committerPaul Walmsley <pjw@kernel.org>
Thu, 29 Jan 2026 09:38:40 +0000 (02:38 -0700)
commit22c1e263af2ac7dad3d2af258336318ee4c4a0ae
treebdae1dbe808a6a4c4b1ffd25feaf549ff2755765
parentccad8c1336b6511e3c7ca5c02f797b1fd2cf67e1
riscv: create a Kconfig fragment for shadow stack and landing pad support

This patch creates a Kconfig fragment for shadow stack support and
landing pad instruction support. Shadow stack support and landing pad
instruction support can be enabled by selecting
'CONFIG_RISCV_USER_CFI'. Selecting 'CONFIG_RISCV_USER_CFI' wires up
the path to enumerate CPU support.  If support exists, the kernel will
support CPU-assisted user mode CFI.

If CONFIG_RISCV_USER_CFI is selected, select 'ARCH_USES_HIGH_VMA_FLAGS',
'ARCH_HAS_USER_SHADOW_STACK' and 'DYNAMIC_SIGFRAME' for riscv.

Reviewed-by: Zong Li <zong.li@sifive.com>
Signed-off-by: Deepak Gupta <debug@rivosinc.com>
Tested-by: Andreas Korb <andreas.korb@aisec.fraunhofer.de> # QEMU, custom CVA6
Tested-by: Valentin Haudiquet <valentin.haudiquet@canonical.com>
Link: https://patch.msgid.link/20251112-v5_user_cfi_series-v23-25-b55691eacf4f@rivosinc.com
[pjw@kernel.org: cleaned up patch description, Kconfig text; added CONFIG_MMU exclusion]
Signed-off-by: Paul Walmsley <pjw@kernel.org>
arch/riscv/Kconfig
arch/riscv/configs/hardening.config [new file with mode: 0644]