Commit ddf06c1e authored by Alexei Starovoitov's avatar Alexei Starovoitov Committed by David S. Miller

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: d23b8ad8 ("tc: add BPF based action")
Fixes: a8cb5f55 ("act_bpf: add initial eBPF support for actions")
Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Signed-off-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c0afd9ce
...@@ -339,6 +339,9 @@ static void tcf_bpf_cleanup(struct tc_action *act, int bind) ...@@ -339,6 +339,9 @@ static void tcf_bpf_cleanup(struct tc_action *act, int bind)
bpf_prog_put(prog->filter); bpf_prog_put(prog->filter);
else else
bpf_prog_destroy(prog->filter); bpf_prog_destroy(prog->filter);
kfree(prog->bpf_ops);
kfree(prog->bpf_name);
} }
static struct tc_action_ops act_bpf_ops __read_mostly = { static struct tc_action_ops act_bpf_ops __read_mostly = {
......
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