]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
riscv: add kernel command line option to opt out of user CFI
authorDeepak Gupta <debug@rivosinc.com>
Mon, 26 Jan 2026 04:09:55 +0000 (21:09 -0700)
committerPaul Walmsley <pjw@kernel.org>
Thu, 29 Jan 2026 09:38:40 +0000 (02:38 -0700)
commitc9b859c4d8f56c014b3d5fbd1bcfb916c34955a1
tree5497b2d56d3cf9c0d42bc20054801d77801f2c94
parent30c3099036a9544ec24e899abc8a81a7cc030f99
riscv: add kernel command line option to opt out of user CFI

Add a kernel command line option to disable part or all
of user CFI.  User backward CFI and forward CFI can be controlled
independently.  The kernel command line parameter "riscv_nousercfi" can
take the following values:
 - "all" : Disable forward and backward cfi both
 - "bcfi" : Disable backward cfi
 - "fcfi" : Disable forward cfi

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-21-b55691eacf4f@rivosinc.com
[pjw@kernel.org: fixed warnings from checkpatch; cleaned up patch description, doc, printk text]
Signed-off-by: Paul Walmsley <pjw@kernel.org>
Documentation/admin-guide/kernel-parameters.txt
arch/riscv/include/asm/usercfi.h
arch/riscv/kernel/cpufeature.c
arch/riscv/kernel/usercfi.c