[PATCH bpf-next v5 03/12] bpf: verifier: remove dead code

2019-01-22 Thread Jakub Kicinski
Instead of overwriting dead code with jmp -1 instructions remove it completely for root. Adjust verifier state and line info appropriately. v2: - adjust func_info (Alexei); - make sure first instruction retains line info (Alexei). v4: (Yonghong) - remove unnecessary if (!insn to remove) checks

Re: [PATCH bpf-next v5 03/12] bpf: verifier: remove dead code

2019-01-22 Thread Martin Lau
On Tue, Jan 22, 2019 at 04:12:51PM -0800, Jakub Kicinski wrote: > > > +static int bpf_adj_linfo_after_remove(struct bpf_verifier_env *env, u32 > > > off, > > > + u32 cnt) > > > +{ > > > + struct bpf_prog *prog = env->prog; > > > + u32 i, l_off, l_cnt, nr_linfo; > > >

Re: [PATCH bpf-next v5 03/12] bpf: verifier: remove dead code

2019-01-22 Thread Jakub Kicinski
On Tue, 22 Jan 2019 23:46:34 +, Martin Lau wrote: > > diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c > > index 71949c163b7a..fa8011409c51 100644 > > --- a/kernel/bpf/verifier.c > > +++ b/kernel/bpf/verifier.c > > @@ -6431,6 +6431,144 @@ static struct bpf_prog *bpf_patch_insn_data(st

Re: [PATCH bpf-next v5 03/12] bpf: verifier: remove dead code

2019-01-22 Thread Martin Lau
On Sat, Jan 19, 2019 at 10:06:47AM -0800, Jakub Kicinski wrote: > Instead of overwriting dead code with jmp -1 instructions > remove it completely for root. Adjust verifier state and > line info appropriately. > > v2: > - adjust func_info (Alexei); > - make sure first instruction retains line i

[PATCH bpf-next v5 03/12] bpf: verifier: remove dead code

2019-01-19 Thread Jakub Kicinski
Instead of overwriting dead code with jmp -1 instructions remove it completely for root. Adjust verifier state and line info appropriately. v2: - adjust func_info (Alexei); - make sure first instruction retains line info (Alexei). v4: (Yonghong) - remove unnecessary if (!insn to remove) checks