bpf: Need to call bpf_prog_uncharge_memlock from bpf_prog_put
Subsystems (4)
PATCH 1/1 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.
--- kernel/bpf/syscall.c | 1 + 1 file changed, 1 insertion(+)
kernel/bpf/syscall.c +1 -0
@@ -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); } }
Signature · 1 line
2.4.6
Quoted 6 lines · Tom Herbert
Currently, is only called from
__prog_put_rcuin thebpf_prog_releasepath. Need this to call this frombpf_prog_putalso to get correct accounting.Fixes commit aaac3ba95e4c8b49 ("bpf: charge user for creation of BPF maps and programs")Signed-off-by Tom Herbert<[email protected]>
ohh. right. good catch. thanks!
Quoted 5 lines · Tom Herbert
Currently, is only called from
__prog_put_rcuin thebpf_prog_releasepath. Need this to call this frombpf_prog_putalso to get correct accounting.Fixes commit aaac3ba95e4c8b49 ("bpf: charge user for creation of BPF maps and programs")
Btw, "commit" should not be part of the Fixes tag (see SubmittingPatches +187).
Quoted 1 line
Signed-off-by Tom Herbert <[email protected]>
Fix looks good to me, so:
From: Tom Herbert <[email protected]>
Date: Wed, 14 Oct 2015 14:40:44 -0700
Quoted 6 lines
Currently, is only called from
__prog_put_rcuin thebpf_prog_releasepath. Need this to call this frombpf_prog_putalso to get correct accounting.Fixes commit aaac3ba95e4c8b49 ("bpf: charge user for creation of BPF maps and programs")Signed-off-by Tom Herbert <[email protected]>
Applied, with Fixes: tag fixed.