From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Rahul Sharma <rsharma@arista.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
netfilter-devel@vger.kernel.org
Subject: Re: [PATCH net] ipv6: Prevent ipv6_find_hdr() from returning ENOENT for valid non-first fragments
Date: Thu, 08 Jan 2015 23:39:16 +0100 [thread overview]
Message-ID: <1420756756.1755002.211556745.0418D128@webmail.messagingengine.com> (raw)
In-Reply-To: <20150108205328.GA3361@salvia>
Hi Pablo,
On Thu, Jan 8, 2015, at 21:53, Pablo Neira Ayuso wrote:
> I'm afraid we cannot just get rid of that !ipv6_ext_hdr() check. The
> ipv6_find_hdr() function is designed to return the transport protocol.
> After the proposed change, it will return extension header numbers.
> This will break existing ip6tables rulesets since the `-p' option
> relies on this function to match the transport protocol.
>
> Note that the AH header is skipped (see code a bit below this
> problematic fragmentation handling) so the follow up header after the
> AH header is returned as the transport header.
>
> We can probably return the AH protocol number for non-1st fragments.
> However, that would be something new to ip6tables since nobody has
> ever seen packet matching `-p ah' rules. Thus, we restore control to
> the user to allow this, but we would accept all kind of fragmented AH
> traffic through the firewall since we cannot know what transport
> protocol contains from non-1st fragments (unless I'm missing anything,
> I need to have a closer look at this again tomorrow with fresher
> mind).
The code in question is guarded by (_frag_off != 0), so we are
definitely processing a non-1st fragment currently. The -p match would
happen at the time when the packet is reassembled and thus ipv6_find_hdr
will find the real transport (final) header at this point (I hope I
followed the code correctly here).
The next proto field of the fragmentation header is copied from the
first fragment, thus it may specify AH header but actually only in the
original (unfragmented) packet an AH header is directly following the
fragmentation header, thus the next proto chain is somewhat unstable if
looking at the fragmented packets only.
Bye,
Hannes
next prev parent reply other threads:[~2015-01-08 22:39 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-06 21:33 Rahul Sharma
2015-01-06 22:47 ` Pablo Neira Ayuso
2015-01-07 5:41 ` Rahul Sharma
2015-01-07 10:43 ` Hannes Frederic Sowa
2015-01-07 20:48 ` Rahul Sharma
2015-01-08 13:11 ` Hannes Frederic Sowa
2015-01-08 20:53 ` Pablo Neira Ayuso
2015-01-08 21:11 ` Pablo Neira Ayuso
2015-01-08 22:39 ` Hannes Frederic Sowa [this message]
2015-01-09 0:05 ` Pablo Neira Ayuso
2015-01-09 7:18 ` Rahul Sharma
2015-01-09 11:34 ` Hannes Frederic Sowa
2015-01-09 11:45 ` Pablo Neira Ayuso
2015-01-09 15:50 ` Hannes Frederic Sowa
2015-01-12 11:08 ` Rahul Sharma
2015-01-12 11:51 ` Pablo Neira Ayuso
2015-01-13 4:23 ` Rahul Sharma
2015-01-13 10:11 ` Hannes Frederic Sowa
2015-01-22 11:24 ` Rahul Sharma
2015-01-09 11:36 ` Pablo Neira Ayuso
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=1420756756.1755002.211556745.0418D128@webmail.messagingengine.com \
--to=hannes@stressinduktion.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=rsharma@arista.com \
/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
all inboxes | Powered by JetHome®