History

bpf: Fix bpf jit kallsym access

Jiri reported crash when JIT is on, but net.core.bpf_jit_kallsyms is off. bpf_prog_kallsyms_find() was skipping addr->bpf_prog resolution logic in oops and stack traces. That's incorrect. It should only skip addr->name resolution for 'cat /proc/kallsyms'. That's what bpf_jit_kallsyms and bpf_jit_harden protect.

Alexei Starovoitov committed 7 years ago

Commit af91acb1 parent cf204a71 file · +0 −3Browse files

Unified · Split

kernel/bpf/core.c+0−3
@@ -668,9 +668,6 @@ static struct bpf_prog *bpf_prog_kallsyms_find(unsigned long addr) · 667 unmodified lines
668668 {
669669 struct latch_tree_node *n;
670670
671− if (!bpf_jit_kallsyms_enabled())
672− return NULL;
673−
674671 n = latch_tree_find((void *)addr, &bpf_tree, &bpf_tree_ops);
675672 return n ?
676673 container_of(n, struct bpf_prog_aux, ksym_tnode)->prog :

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