public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 0/6] Restructure per-task CFI prctl() and ptrace interfaces
@ 2026-04-04  1:40 Paul Walmsley
  2026-04-04  1:41 ` [PATCH 1/6] riscv: ptrace: cfi: fix "PRACE" typo in uapi header Paul Walmsley
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Paul Walmsley @ 2026-04-04  1:40 UTC (permalink / raw)
  To: linux-riscv, linux-kernel; +Cc: torvalds, tglx, peterz, broonie

Restructure the per-task CFI indirect branch landing pad prctl()
interface, as suggested by Linus [1].  In place of the current
approach, which follows the style of shadow stack control prctl()s
(PR_{GET,SET,LOCK}_SHADOW_STACK_STATUS), adopt the style of the
speculation control prctl() constants (PR_{GET,SET}_SPECULATION_CTRL).

Then, to improve readability, expand "indir_br_lp", "lpad", and
related abbreviations in the interfaces, also as requested by Linus.
While here, expand "ss" in the shadow stack ptrace macros to "shadow
stack".

While here, let's fix a few bugs in the interfaces that we should have
caught earlier:

- Fix a misspelling of "PTRACE" in one of the macros that is defined
  in a uapi header file

- Add a "lock" parameter to the state locking functions, fixing a bug
  when a locked process calls exec()

This series is intended to be applied before the v7.0 release, since
it changes user API constants.  This series applies on commit
2ff48e0382102b29cba20cdd8bf16a0f045f6e33 ("selftests: riscv: Add
braces around EXPECT_EQ()") in the RISC-V fixes branch.


- Paul

1. https://lore.kernel.org/linux-riscv/CAHk-=whhSLGZAx3N5jJpb4GLFDqH_QvS07D+6BnkPWmCEzTAgw@mail.gmail.com/

---

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(-)


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-04-05  0:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-04  1:40 [PATCH 0/6] Restructure per-task CFI prctl() and ptrace interfaces Paul Walmsley
2026-04-04  1:41 ` [PATCH 1/6] riscv: ptrace: cfi: fix "PRACE" typo in uapi header Paul Walmsley
2026-04-04  1:41 ` [PATCH 2/6] riscv: cfi: clear CFI lock status in start_thread() Paul Walmsley
2026-04-04  1:41 ` [PATCH 3/6] riscv: ptrace: expand "LP" references to "branch landing pads" in uapi headers Paul Walmsley
2026-04-04  1:41 ` [PATCH 4/6] prctl: rename branch landing pad implementation functions to be more explicit Paul Walmsley
2026-04-04  1:41 ` [PATCH 5/6] riscv: ptrace: cfi: expand "SS" references to "shadow stack" in uapi headers Paul Walmsley
2026-04-04  1:41 ` [PATCH 6/6] prctl: cfi: change the branch landing pad prctl()s to be more descriptive Paul Walmsley
2026-04-04  1:50 ` [PATCH 0/6] Restructure per-task CFI prctl() and ptrace interfaces patchwork-bot+linux-riscv
2026-04-05  0:50 ` patchwork-bot+linux-riscv

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox