From: Tom Herbert Date: Wed, 14 Oct 2015 21:40:44 +0000 (-0700) Subject: bpf: Need to call bpf_prog_uncharge_memlock from bpf_prog_put X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ac00737f4e81;p=linux-beck.git bpf: Need to call bpf_prog_uncharge_memlock from bpf_prog_put Currently, is only called from __prog_put_rcu in the bpf_prog_release path. Need this to call this from bpf_prog_put also to get correct accounting. Fixes: aaac3ba95e4c8b49 ("bpf: charge user for creation of BPF maps and programs") Signed-off-by: Tom Herbert Acked-by: Alexei Starovoitov Acked-by: Daniel Borkmann Signed-off-by: David S. Miller --- diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index f640e5f7afbd..687dd6ca574d 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -520,6 +520,7 @@ void bpf_prog_put(struct bpf_prog *prog) { if (atomic_dec_and_test(&prog->aux->refcnt)) { free_used_maps(prog->aux); + bpf_prog_uncharge_memlock(prog); bpf_prog_free(prog); } }