diff options
author | Cong Wang <xiyou.wangcong@gmail.com> | 2019-08-25 10:01:32 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-08-27 15:05:58 -0700 |
commit | 981471bd3abf4d572097645d765391533aac327d (patch) | |
tree | e06afa7cebab28ab9e7a123b7a9b499450f23687 /net/sched/act_ctinfo.c | |
parent | 9e8312f5e160ade069e131d54ab8652cf0e86e1a (diff) | |
download | linux-981471bd3abf4d572097645d765391533aac327d.tar.gz linux-981471bd3abf4d572097645d765391533aac327d.tar.bz2 linux-981471bd3abf4d572097645d765391533aac327d.zip |
net_sched: fix a NULL pointer deref in ipt action
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>
Diffstat (limited to 'net/sched/act_ctinfo.c')
-rw-r--r-- | net/sched/act_ctinfo.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sched/act_ctinfo.c b/net/sched/act_ctinfo.c index 06ef74b74911..0dbcfd1dca7b 100644 --- a/net/sched/act_ctinfo.c +++ b/net/sched/act_ctinfo.c @@ -376,7 +376,7 @@ static __net_init int ctinfo_init_net(struct net *net) { struct tc_action_net *tn = net_generic(net, ctinfo_net_id); - return tc_action_net_init(tn, &act_ctinfo_ops); + return tc_action_net_init(net, tn, &act_ctinfo_ops); } static void __net_exit ctinfo_exit_net(struct list_head *net_list) |