Re: [PATCH 1/1] tracing, bpf: Implement function bpf_probe_write

2016-07-19 Thread Alexei Starovoitov
On Mon, Jul 18, 2016 at 03:57:17AM -0700, Sargun Dhillon wrote: > > > On Sun, 17 Jul 2016, Alexei Starovoitov wrote: > > >On Sun, Jul 17, 2016 at 03:19:13AM -0700, Sargun Dhillon wrote: > >> > >>+static u64 bpf_copy_to_user(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5) > >>+{ > >>+ void *to = (void

Re: [PATCH 1/1] tracing, bpf: Implement function bpf_probe_write

2016-07-19 Thread Alexei Starovoitov
On Mon, Jul 18, 2016 at 03:57:17AM -0700, Sargun Dhillon wrote: > > > On Sun, 17 Jul 2016, Alexei Starovoitov wrote: > > >On Sun, Jul 17, 2016 at 03:19:13AM -0700, Sargun Dhillon wrote: > >> > >>+static u64 bpf_copy_to_user(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5) > >>+{ > >>+ void *to = (void

Re: [PATCH 1/1] tracing, bpf: Implement function bpf_probe_write

2016-07-18 Thread Sargun Dhillon
On Sun, 17 Jul 2016, Alexei Starovoitov wrote: On Sun, Jul 17, 2016 at 03:19:13AM -0700, Sargun Dhillon wrote: +static u64 bpf_copy_to_user(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5) +{ + void *to = (void *) (long) r1; + void *from = (void *) (long) r2; + int size = (int)

Re: [PATCH 1/1] tracing, bpf: Implement function bpf_probe_write

2016-07-18 Thread Sargun Dhillon
On Sun, 17 Jul 2016, Alexei Starovoitov wrote: On Sun, Jul 17, 2016 at 03:19:13AM -0700, Sargun Dhillon wrote: +static u64 bpf_copy_to_user(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5) +{ + void *to = (void *) (long) r1; + void *from = (void *) (long) r2; + int size = (int)

Re: [PATCH 1/1] tracing, bpf: Implement function bpf_probe_write

2016-07-17 Thread Alexei Starovoitov
On Sun, Jul 17, 2016 at 03:19:13AM -0700, Sargun Dhillon wrote: > > +static u64 bpf_copy_to_user(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5) > +{ > + void *to = (void *) (long) r1; > + void *from = (void *) (long) r2; > + int size = (int) r3; > + > + /* check if we're in a user

Re: [PATCH 1/1] tracing, bpf: Implement function bpf_probe_write

2016-07-17 Thread Alexei Starovoitov
On Sun, Jul 17, 2016 at 03:19:13AM -0700, Sargun Dhillon wrote: > > +static u64 bpf_copy_to_user(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5) > +{ > + void *to = (void *) (long) r1; > + void *from = (void *) (long) r2; > + int size = (int) r3; > + > + /* check if we're in a user

Re: [PATCH 1/1] tracing, bpf: Implement function bpf_probe_write

2016-07-17 Thread Sargun Dhillon
On Fri, 15 Jul 2016, Alexei Starovoitov wrote: On Fri, Jul 15, 2016 at 07:16:01PM -0700, Sargun Dhillon wrote: On Thu, 14 Jul 2016, Alexei Starovoitov wrote: On Wed, Jul 13, 2016 at 01:31:57PM -0700, Sargun Dhillon wrote: On Wed, 13 Jul 2016, Alexei Starovoitov wrote: On Wed, Jul

Re: [PATCH 1/1] tracing, bpf: Implement function bpf_probe_write

2016-07-17 Thread Sargun Dhillon
On Fri, 15 Jul 2016, Alexei Starovoitov wrote: On Fri, Jul 15, 2016 at 07:16:01PM -0700, Sargun Dhillon wrote: On Thu, 14 Jul 2016, Alexei Starovoitov wrote: On Wed, Jul 13, 2016 at 01:31:57PM -0700, Sargun Dhillon wrote: On Wed, 13 Jul 2016, Alexei Starovoitov wrote: On Wed, Jul

Re: [PATCH 1/1] tracing, bpf: Implement function bpf_probe_write

2016-07-15 Thread Alexei Starovoitov
On Fri, Jul 15, 2016 at 07:16:01PM -0700, Sargun Dhillon wrote: > > > On Thu, 14 Jul 2016, Alexei Starovoitov wrote: > > >On Wed, Jul 13, 2016 at 01:31:57PM -0700, Sargun Dhillon wrote: > >> > >> > >>On Wed, 13 Jul 2016, Alexei Starovoitov wrote: > >> > >>>On Wed, Jul 13, 2016 at 03:36:11AM

Re: [PATCH 1/1] tracing, bpf: Implement function bpf_probe_write

2016-07-15 Thread Alexei Starovoitov
On Fri, Jul 15, 2016 at 07:16:01PM -0700, Sargun Dhillon wrote: > > > On Thu, 14 Jul 2016, Alexei Starovoitov wrote: > > >On Wed, Jul 13, 2016 at 01:31:57PM -0700, Sargun Dhillon wrote: > >> > >> > >>On Wed, 13 Jul 2016, Alexei Starovoitov wrote: > >> > >>>On Wed, Jul 13, 2016 at 03:36:11AM

Re: [PATCH 1/1] tracing, bpf: Implement function bpf_probe_write

2016-07-15 Thread Sargun Dhillon
On Thu, 14 Jul 2016, Alexei Starovoitov wrote: On Wed, Jul 13, 2016 at 01:31:57PM -0700, Sargun Dhillon wrote: On Wed, 13 Jul 2016, Alexei Starovoitov wrote: On Wed, Jul 13, 2016 at 03:36:11AM -0700, Sargun Dhillon wrote: Provides BPF programs, attached to kprobes a safe way to write to

Re: [PATCH 1/1] tracing, bpf: Implement function bpf_probe_write

2016-07-15 Thread Sargun Dhillon
On Thu, 14 Jul 2016, Alexei Starovoitov wrote: On Wed, Jul 13, 2016 at 01:31:57PM -0700, Sargun Dhillon wrote: On Wed, 13 Jul 2016, Alexei Starovoitov wrote: On Wed, Jul 13, 2016 at 03:36:11AM -0700, Sargun Dhillon wrote: Provides BPF programs, attached to kprobes a safe way to write to

Re: [PATCH 1/1] tracing, bpf: Implement function bpf_probe_write

2016-07-14 Thread Alexei Starovoitov
On Wed, Jul 13, 2016 at 01:31:57PM -0700, Sargun Dhillon wrote: > > > On Wed, 13 Jul 2016, Alexei Starovoitov wrote: > > > On Wed, Jul 13, 2016 at 03:36:11AM -0700, Sargun Dhillon wrote: > >> Provides BPF programs, attached to kprobes a safe way to write to > >> memory referenced by probes.

Re: [PATCH 1/1] tracing, bpf: Implement function bpf_probe_write

2016-07-14 Thread Alexei Starovoitov
On Wed, Jul 13, 2016 at 01:31:57PM -0700, Sargun Dhillon wrote: > > > On Wed, 13 Jul 2016, Alexei Starovoitov wrote: > > > On Wed, Jul 13, 2016 at 03:36:11AM -0700, Sargun Dhillon wrote: > >> Provides BPF programs, attached to kprobes a safe way to write to > >> memory referenced by probes.

Re: [PATCH 1/1] tracing, bpf: Implement function bpf_probe_write

2016-07-13 Thread Sargun Dhillon
On Wed, 13 Jul 2016, Alexei Starovoitov wrote: > On Wed, Jul 13, 2016 at 03:36:11AM -0700, Sargun Dhillon wrote: >> Provides BPF programs, attached to kprobes a safe way to write to >> memory referenced by probes. This is done by making probe_kernel_write >> accessible to bpf functions via the

Re: [PATCH 1/1] tracing, bpf: Implement function bpf_probe_write

2016-07-13 Thread Sargun Dhillon
On Wed, 13 Jul 2016, Alexei Starovoitov wrote: > On Wed, Jul 13, 2016 at 03:36:11AM -0700, Sargun Dhillon wrote: >> Provides BPF programs, attached to kprobes a safe way to write to >> memory referenced by probes. This is done by making probe_kernel_write >> accessible to bpf functions via the

Re: [PATCH 1/1] tracing, bpf: Implement function bpf_probe_write

2016-07-13 Thread Alexei Starovoitov
On Wed, Jul 13, 2016 at 03:36:11AM -0700, Sargun Dhillon wrote: > Provides BPF programs, attached to kprobes a safe way to write to > memory referenced by probes. This is done by making probe_kernel_write > accessible to bpf functions via the bpf_probe_write helper. not quite :) > Signed-off-by:

Re: [PATCH 1/1] tracing, bpf: Implement function bpf_probe_write

2016-07-13 Thread Alexei Starovoitov
On Wed, Jul 13, 2016 at 03:36:11AM -0700, Sargun Dhillon wrote: > Provides BPF programs, attached to kprobes a safe way to write to > memory referenced by probes. This is done by making probe_kernel_write > accessible to bpf functions via the bpf_probe_write helper. not quite :) > Signed-off-by:

[PATCH 1/1] tracing, bpf: Implement function bpf_probe_write

2016-07-13 Thread Sargun Dhillon
Provides BPF programs, attached to kprobes a safe way to write to memory referenced by probes. This is done by making probe_kernel_write accessible to bpf functions via the bpf_probe_write helper. Signed-off-by: Sargun Dhillon --- include/uapi/linux/bpf.h | 3 +++

[PATCH 1/1] tracing, bpf: Implement function bpf_probe_write

2016-07-13 Thread Sargun Dhillon
Provides BPF programs, attached to kprobes a safe way to write to memory referenced by probes. This is done by making probe_kernel_write accessible to bpf functions via the bpf_probe_write helper. Signed-off-by: Sargun Dhillon --- include/uapi/linux/bpf.h | 3 +++ kernel/trace/bpf_trace.c |