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.
Showing the changes to include/linux (1 of 3 files). Show all
Unified · Split
| @@ -778,6 +778,7 @@ static inline bool bpf_dump_raw_ok(void) · 777 unmodified lines | ||
| 778 | 778 | |
| 779 | 779 | struct bpf_prog *bpf_patch_insn_single(struct bpf_prog *prog, u32 off, |
| 780 | 780 | const struct bpf_insn *patch, u32 len); |
| 781 | +int bpf_remove_insns(struct bpf_prog *prog, u32 off, u32 cnt); | |
| 781 | 782 | |
| 782 | 783 | void bpf_clear_redirect_map(struct bpf_map *map); |
| 783 | 784 | |