bpf: fix panic in prog load calls cleanup
authorDaniel Borkmann <daniel@iogearbox.net>
Fri, 15 Jun 2018 00:30:47 +0000 (02:30 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 15 Jun 2018 18:14:25 +0000 (11:14 -0700)
commit7d1982b4e335c1b184406b7566f6041bfe313c35
tree885f83b1f8e96c502c2939838d22e63756c7b011
parent26bf8a89d887c0686acef0f44eaadd49abfcab03
bpf: fix panic in prog load calls cleanup

While testing I found that when hitting error path in bpf_prog_load()
where we jump to free_used_maps and prog contained BPF to BPF calls
that were JITed earlier, then we never clean up the bpf_prog_kallsyms_add()
done under jit_subprogs(). Add proper API to make BPF kallsyms deletion
more clear and fix that.

Fixes: 1c2a088a6626 ("bpf: x64: add JIT support for multi-function programs")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/filter.h
kernel/bpf/core.c
kernel/bpf/syscall.c