diff options
author | Cong Wang <xiyou.wangcong@gmail.com> | 2019-08-25 20:01:32 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-09-10 12:33:39 +0300 |
commit | 38166934f89cb742fe7aae716f2661cb823d282e (patch) | |
tree | 02f9c99a1aaff199d7d6ad1a581f05048e46c00c /net/sched/act_csum.c | |
parent | 5ff0ab0c668bea6add5c879598abc759e8d9355d (diff) | |
download | linux-38166934f89cb742fe7aae716f2661cb823d282e.tar.xz |
net_sched: fix a NULL pointer deref in ipt action
[ Upstream commit 981471bd3abf4d572097645d765391533aac327d ]
The net pointer in struct xt_tgdtor_param is not explicitly
initialized therefore is still NULL when dereferencing it.
So we have to find a way to pass the correct net pointer to
ipt_destroy_target().
The best way I find is just saving the net pointer inside the per
netns struct tcf_idrinfo, which could make this patch smaller.
Fixes: 0c66dc1ea3f0 ("netfilter: conntrack: register hooks in netns when needed by ruleset")
Reported-and-tested-by: itugrok@yahoo.com
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/sched/act_csum.c')
-rw-r--r-- | net/sched/act_csum.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sched/act_csum.c b/net/sched/act_csum.c index 40437197e053..1e269441065a 100644 --- a/net/sched/act_csum.c +++ b/net/sched/act_csum.c @@ -678,7 +678,7 @@ static __net_init int csum_init_net(struct net *net) { struct tc_action_net *tn = net_generic(net, csum_net_id); - return tc_action_net_init(tn, &act_csum_ops); + return tc_action_net_init(net, tn, &act_csum_ops); } static void __net_exit csum_exit_net(struct list_head *net_list) |