Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-14 Thread Ingo Molnar
* Josef Bacik wrote: > > > Then 'not crashing kernel' requirement will be preserved. > > > btrfs or whatever else we will be testing with override_return > > > will be functioning in 'stress test' mode and if bpf program > > > is not careful and returns error all the time

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-14 Thread Ingo Molnar
* Josef Bacik wrote: > > > Then 'not crashing kernel' requirement will be preserved. > > > btrfs or whatever else we will be testing with override_return > > > will be functioning in 'stress test' mode and if bpf program > > > is not careful and returns error all the time then one particular >

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-13 Thread Josef Bacik
On Sun, Nov 12, 2017 at 11:38:24AM +0100, Ingo Molnar wrote: > > * Alexei Starovoitov wrote: > > > > One of the major advantages of having an in-kernel BPF sandbox is to > > > never > > > crash the kernel - and allowing BPF programs to just randomly modify the > > > return value

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-13 Thread Josef Bacik
On Sun, Nov 12, 2017 at 11:38:24AM +0100, Ingo Molnar wrote: > > * Alexei Starovoitov wrote: > > > > One of the major advantages of having an in-kernel BPF sandbox is to > > > never > > > crash the kernel - and allowing BPF programs to just randomly modify the > > > return value of kernel

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-12 Thread Ingo Molnar
* Alexei Starovoitov wrote: > > One of the major advantages of having an in-kernel BPF sandbox is to never > > crash the kernel - and allowing BPF programs to just randomly modify the > > return value of kernel functions sounds immensely broken to me. > > > > (And yes, I realize

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-12 Thread Ingo Molnar
* Alexei Starovoitov wrote: > > One of the major advantages of having an in-kernel BPF sandbox is to never > > crash the kernel - and allowing BPF programs to just randomly modify the > > return value of kernel functions sounds immensely broken to me. > > > > (And yes, I realize that kprobes

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-11 Thread Alexei Starovoitov
On 11/11/17 4:14 PM, Ingo Molnar wrote: * Josef Bacik wrote: On Fri, Nov 10, 2017 at 10:34:59AM +0100, Ingo Molnar wrote: * Josef Bacik wrote: @@ -551,6 +578,10 @@ static const struct bpf_func_proto *kprobe_prog_func_proto(enum bpf_func_id

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-11 Thread Alexei Starovoitov
On 11/11/17 4:14 PM, Ingo Molnar wrote: * Josef Bacik wrote: On Fri, Nov 10, 2017 at 10:34:59AM +0100, Ingo Molnar wrote: * Josef Bacik wrote: @@ -551,6 +578,10 @@ static const struct bpf_func_proto *kprobe_prog_func_proto(enum bpf_func_id func return

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-11 Thread Josef Bacik
On Sat, Nov 11, 2017 at 09:14:55AM +0100, Ingo Molnar wrote: > > * Josef Bacik wrote: > > > On Fri, Nov 10, 2017 at 10:34:59AM +0100, Ingo Molnar wrote: > > > > > > * Josef Bacik wrote: > > > > > > > @@ -551,6 +578,10 @@ static const struct

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-11 Thread Josef Bacik
On Sat, Nov 11, 2017 at 09:14:55AM +0100, Ingo Molnar wrote: > > * Josef Bacik wrote: > > > On Fri, Nov 10, 2017 at 10:34:59AM +0100, Ingo Molnar wrote: > > > > > > * Josef Bacik wrote: > > > > > > > @@ -551,6 +578,10 @@ static const struct bpf_func_proto > > > >

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-11 Thread Ingo Molnar
* Josef Bacik wrote: > On Fri, Nov 10, 2017 at 10:34:59AM +0100, Ingo Molnar wrote: > > > > * Josef Bacik wrote: > > > > > @@ -551,6 +578,10 @@ static const struct bpf_func_proto > > > *kprobe_prog_func_proto(enum bpf_func_id func > > >

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-11 Thread Ingo Molnar
* Josef Bacik wrote: > On Fri, Nov 10, 2017 at 10:34:59AM +0100, Ingo Molnar wrote: > > > > * Josef Bacik wrote: > > > > > @@ -551,6 +578,10 @@ static const struct bpf_func_proto > > > *kprobe_prog_func_proto(enum bpf_func_id func > > > return _get_stackid_proto; > > > case

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-10 Thread Josef Bacik
On Fri, Nov 10, 2017 at 10:34:59AM +0100, Ingo Molnar wrote: > > * Josef Bacik wrote: > > > @@ -551,6 +578,10 @@ static const struct bpf_func_proto > > *kprobe_prog_func_proto(enum bpf_func_id func > > return _get_stackid_proto; > > case

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-10 Thread Josef Bacik
On Fri, Nov 10, 2017 at 10:34:59AM +0100, Ingo Molnar wrote: > > * Josef Bacik wrote: > > > @@ -551,6 +578,10 @@ static const struct bpf_func_proto > > *kprobe_prog_func_proto(enum bpf_func_id func > > return _get_stackid_proto; > > case BPF_FUNC_perf_event_read_value: > >

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-10 Thread Ingo Molnar
* Josef Bacik wrote: > @@ -551,6 +578,10 @@ static const struct bpf_func_proto > *kprobe_prog_func_proto(enum bpf_func_id func > return _get_stackid_proto; > case BPF_FUNC_perf_event_read_value: > return _perf_event_read_value_proto; > +

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-10 Thread Ingo Molnar
* Josef Bacik wrote: > @@ -551,6 +578,10 @@ static const struct bpf_func_proto > *kprobe_prog_func_proto(enum bpf_func_id func > return _get_stackid_proto; > case BPF_FUNC_perf_event_read_value: > return _perf_event_read_value_proto; > + case

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-07 Thread Daniel Borkmann
On 11/07/2017 09:28 PM, Josef Bacik wrote: From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-07 Thread Daniel Borkmann
On 11/07/2017 09:28 PM, Josef Bacik wrote: From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very specific situations.

[PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-07 Thread Josef Bacik
From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very specific situations. Accomplish this with the

[PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-07 Thread Josef Bacik
From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very specific situations. Accomplish this with the

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-03 Thread Alexei Starovoitov
On Fri, Nov 03, 2017 at 05:52:22PM +0100, Daniel Borkmann wrote: > On 11/03/2017 03:31 PM, Josef Bacik wrote: > > On Fri, Nov 03, 2017 at 12:12:13AM +0100, Daniel Borkmann wrote: > > > Hi Josef, > > > > > > one more issue I just noticed, see comment below: > > > > > > On 11/02/2017 03:37 PM,

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-03 Thread Alexei Starovoitov
On Fri, Nov 03, 2017 at 05:52:22PM +0100, Daniel Borkmann wrote: > On 11/03/2017 03:31 PM, Josef Bacik wrote: > > On Fri, Nov 03, 2017 at 12:12:13AM +0100, Daniel Borkmann wrote: > > > Hi Josef, > > > > > > one more issue I just noticed, see comment below: > > > > > > On 11/02/2017 03:37 PM,

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-03 Thread Daniel Borkmann
On 11/03/2017 03:31 PM, Josef Bacik wrote: On Fri, Nov 03, 2017 at 12:12:13AM +0100, Daniel Borkmann wrote: Hi Josef, one more issue I just noticed, see comment below: On 11/02/2017 03:37 PM, Josef Bacik wrote: [...] diff --git a/include/linux/filter.h b/include/linux/filter.h index

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-03 Thread Daniel Borkmann
On 11/03/2017 03:31 PM, Josef Bacik wrote: On Fri, Nov 03, 2017 at 12:12:13AM +0100, Daniel Borkmann wrote: Hi Josef, one more issue I just noticed, see comment below: On 11/02/2017 03:37 PM, Josef Bacik wrote: [...] diff --git a/include/linux/filter.h b/include/linux/filter.h index

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-03 Thread Josef Bacik
On Fri, Nov 03, 2017 at 12:12:13AM +0100, Daniel Borkmann wrote: > Hi Josef, > > one more issue I just noticed, see comment below: > > On 11/02/2017 03:37 PM, Josef Bacik wrote: > [...] > > diff --git a/include/linux/filter.h b/include/linux/filter.h > > index cdd78a7beaae..dfa44fd74bae 100644 >

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-03 Thread Josef Bacik
On Fri, Nov 03, 2017 at 12:12:13AM +0100, Daniel Borkmann wrote: > Hi Josef, > > one more issue I just noticed, see comment below: > > On 11/02/2017 03:37 PM, Josef Bacik wrote: > [...] > > diff --git a/include/linux/filter.h b/include/linux/filter.h > > index cdd78a7beaae..dfa44fd74bae 100644 >

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-02 Thread Daniel Borkmann
Hi Josef, one more issue I just noticed, see comment below: On 11/02/2017 03:37 PM, Josef Bacik wrote: [...] diff --git a/include/linux/filter.h b/include/linux/filter.h index cdd78a7beaae..dfa44fd74bae 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h @@ -458,7 +458,8 @@ struct

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-02 Thread Daniel Borkmann
Hi Josef, one more issue I just noticed, see comment below: On 11/02/2017 03:37 PM, Josef Bacik wrote: [...] diff --git a/include/linux/filter.h b/include/linux/filter.h index cdd78a7beaae..dfa44fd74bae 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h @@ -458,7 +458,8 @@ struct

[PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-02 Thread Josef Bacik
From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very specific situations. Accomplish this with the

[PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-02 Thread Josef Bacik
From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very specific situations. Accomplish this with the

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-01 Thread Daniel Borkmann
On 11/01/2017 06:00 PM, Josef Bacik wrote: From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-01 Thread Daniel Borkmann
On 11/01/2017 06:00 PM, Josef Bacik wrote: From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very specific situations.

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-01 Thread Alexei Starovoitov
On 11/1/17 10:00 AM, Josef Bacik wrote: From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very specific

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-01 Thread Alexei Starovoitov
On 11/1/17 10:00 AM, Josef Bacik wrote: From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very specific situations.

[PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-01 Thread Josef Bacik
From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very specific situations. Accomplish this with the

[PATCH 1/2] bpf: add a bpf_override_function helper

2017-11-01 Thread Josef Bacik
From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very specific situations. Accomplish this with the

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-10-31 Thread Alexei Starovoitov
On 10/31/17 8:45 AM, Josef Bacik wrote: From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very specific

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-10-31 Thread Alexei Starovoitov
On 10/31/17 8:45 AM, Josef Bacik wrote: From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very specific situations.

[PATCH 1/2] bpf: add a bpf_override_function helper

2017-10-31 Thread Josef Bacik
From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very specific situations. Accomplish this with the

[PATCH 1/2] bpf: add a bpf_override_function helper

2017-10-31 Thread Josef Bacik
From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very specific situations. Accomplish this with the

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-10-30 Thread Alexei Starovoitov
On 10/30/17 2:19 PM, Josef Bacik wrote: From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very specific

Re: [PATCH 1/2] bpf: add a bpf_override_function helper

2017-10-30 Thread Alexei Starovoitov
On 10/30/17 2:19 PM, Josef Bacik wrote: From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very specific situations.

[PATCH 1/2] bpf: add a bpf_override_function helper

2017-10-30 Thread Josef Bacik
From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very specific situations. Accomplish this with the

[PATCH 1/2] bpf: add a bpf_override_function helper

2017-10-30 Thread Josef Bacik
From: Josef Bacik Error injection is sloppy and very ad-hoc. BPF could fill this niche perfectly with it's kprobe functionality. We could make sure errors are only triggered in specific call chains that we care about with very specific situations. Accomplish this with the