public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: David Miller <davem@davemloft.net>,
	netdev@vger.kernel.org, netfilter-devel@vger.kernel.org,
	Patrick McHardy <kaber@trash.net>
Subject: Re: [PATCH net] netfilter: nf_queue: Don't recompute the hook_list head
Date: Sat, 20 Jun 2015 12:58:39 +0200	[thread overview]
Message-ID: <20150620105839.GB3439@salvia> (raw)
In-Reply-To: <87381ne3rq.fsf@x220.int.ebiederm.org>

On Fri, Jun 19, 2015 at 05:23:37PM -0500, Eric W. Biederman wrote:
> 
> 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.

There is no userspace queueing for netdevice yet, so this can be route
through nf-next. Thanks.

> 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
> 

  reply	other threads:[~2015-06-20 10:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=20150620105839.GB3439@salvia \
    --to=pablo@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=ebiederm@xmission.com \
    --cc=kaber@trash.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