diff options
author | Alexei Starovoitov <ast@plumgrid.com> | 2015-07-14 15:15:19 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-07-16 00:36:35 -0400 |
commit | ddf06c1e569a64a44c4c750ae45b2604f19e45f0 (patch) | |
tree | c029e06a270e06eb49eef9008648530e74703441 /net | |
parent | c0afd9ce4d6a646fb6433536f95a418bb348fab1 (diff) |
tc: act_bpf: fix memory leak
prog->bpf_ops is populated when act_bpf is used with classic BPF and
prog->bpf_name is optionally used with extended BPF.
Fix memory leak when act_bpf is released.
Fixes: d23b8ad8ab23 ("tc: add BPF based action")
Fixes: a8cb5f556b56 ("act_bpf: add initial eBPF support for actions")
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/sched/act_bpf.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/sched/act_bpf.c b/net/sched/act_bpf.c index 1d56903fd4c7..1df78289e248 100644 --- a/net/sched/act_bpf.c +++ b/net/sched/act_bpf.c | |||
@@ -339,6 +339,9 @@ static void tcf_bpf_cleanup(struct tc_action *act, int bind) | |||
339 | bpf_prog_put(prog->filter); | 339 | bpf_prog_put(prog->filter); |
340 | else | 340 | else |
341 | bpf_prog_destroy(prog->filter); | 341 | bpf_prog_destroy(prog->filter); |
342 | |||
343 | kfree(prog->bpf_ops); | ||
344 | kfree(prog->bpf_name); | ||
342 | } | 345 | } |
343 | 346 | ||
344 | static struct tc_action_ops act_bpf_ops __read_mostly = { | 347 | static struct tc_action_ops act_bpf_ops __read_mostly = { |