linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv4 bpf-next 0/6] uprobe,bpf: Allow to change app registers from uprobe registers
@ 2025-09-16 21:52 Jiri Olsa
  2025-09-16 21:52 ` [PATCHv4 bpf-next 1/6] bpf: Allow uprobe program to change context registers Jiri Olsa
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Jiri Olsa @ 2025-09-16 21:52 UTC (permalink / raw)
  To: Oleg Nesterov, Masami Hiramatsu, Peter Zijlstra, Andrii Nakryiko
  Cc: bpf, linux-kernel, linux-trace-kernel, x86, Song Liu,
	Yonghong Song, John Fastabend, Hao Luo, Steven Rostedt,
	Ingo Molnar

hi,
we recently had several requests for tetragon to be able to change
user application function return value or divert its execution through
instruction pointer change.

This patchset adds support for uprobe program to change app's registers
including instruction pointer.

v4 changes:
- rebased on bpf-next/master, we will handle the future simple conflict
  with tip/perf/core
- changed condition in kprobe_prog_is_valid_access [Andrii]
- added acks

thanks,
jirka


---
Jiri Olsa (6):
      bpf: Allow uprobe program to change context registers
      uprobe: Do not emulate/sstep original instruction when ip is changed
      selftests/bpf: Add uprobe context registers changes test
      selftests/bpf: Add uprobe context ip register change test
      selftests/bpf: Add kprobe write ctx attach test
      selftests/bpf: Add kprobe multi write ctx attach test

 include/linux/bpf.h                                        |   1 +
 kernel/events/core.c                                       |   4 +++
 kernel/events/uprobes.c                                    |   7 +++++
 kernel/trace/bpf_trace.c                                   |   9 ++++--
 tools/testing/selftests/bpf/prog_tests/attach_probe.c      |  28 +++++++++++++++++
 tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c |  27 ++++++++++++++++
 tools/testing/selftests/bpf/prog_tests/uprobe.c            | 156 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 tools/testing/selftests/bpf/progs/kprobe_write_ctx.c       |  22 +++++++++++++
 tools/testing/selftests/bpf/progs/test_uprobe.c            |  38 +++++++++++++++++++++++
 9 files changed, 289 insertions(+), 3 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/progs/kprobe_write_ctx.c

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

end of thread, other threads:[~2025-09-24 10:23 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-16 21:52 [PATCHv4 bpf-next 0/6] uprobe,bpf: Allow to change app registers from uprobe registers Jiri Olsa
2025-09-16 21:52 ` [PATCHv4 bpf-next 1/6] bpf: Allow uprobe program to change context registers Jiri Olsa
2025-09-16 21:52 ` [PATCHv4 bpf-next 2/6] uprobe: Do not emulate/sstep original instruction when ip is changed Jiri Olsa
2025-09-16 22:28   ` Andrii Nakryiko
2025-09-22 20:47     ` Andrii Nakryiko
2025-09-24  8:49     ` Peter Zijlstra
2025-09-24  9:47       ` Alexei Starovoitov
2025-09-24 10:23         ` Jiri Olsa
2025-09-16 21:52 ` [PATCHv4 bpf-next 3/6] selftests/bpf: Add uprobe context registers changes test Jiri Olsa
2025-09-16 21:52 ` [PATCHv4 bpf-next 4/6] selftests/bpf: Add uprobe context ip register change test Jiri Olsa
2025-09-16 21:53 ` [PATCHv4 bpf-next 5/6] selftests/bpf: Add kprobe write ctx attach test Jiri Olsa
2025-09-16 21:53 ` [PATCHv4 bpf-next 6/6] selftests/bpf: Add kprobe multi " Jiri Olsa
2025-09-24  9:50 ` [PATCHv4 bpf-next 0/6] uprobe,bpf: Allow to change app registers from uprobe registers patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).