diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2019-01-22 22:45:20 -0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-01-23 17:35:31 -0800 |
commit | 52875a04f4b26e7ef30a288ea096f7cfec0e93cd (patch) | |
tree | ef2b72219c9eae090adb9a35d75bc64b2b9ed50c /include | |
parent | e2ae4ca266a1c9a0163738129506dbc63d5cca80 (diff) | |
download | linux-52875a04f4b26e7ef30a288ea096f7cfec0e93cd.tar.bz2 |
bpf: verifier: remove dead code
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;
- always keep last line info if first live instruction lacks one.
v5: (Martin Lau)
- improve and clarify comments.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/filter.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/filter.h b/include/linux/filter.h index ad106d845b22..be9af6b4a9e4 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h @@ -778,6 +778,7 @@ static inline bool bpf_dump_raw_ok(void) struct bpf_prog *bpf_patch_insn_single(struct bpf_prog *prog, u32 off, const struct bpf_insn *patch, u32 len); +int bpf_remove_insns(struct bpf_prog *prog, u32 off, u32 cnt); void bpf_clear_redirect_map(struct bpf_map *map); |