Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1446288

[PATCH net-next v3 0/2] bpf: add copy_to_user helper & example

From Sargun Dhillon <sargun@sargun.me>
Newsgroups linux.kernel
Subject [PATCH net-next v3 0/2] bpf: add copy_to_user helper & example
Date 2016-07-19 11:40 +0200
Message-ID <rWzFo-2he-7@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


This patch series contains two patches that add support for a copy_to_user
helper to BPF programs. This allows them to manipulate user memory during
the course of tracing. The second patch in the series has an example that
uses it, in one the intended ways to divert execution.

Thanks to Alexei Starovoitov for review, I've made changes based on his
recommendations.
---
v1->v2: restrict writing to user space, as opposed to globally
v2->v3: Fixed formatting issues

Sargun Dhillon (2):
  bpf: Add bpf_copy_to_user BPF helper to be called in tracers (kprobes)
  samples/bpf: Add example of using bpf_copy_to_user in bpf kprobes

 include/uapi/linux/bpf.h   | 11 +++++++
 kernel/trace/bpf_trace.c   | 31 +++++++++++++++++++
 samples/bpf/Makefile       |  4 +++
 samples/bpf/bpf_helpers.h  |  2 ++
 samples/bpf/tracex7_kern.c | 51 +++++++++++++++++++++++++++++++
 samples/bpf/tracex7_user.c | 75 ++++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 174 insertions(+)
 create mode 100644 samples/bpf/tracex7_kern.c
 create mode 100644 samples/bpf/tracex7_user.c

-- 
2.7.4

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH net-next v3 0/2] bpf: add copy_to_user helper & example Sargun Dhillon <sargun@sargun.me> - 2016-07-19 11:40 +0200

csiph-web