]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
netfilter: nfnetlink_queue: reject verdict request from different portid
authorLiping Zhang <liping.zhang@spreadtrum.com>
Mon, 8 Aug 2016 14:07:27 +0000 (22:07 +0800)
committerSasha Levin <alexander.levin@microsoft.com>
Sun, 20 May 2018 03:15:41 +0000 (23:15 -0400)
[ Upstream commit 00a3101f561816e58de054a470484996f78eb5eb ]

Like NFQNL_MSG_VERDICT_BATCH do, we should also reject the verdict
request when the portid is not same with the initial portid(maybe
from another process).

Fixes: 97d32cf9440d ("netfilter: nfnetlink_queue: batch verdict support")
Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com>
Reviewed-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
net/netfilter/nfnetlink_queue_core.c

index 32d0437abdd8aea11a843926608b6824b536ce64..86f7555a98d12905afc6f550c51184810823e8a2 100644 (file)
@@ -993,10 +993,8 @@ nfqnl_recv_verdict(struct sock *ctnl, struct sk_buff *skb,
        struct net *net = sock_net(ctnl);
        struct nfnl_queue_net *q = nfnl_queue_pernet(net);
 
-       queue = instance_lookup(q, queue_num);
-       if (!queue)
-               queue = verdict_instance_lookup(q, queue_num,
-                                               NETLINK_CB(skb).portid);
+       queue = verdict_instance_lookup(q, queue_num,
+                                       NETLINK_CB(skb).portid);
        if (IS_ERR(queue))
                return PTR_ERR(queue);