diff options
author | Cong Wang <xiyou.wangcong@gmail.com> | 2019-08-25 10:01:32 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-09-10 10:35:05 +0100 |
commit | 505aac7f4e48fbdb7fe405103368261a7a84f3c7 (patch) | |
tree | 16f6b868fd6ce616169796e335ba68997a858f92 /net/sched/act_pedit.c | |
parent | 3c6dfd2adb7a71915ff2fb8e40e466d748078103 (diff) | |
download | linux-stable-505aac7f4e48fbdb7fe405103368261a7a84f3c7.tar.gz linux-stable-505aac7f4e48fbdb7fe405103368261a7a84f3c7.tar.bz2 linux-stable-505aac7f4e48fbdb7fe405103368261a7a84f3c7.zip |
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_pedit.c')
-rw-r--r-- | net/sched/act_pedit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c index 17360c6faeaa..cdfaa79382a2 100644 --- a/net/sched/act_pedit.c +++ b/net/sched/act_pedit.c @@ -498,7 +498,7 @@ static __net_init int pedit_init_net(struct net *net) { struct tc_action_net *tn = net_generic(net, pedit_net_id); - return tc_action_net_init(tn, &act_pedit_ops); + return tc_action_net_init(net, tn, &act_pedit_ops); } static void __net_exit pedit_exit_net(struct list_head *net_list) |