All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH nf,v2] netfilter: nf_queue: don't re-enter same hook on packet reinjection
@ 2016-10-14 10:37 Pablo Neira Ayuso
  2016-10-17 15:23 ` Aaron Conole
  0 siblings, 1 reply; 7+ messages in thread
From: Pablo Neira Ayuso @ 2016-10-14 10:37 UTC (permalink / raw)
  To: netfilter-devel; +Cc: aconole

Make sure we skip the current hook from where the packet was enqueued,
otherwise the packets gets enqueued over and over again.

Fixes: e3b37f11e6e4 ("netfilter: replace list_head with single linked list")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
v2: Make sure next hook is non-null, otherwise we are at the end of the
    hook list and we can skip nf_iterate().

 net/netfilter/nf_queue.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/netfilter/nf_queue.c b/net/netfilter/nf_queue.c
index 96964a0070e1..691e713d70f5 100644
--- a/net/netfilter/nf_queue.c
+++ b/net/netfilter/nf_queue.c
@@ -185,8 +185,9 @@ void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict)
 	}
 
 	entry->state.thresh = INT_MIN;
+	hook_entry = rcu_dereference(hook_entry->next);
 
-	if (verdict == NF_ACCEPT) {
+	if (hook_entry && verdict == NF_ACCEPT) {
 	next_hook:
 		verdict = nf_iterate(skb, &entry->state, &hook_entry);
 	}
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-10-18 19:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-14 10:37 [PATCH nf,v2] netfilter: nf_queue: don't re-enter same hook on packet reinjection Pablo Neira Ayuso
2016-10-17 15:23 ` Aaron Conole
2016-10-17 17:03   ` Pablo Neira Ayuso
2016-10-17 19:29     ` Aaron Conole
2016-10-18 15:34       ` Pablo Neira Ayuso
2016-10-18 15:45         ` Florian Westphal
2016-10-18 19:20           ` Aaron Conole

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.