RISC-V updates for v7.0-rc8
Paul Walmsley
maintainerLinus,
The changes in this pull request expand abbreviations in the per-task CFI prctl() and ptrace interfaces. They also restructure the indirect branch tracking prctl() interface to follow the style of the speculation control interface, rather than the shadow stack control interface. While here, we fix a few other embarrassing bugs that we should have caught earlier, and clean up the naming of the kernel-internal architecture-common prctl() function names to expand out the abbreviations.
The hope is that these fixes can be pulled before the v7.0 release. That should clean up these userspace interfaces before upstream C libraries start using them.
thanks,
- Paul
The following changes since commit 9156585280f161fc1c3552cf1860559edb2bb7e3:
ACPI: RIMT: Add dependency between iommu and devices (2026-04-04 18:38:03 -0600)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux tags/riscv-for-linus-v7.0-rc8
for you to fetch changes up to 08ee1559052be302f1d3752f48360b89517d9f8d:
prctl: cfi: change the branch landing pad prctl()s to be more descriptive (2026-04-04 18:40:58 -0600)
----------------------------------------------------------------
RISC-V updates for v7.0-rc8
Before v7.0 is released, fix a few issues with the CFI patchset, merged earlier in v7.0-rc, that primarily affect interfaces to non-kernel code:
- Improve the prctl() interface for per-task indirect branch landing pad control to expand abbreviations and to resemble the speculation control prctl() interface
- Expand the "LP" and "SS" abbreviations in the ptrace uapi header file to "branch landing pad" and "shadow stack", to improve readability
- Fix a typo in a CFI-related macro name in the ptrace uapi header file
- Ensure that the indirect branch tracking state and shadow stack state are unlocked immediately after an exec() on the new task so that libc subsequently can control it
- While working in this area, clean up the kernel-internal, cross-architecture prctl() function names by expanding the abbreviations mentioned above
----------------------------------------------------------------
Paul Walmsley (5):
riscv: ptrace: cfi: fix "PRACE" typo in uapi header
riscv: ptrace: expand "LP" references to "branch landing pads" in uapi headers
prctl: rename branch landing pad implementation functions to be more explicit
riscv: ptrace: cfi: expand "SS" references to "shadow stack" in uapi headers
prctl: cfi: change the branch landing pad prctl()s to be more descriptive
Zong Li (1):
riscv: cfi: clear CFI lock status in start_thread()
Documentation/arch/riscv/zicfilp.rst | 63 +++++++++++++--------- arch/riscv/include/asm/usercfi.h | 8 +-- arch/riscv/include/uapi/asm/ptrace.h | 42 ++++++++------- arch/riscv/kernel/process.c | 2 + arch/riscv/kernel/ptrace.c | 22 ++++---- arch/riscv/kernel/usercfi.c | 39 +++++++------- include/linux/cpu.h | 6 +-- include/uapi/linux/prctl.h | 37 ++++++------- kernel/sys.c | 30 ++++++----- tools/perf/trace/beauty/include/uapi/linux/prctl.h | 36 ++++++------- tools/testing/selftests/riscv/cfi/cfitests.c | 13 ++--- 11 files changed, 154 insertions(+), 144 deletions(-)
vmlinux size differences in bytes (from 9156585280f1):
text data bss dec hex filename
+72 . . +72 +48 vmlinux.defconfig.gcc-15
+64 -64 . . . vmlinux.nosmp_defconfig.gcc-15
+8 +32 . +40 +28 vmlinux.rv32_defconfig.gcc-15
-8 +32 . +24 +18 vmlinux.rv32_nosmp_defconfig.gcc-15
+28 . . +28 +1c vmlinux.nommu_virt_defconfig.gcc-15
-8 . . -8 -8 vmlinux.defconfig.clang-20
-8 . . -8 -8 vmlinux.nosmp_defconfig.clang-20
-8 . . -8 -8 vmlinux.rv32_defconfig.clang-20
-8 . . -8 -8 vmlinux.rv32_nosmp_defconfig.clang-20
+36 . . +36 +24 vmlinux.nommu_virt_defconfig.clang-20
. +32 . +32 +20 vmlinux.defconfig.gcc-14
. . . . . vmlinux.nosmp_defconfig.gcc-14
. . . . . vmlinux.rv32_defconfig.gcc-14
. +32 . +32 +20 vmlinux.rv32_nosmp_defconfig.gcc-14
+44 . . +44 +2c vmlinux.nommu_virt_defconfig.gcc-14
-8 -64 . -72 -48 vmlinux.defconfig.clang-19
. . . . . vmlinux.nosmp_defconfig.clang-19
-8 . . -8 -8 vmlinux.rv32_defconfig.clang-19
-16 +32 . +16 +10 vmlinux.rv32_nosmp_defconfig.clang-19
+28 . . +28 +1c vmlinux.nommu_virt_defconfig.clang-19
-8 . . -8 -8 vmlinux.defconfig.gcc-13
-8 . . -8 -8 vmlinux.nosmp_defconfig.gcc-13
-8 +32 . +24 +18 vmlinux.rv32_defconfig.gcc-13
. . . . . vmlinux.rv32_nosmp_defconfig.gcc-13
+52 . . +52 +34 vmlinux.nommu_virt_defconfig.gcc-13
-8 . . -8 -8 vmlinux.defconfig.clang-18
. . . . . vmlinux.nosmp_defconfig.clang-18
-16 . . -16 -10 vmlinux.rv32_defconfig.clang-18
-16 +32 . +16 +10 vmlinux.rv32_nosmp_defconfig.clang-18
+28 . . +28 +1c vmlinux.nommu_virt_defconfig.clang-18
-16 . . -16 -10 vmlinux.defconfig.gcc-12
-8 . . -8 -8 vmlinux.nosmp_defconfig.gcc-12
. +32 . +32 +20 vmlinux.rv32_defconfig.gcc-12
+8 . . +8 +8 vmlinux.rv32_nosmp_defconfig.gcc-12
+28 . . +28 +1c vmlinux.nommu_virt_defconfig.gcc-12
-8 +32 . +24 +18 vmlinux.defconfig.clang-17
. +32 . +32 +20 vmlinux.nosmp_defconfig.clang-17
. +32 . +32 +20 vmlinux.rv32_defconfig.clang-17
. +32 . +32 +20 vmlinux.rv32_nosmp_defconfig.clang-17
+28 . . +28 +1c vmlinux.nommu_virt_defconfig.clang-17
. -64 . -64 -40 vmlinux.defconfig.gcc-11
-16 . . -16 -10 vmlinux.nosmp_defconfig.gcc-11
. +32 . +32 +20 vmlinux.rv32_defconfig.gcc-11
. +32 . +32 +20 vmlinux.rv32_nosmp_defconfig.gcc-11
+52 . . +52 +34 vmlinux.nommu_virt_defconfig.gcc-11
+16 . . +16 +10 vmlinux.allnoconfig.gcc-14
+4 . . +4 +4 vmlinux.allmodconfig.gcc-14
-4 . . -4 -4 vmlinux.allnoconfig.clang-19
+5440 . . +5440 +1540 vmlinux.allmodconfig.clang-19 The pull request you sent on Fri, 10 Apr 2026 16:16:33 -0600 (MDT):
The pull request you sent on Fri, 10 Apr 2026 16:16:33 -0600 (MDT):
Quoted 1 line
git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linuxtags/riscv-for-linus-v7.0-rc8
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/e774d5f1bc27a85f858bce7688509e866f8e8a4e
Thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/prtracker.html