mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Walmsley <pjw@kernel.org>
To: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: torvalds@linux-foundation.org, tglx@linutronix.de,
	peterz@infradead.org, broonie@kernel.org
Subject: [PATCH 0/6] Restructure per-task CFI prctl() and ptrace interfaces
Date: Fri,  3 Apr 2026 19:40:56 -0600	[thread overview]
Message-ID: <177526680875.878386.16551569883089050686.stgit@seppa> (raw)

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


             reply	other threads:[~2026-04-04  1:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-04  1:40 Paul Walmsley [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=177526680875.878386.16551569883089050686.stgit@seppa \
    --to=pjw@kernel.org \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®