From: Sargun Dhillon <sargun@sargun.me>
To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Cc: alexei.starovoitov@gmail.com, daniel@iogearbox.net
Subject: [PATCH net-next v3 0/2] bpf: add copy_to_user helper & example
Date: Tue, 19 Jul 2016 02:32:16 -0700 [thread overview]
Message-ID: <20160719093214.GA23733@ircssh.c.rugged-nimbus-611.internal> (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
reply other threads:[~2016-07-19 9:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160719093214.GA23733@ircssh.c.rugged-nimbus-611.internal \
--to=sargun@sargun.me \
--cc=alexei.starovoitov@gmail.com \
--cc=daniel@iogearbox.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).