linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] riscv/ptrace: add new regset to access original a0 register
@ 2024-12-03  9:30 Celeste Liu
  2024-12-03  9:30 ` [PATCH v2 1/2] " Celeste Liu
  2024-12-03  9:30 ` [PATCH v2 2/2] riscv: selftests: Add a ptrace test to verify syscall parameter modification Celeste Liu
  0 siblings, 2 replies; 11+ messages in thread
From: Celeste Liu @ 2024-12-03  9:30 UTC (permalink / raw)
  To: Oleg Nesterov, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Eric Biederman, Kees Cook, Shuah Khan
  Cc: Alexandre Ghiti, Dmitry V. Levin, Andrea Bolognani,
	Björn Töpel, Thomas Gleixner, Ron Economos,
	Charlie Jenkins, Quan Zhou, Felix Yan, Ruizhe Pan, Shiqi Zhang,
	Guo Ren, Yao Zi, Han Gao, linux-riscv, linux-kernel, linux-mm,
	stable, linux-kselftest, Celeste Liu

The orig_a0 is missing in struct user_regs_struct of riscv, and there is
no way to add it without breaking UAPI. (See Link tag below)

Like NT_ARM_SYSTEM_CALL do, we add a new regset name NT_RISCV_ORIG_A0 to
access original a0 register from userspace via ptrace API.

Link: https://lore.kernel.org/all/59505464-c84a-403d-972f-d4b2055eeaac@gmail.com/

Signed-off-by: Celeste Liu <uwu@coelacanthus.name>
---
Changes in v2:
- Fix integer width.
- Add selftest.
- Link to v1: https://lore.kernel.org/r/20241201-riscv-new-regset-v1-1-c83c58abcc7b@coelacanthus.name

---
Celeste Liu (1):
      riscv/ptrace: add new regset to access original a0 register

Charlie Jenkins (1):
      riscv: selftests: Add a ptrace test to verify syscall parameter modification

 arch/riscv/kernel/ptrace.c                   |  32 +++++++
 include/uapi/linux/elf.h                     |   1 +
 tools/testing/selftests/riscv/abi/.gitignore |   1 +
 tools/testing/selftests/riscv/abi/Makefile   |   5 +-
 tools/testing/selftests/riscv/abi/ptrace.c   | 134 +++++++++++++++++++++++++++
 5 files changed, 172 insertions(+), 1 deletion(-)
---
base-commit: 0e287d31b62bb53ad81d5e59778384a40f8b6f56
change-id: 20241201-riscv-new-regset-d529b952ad0d

Best regards,
-- 
Celeste Liu <uwu@coelacanthus.name>



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

end of thread, other threads:[~2024-12-26 11:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-03  9:30 [PATCH v2 0/2] riscv/ptrace: add new regset to access original a0 register Celeste Liu
2024-12-03  9:30 ` [PATCH v2 1/2] " Celeste Liu
2024-12-03 11:35   ` Björn Töpel
2024-12-05 17:40   ` Alexandre Ghiti
2024-12-03  9:30 ` [PATCH v2 2/2] riscv: selftests: Add a ptrace test to verify syscall parameter modification Celeste Liu
2024-12-03 11:38   ` Björn Töpel
2024-12-03 12:55   ` Andrew Jones
2024-12-19 18:26     ` Charlie Jenkins
2024-12-19 21:29       ` Celeste Liu
2024-12-19 21:36         ` Charlie Jenkins
2024-12-26 11:04           ` Celeste Liu

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