diff options
author | Florian Westphal <fw@strlen.de> | 2016-05-06 01:51:47 +0300 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-05-06 12:50:01 +0300 |
commit | 03d7dc5cdfe6fd4e5bd04cfc2be7ae259f956428 (patch) | |
tree | 154c3f3f33680d9294dd10c50eb5217f2ace6887 /net/netfilter/nf_conntrack_netlink.c | |
parent | cb39ad8b8ef224c544074962780bf763077d6141 (diff) | |
download | linux-03d7dc5cdfe6fd4e5bd04cfc2be7ae259f956428.tar.xz |
netfilter: conntrack: check netns when walking expect hash
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/nf_conntrack_netlink.c')
-rw-r--r-- | net/netfilter/nf_conntrack_netlink.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index e00f178c48b0..5dfb84d86143 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c @@ -2636,6 +2636,10 @@ restart: hnode) { if (l3proto && exp->tuple.src.l3num != l3proto) continue; + + if (!net_eq(nf_ct_net(exp->master), net)) + continue; + if (cb->args[1]) { if (exp != last) continue; @@ -2888,6 +2892,10 @@ static int ctnetlink_del_expect(struct net *net, struct sock *ctnl, hlist_for_each_entry_safe(exp, next, &net->ct.expect_hash[i], hnode) { + + if (!net_eq(nf_ct_exp_net(exp), net)) + continue; + m_help = nfct_help(exp->master); if (!strcmp(m_help->helper->name, name) && del_timer(&exp->timeout)) { @@ -2906,6 +2914,10 @@ static int ctnetlink_del_expect(struct net *net, struct sock *ctnl, hlist_for_each_entry_safe(exp, next, &net->ct.expect_hash[i], hnode) { + + if (!net_eq(nf_ct_exp_net(exp), net)) + continue; + if (del_timer(&exp->timeout)) { nf_ct_unlink_expect_report(exp, NETLINK_CB(skb).portid, |