All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] netfilter: nf_queue: Don't recompute the hook_list head
@ 2015-06-19 22:23 Eric W. Biederman
  2015-06-20 10:58 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 7+ messages in thread
From: Eric W. Biederman @ 2015-06-19 22:23 UTC (permalink / raw)
  To: David Miller; +Cc: Pablo Neira Ayuso, netdev, netfilter-devel, Patrick McHardy


If someone sends packets from one of the netdevice ingress hooks to
the a userspace queue, and then userspace later accepts the packet,
the netfilter code can enter an infinite loop as the list head will
never be found.

Pass in the saved list_head to avoid this.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 net/netfilter/nf_queue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netfilter/nf_queue.c b/net/netfilter/nf_queue.c
index cd60d397fe05..8a8b2abc35ff 100644
--- a/net/netfilter/nf_queue.c
+++ b/net/netfilter/nf_queue.c
@@ -213,7 +213,7 @@ void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict)
 
 	if (verdict == NF_ACCEPT) {
 	next_hook:
-		verdict = nf_iterate(&nf_hooks[entry->state.pf][entry->state.hook],
+		verdict = nf_iterate(entry->state.hook_list,
 				     skb, &entry->state, &elem);
 	}
 
-- 
2.2.1

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in

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

end of thread, other threads:[~2015-06-23 16:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-19 22:23 [PATCH net] netfilter: nf_queue: Don't recompute the hook_list head Eric W. Biederman
2015-06-20 10:58 ` Pablo Neira Ayuso
2015-06-20 14:08   ` Eric W. Biederman
2015-06-20 18:53     ` Pablo Neira Ayuso
2015-06-22 14:56       ` Eric W. Biederman
2015-06-23 16:17         ` Pablo Neira Ayuso
2015-06-23 16:23           ` Eric W. Biederman

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.