linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2 perf/core 0/4] uprobe,bpf: Allow to change app registers from uprobe registers
@ 2025-09-08 12:13 Jiri Olsa
  2025-09-08 12:13 ` [PATCHv2 perf/core 1/4] bpf: Allow uprobe program to change context registers Jiri Olsa
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Jiri Olsa @ 2025-09-08 12:13 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.

v2 changes:
- moving back to original change without the uniqeu/exclusive flag
  as discussed in here [1]

thanks,
jirka


[1] https://lore.kernel.org/bpf/CAEf4BzbxjRwxhJTLUgJNwR-vEbDybBpawNsRb+y+PiDsxzT=eA@mail.gmail.com/
---
Jiri Olsa (4):
      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

 include/linux/bpf.h                             |   1 +
 kernel/events/core.c                            |   4 +++
 kernel/events/uprobes.c                         |   7 +++++
 kernel/trace/bpf_trace.c                        |   3 +-
 tools/testing/selftests/bpf/prog_tests/uprobe.c | 156 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 tools/testing/selftests/bpf/progs/test_uprobe.c |  38 +++++++++++++++++++++++++
 6 files changed, 206 insertions(+), 3 deletions(-)

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

end of thread, other threads:[~2025-09-08 19:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-08 12:13 [PATCHv2 perf/core 0/4] uprobe,bpf: Allow to change app registers from uprobe registers Jiri Olsa
2025-09-08 12:13 ` [PATCHv2 perf/core 1/4] bpf: Allow uprobe program to change context registers Jiri Olsa
2025-09-08 17:20   ` Alexei Starovoitov
2025-09-08 19:36     ` Jiri Olsa
2025-09-08 12:13 ` [PATCHv2 perf/core 2/4] uprobe: Do not emulate/sstep original instruction when ip is changed Jiri Olsa
2025-09-08 12:17   ` Oleg Nesterov
2025-09-08 12:13 ` [PATCHv2 perf/core 3/4] selftests/bpf: Add uprobe context registers changes test Jiri Olsa
2025-09-08 12:13 ` [PATCHv2 perf/core 4/4] selftests/bpf: Add uprobe context ip register change test Jiri Olsa

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