netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: [PATCH 1/7] netfilter: nf_queue: Don't recompute the hook_list head
Date: Wed,  8 Jul 2015 11:48:14 +0200	[thread overview]
Message-ID: <1436348900-13130-2-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1436348900-13130-1-git-send-email-pablo@netfilter.org>

From: "Eric W. Biederman" <ebiederm@xmission.com>

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>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 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 cd60d39..8a8b2ab 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);
 	}
 
-- 
1.7.10.4


  reply	other threads:[~2015-07-08  9:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-08  9:48 [PATCH 0/7] Netfilter fixes for net Pablo Neira Ayuso
2015-07-08  9:48 ` Pablo Neira Ayuso [this message]
2015-07-08  9:48 ` [PATCH 2/7] netfilter: bridge: fix CONFIG_NF_DEFRAG_IPV4/6 related warnings/errors Pablo Neira Ayuso
2015-07-08  9:48 ` [PATCH 3/7] netfilter: arptables: use percpu jumpstack Pablo Neira Ayuso
2015-07-08  9:48 ` [PATCH 4/7] netfilter: bridge: don't leak skb in error paths Pablo Neira Ayuso
2015-07-08  9:48 ` [PATCH 5/7] netfilter: nfnetlink: keep going batch handling on missing modules Pablo Neira Ayuso
2015-07-08  9:48 ` [PATCH 6/7] MAINTAINER: add bridge netfilter Pablo Neira Ayuso
2015-07-08  9:48 ` [PATCH 7/7] netfilter: bridge: Use __in6_dev_get rather than in6_dev_get in br_validate_ipv6 Pablo Neira Ayuso
2015-07-09  7:03 ` [PATCH 0/7] Netfilter fixes for net David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1436348900-13130-2-git-send-email-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).