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.
Unified · Split
| @@ -668,9 +668,6 @@ static struct bpf_prog *bpf_prog_kallsyms_find(unsigned long addr) · 667 unmodified lines | ||
| 668 | 668 | { |
| 669 | 669 | struct latch_tree_node *n; |
| 670 | 670 | |
| 671 | − if (!bpf_jit_kallsyms_enabled()) | |
| 672 | − return NULL; | |
| 673 | − | |
| 674 | 671 | n = latch_tree_find((void *)addr, &bpf_tree, &bpf_tree_ops); |
| 675 | 672 | return n ? |
| 676 | 673 | container_of(n, struct bpf_prog_aux, ksym_tnode)->prog : |