History

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.

Jakub Kicinski committed 7 years ago

Commit 52875a01 parent e2ae4ca3 files · +186 −3Browse files

Showing the changes to include/linux (1 of 3 files). Show all

Unified · Split

include/linux/filter.h+1−0
@@ -778,6 +778,7 @@ static inline bool bpf_dump_raw_ok(void) · 777 unmodified lines
778778
779779 struct bpf_prog *bpf_patch_insn_single(struct bpf_prog *prog, u32 off,
780780 const struct bpf_insn *patch, u32 len);
781+int bpf_remove_insns(struct bpf_prog *prog, u32 off, u32 cnt);
781782
782783 void bpf_clear_redirect_map(struct bpf_map *map);
783784

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t