From: Aaron Conole <aconole@bytheb.org>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH 1/2 nf] netfilter: nf_queue: don't re-enter same hook on packet reinjection
Date: Thu, 13 Oct 2016 09:36:44 -0400 [thread overview]
Message-ID: <f7tinswmkur.fsf@redhat.com> (raw)
In-Reply-To: <1476350587-2837-1-git-send-email-pablo@netfilter.org> (Pablo Neira Ayuso's message of "Thu, 13 Oct 2016 11:23:06 +0200")
Pablo Neira Ayuso <pablo@netfilter.org> writes:
> 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>
> ---
> I managed to reproduce this with a simple test.
>
> # iptables -I OUTPUT -j QUEUE
> # cd libnetfilter_queue/utils/
> # ./nfqnl_test
>
> Without my patch, netfilter munches packets that are reinjected.
>
> @Aaron: Please, I'd appreciate if you can have a look to confirm this bug
> and the fix. Thanks.
Looks like I missed this in my testing.
Reviewed-by: Aaron Conole <aconole@bytheb.org>
> net/netfilter/nf_queue.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/net/netfilter/nf_queue.c b/net/netfilter/nf_queue.c
> index 96964a0070e1..221d7a5c2fec 100644
> --- a/net/netfilter/nf_queue.c
> +++ b/net/netfilter/nf_queue.c
> @@ -184,6 +184,7 @@ void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict)
> verdict = NF_DROP;
> }
>
> + hook_entry = rcu_dereference(hook_entry->next);
> entry->state.thresh = INT_MIN;
>
> if (verdict == NF_ACCEPT) {
prev parent reply other threads:[~2016-10-13 13:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-13 9:23 [PATCH 1/2 nf] netfilter: nf_queue: don't re-enter same hook on packet reinjection Pablo Neira Ayuso
2016-10-13 9:23 ` [PATCH 2/2 nf] netfilter: nft_range: validate operation netlink attribute Pablo Neira Ayuso
2016-10-13 13:36 ` Aaron Conole [this message]
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=f7tinswmkur.fsf@redhat.com \
--to=aconole@bytheb.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.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 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.