netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/2] bpf: add copy_to_user helper & example
@ 2016-07-19  7:57 Sargun Dhillon
  0 siblings, 0 replies; only message in thread
From: Sargun Dhillon @ 2016-07-19  7:57 UTC (permalink / raw)
  To: linux-kernel, netdev; +Cc: alexei.starovoitov, daniel


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

Sargun Dhillon (2):
  Add bpf_copy_to_user BPF helper to be called in tracers (kprobes)
  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 | 53 ++++++++++++++++++++++++++++++++
 samples/bpf/tracex7_user.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 177 insertions(+)
 create mode 100644 samples/bpf/tracex7_kern.c
 create mode 100644 samples/bpf/tracex7_user.c

-- 
2.7.4

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-07-19  7:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-19  7:57 [PATCH net-next v2 0/2] bpf: add copy_to_user helper & example Sargun Dhillon

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