lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Tue,  2 Apr 2024 11:32:59 +0200
From: Jiri Olsa <jolsa@...nel.org>
To: Steven Rostedt <rostedt@...dmis.org>,
	Masami Hiramatsu <mhiramat@...nel.org>,
	Oleg Nesterov <oleg@...hat.com>,
	Alexei Starovoitov <ast@...nel.org>,
	Daniel Borkmann <daniel@...earbox.net>,
	Andrii Nakryiko <andrii@...nel.org>
Cc: linux-kernel@...r.kernel.org,
	linux-trace-kernel@...r.kernel.org,
	bpf@...r.kernel.org,
	Song Liu <songliubraving@...com>,
	Yonghong Song <yhs@...com>,
	John Fastabend <john.fastabend@...il.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	"Borislav Petkov (AMD)" <bp@...en8.de>,
	x86@...nel.org
Subject: [PATCHv2 0/3] uprobe: uretprobe speed up

hi,
as part of the effort on speeding up the uprobes [0] coming with
return uprobe optimization by using syscall instead of the trap
on the uretprobe trampoline.

The speed up depends on instruction type that uprobe is installed
and depends on specific HW type, please check patch 1 for details.

I added extra selftests to check on registers values before and
after uretprobe to make sure the syscall saves all the needed regs
and that uprobe consumer can still change registers.

Patch 1 is based on:
  https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
  probes/for-next

and patches 2,3 are based on bpf-next/master and can be taken
separately through bpf-next tree without patch 1.

v2 changes:
  - reposted to proper tracing mailing list [Masami]
  - renamed selftest trigger functions [Andrii]
  - kept bpf_testmod register call pattern [Andrii]
  - added acks [Andrii/Oleg]

thanks,
jirka


[0] https://lore.kernel.org/bpf/ZeCXHKJ--iYYbmLj@krava/
---
Jiri Olsa (3):
      uprobe: Add uretprobe syscall to speed up return probe
      selftests/bpf: Add uretprobe syscall test for regs integrity
      selftests/bpf: Add uretprobe syscall test for regs changes

 arch/x86/entry/syscalls/syscall_64.tbl                  |   1 +
 arch/x86/kernel/uprobes.c                               |  83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/syscalls.h                                |   2 ++
 include/linux/uprobes.h                                 |   2 ++
 include/uapi/asm-generic/unistd.h                       |   5 +++-
 kernel/events/uprobes.c                                 |  18 +++++++++---
 kernel/sys_ni.c                                         |   2 ++
 tools/include/linux/compiler.h                          |   4 +++
 tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c   | 122 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c | 230 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tools/testing/selftests/bpf/progs/uprobe_syscall.c      |  15 ++++++++++
 11 files changed, 478 insertions(+), 6 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c
 create mode 100644 tools/testing/selftests/bpf/progs/uprobe_syscall.c

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ