diff options
author | Tom Herbert <tom@herbertland.com> | 2015-10-14 14:40:44 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-10-16 00:55:02 -0700 |
commit | ac00737f4e8198f8ff5007c70af4dfe4fd47ea94 (patch) | |
tree | 5af06d01f20cdae4204667f9885a29c8f501eddc /kernel/bpf | |
parent | a302afe980ca6b25b2bae0b5bc816fe1dc1bb039 (diff) | |
download | op-kernel-dev-ac00737f4e8198f8ff5007c70af4dfe4fd47ea94.zip op-kernel-dev-ac00737f4e8198f8ff5007c70af4dfe4fd47ea94.tar.gz |
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 <tom@herbertland.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'kernel/bpf')
-rw-r--r-- | kernel/bpf/syscall.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index f640e5f..687dd6c 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); } } |