public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v6 0/2] bpf: add bpf_probe_write_user helper & example
@ 2016-07-24  3:22 Sargun Dhillon
  2016-07-24  3:50 ` Alexei Starovoitov
  0 siblings, 1 reply; 2+ messages in thread
From: Sargun Dhillon @ 2016-07-24  3:22 UTC (permalink / raw)
  To: linux-kernel, netdev; +Cc: alexei.starovoitov, daniel

This patch series contains two patches that add support for a probe_write
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, and Daniel Borkmann for review, I've made
changes based on their recommendations. 

This helper should be considered experimental, so we print a warning
to dmesg when it is along with the command and pid. A follow-up patchset
will contain a mechanism to verify the safety of the probe beyond what
was done by hand.


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

 include/uapi/linux/bpf.h                 | 10 ++++
 kernel/trace/bpf_trace.c                 | 48 ++++++++++++++++++++
 samples/bpf/Makefile                     |  4 ++
 samples/bpf/bpf_helpers.h                |  2 +
 samples/bpf/test_probe_write_user_kern.c | 52 +++++++++++++++++++++
 samples/bpf/test_probe_write_user_user.c | 78 ++++++++++++++++++++++++++++++++
 6 files changed, 194 insertions(+)
 create mode 100644 samples/bpf/test_probe_write_user_kern.c
 create mode 100644 samples/bpf/test_probe_write_user_user.c

-- 
2.7.4

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next v6 0/2] bpf: add bpf_probe_write_user helper & example
  2016-07-24  3:22 [PATCH net-next v6 0/2] bpf: add bpf_probe_write_user helper & example Sargun Dhillon
@ 2016-07-24  3:50 ` Alexei Starovoitov
  0 siblings, 0 replies; 2+ messages in thread
From: Alexei Starovoitov @ 2016-07-24  3:50 UTC (permalink / raw)
  To: Sargun Dhillon; +Cc: linux-kernel, netdev, daniel

On Sat, Jul 23, 2016 at 08:22:04PM -0700, Sargun Dhillon wrote:
> This patch series contains two patches that add support for a probe_write
> 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, and Daniel Borkmann for review, I've made
> changes based on their recommendations. 
> 
> This helper should be considered experimental, so we print a warning
> to dmesg when it is along with the command and pid. A follow-up patchset
> will contain a mechanism to verify the safety of the probe beyond what
> was done by hand.

I'd like to clarify above 'helper is experimental' meaning that
it should only be used for experiments and not production.
That's what the warning is for.
If Dave applies it, it will be permanent abi and cannot be removed.
In other words it's for debugging user apps and trying out crazy ideas.
Like we will use to experiment with different approaches around
restartable sequences and tracing.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-24  3:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-24  3:22 [PATCH net-next v6 0/2] bpf: add bpf_probe_write_user helper & example Sargun Dhillon
2016-07-24  3:50 ` Alexei Starovoitov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox