Commit ac00737f authored by Tom Herbert's avatar Tom Herbert Committed by David S. Miller

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: aaac3ba9 ("bpf: charge user for creation of BPF maps and programs")
Signed-off-by: default avatarTom Herbert <tom@herbertland.com>
Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a302afe9
...@@ -520,6 +520,7 @@ void bpf_prog_put(struct bpf_prog *prog) ...@@ -520,6 +520,7 @@ void bpf_prog_put(struct bpf_prog *prog)
{ {
if (atomic_dec_and_test(&prog->aux->refcnt)) { if (atomic_dec_and_test(&prog->aux->refcnt)) {
free_used_maps(prog->aux); free_used_maps(prog->aux);
bpf_prog_uncharge_memlock(prog);
bpf_prog_free(prog); bpf_prog_free(prog);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment