[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <cover.1572483054.git.daniel@iogearbox.net>
Date: Thu, 31 Oct 2019 02:00:18 +0100
From: Daniel Borkmann <daniel@...earbox.net>
To: bpf@...r.kernel.org
Cc: netdev@...r.kernel.org, ast@...nel.org, andrii.nakryiko@...il.com,
Daniel Borkmann <daniel@...earbox.net>
Subject: [PATCH bpf-next v2 0/8] Fix BPF probe memory helpers
This set adds probe_read_{user,kernel}(), probe_read_str_{user,kernel}()
helpers, fixes probe_write_user() helper and selftests. For details please
see individual patches.
Thanks!
v1 -> v2:
- standardize unsafe_ptr terminology in uapi header comment (Andrii)
- probe_read_{user,kernel}[_str] naming scheme (Andrii)
- use global data in last test case, remove relaxed_maps (Andrii)
- add strict non-pagefault kernel read funcs to avoid warning in
kernel probe read helpers (Alexei)
Daniel Borkmann (8):
uaccess: Add non-pagefault user-space write function
uaccess: Add strict non-pagefault kernel-space read function
bpf: Make use of probe_user_write in probe write helper
bpf: Add probe_read_{user,kernel} and probe_read_{user,kernel}_str helpers
bpf: Switch BPF probe insns to bpf_probe_read_kernel
bpf, samples: Use bpf_probe_read_user where appropriate
bpf, testing: Convert prog tests to probe_read_{user,kernel}{,_str} helper
bpf, testing: Add selftest to read/write sockaddr from user space
arch/x86/mm/Makefile | 2 +-
arch/x86/mm/maccess.c | 38 ++++
include/linux/uaccess.h | 16 ++
include/uapi/linux/bpf.h | 120 +++++++----
kernel/bpf/core.c | 9 +-
kernel/trace/bpf_trace.c | 187 +++++++++++++-----
mm/maccess.c | 70 ++++++-
samples/bpf/map_perf_test_kern.c | 4 +-
samples/bpf/test_map_in_map_kern.c | 4 +-
samples/bpf/test_probe_write_user_kern.c | 2 +-
tools/include/uapi/linux/bpf.h | 120 +++++++----
.../selftests/bpf/prog_tests/probe_user.c | 78 ++++++++
tools/testing/selftests/bpf/progs/kfree_skb.c | 4 +-
tools/testing/selftests/bpf/progs/pyperf.h | 67 ++++---
.../testing/selftests/bpf/progs/strobemeta.h | 36 ++--
.../selftests/bpf/progs/test_probe_user.c | 26 +++
.../selftests/bpf/progs/test_tcp_estats.c | 2 +-
17 files changed, 590 insertions(+), 195 deletions(-)
create mode 100644 arch/x86/mm/maccess.c
create mode 100644 tools/testing/selftests/bpf/prog_tests/probe_user.c
create mode 100644 tools/testing/selftests/bpf/progs/test_probe_user.c
--
2.21.0
Powered by blists - more mailing lists