netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org, phil@nwl.cc
Subject: Re: [PATCH nf] netfilter: nf_tables: set pktinfo->thoff at AH header if found
Date: Sat, 4 Mar 2017 20:43:42 +0100	[thread overview]
Message-ID: <20170304194342.GA6457@breakpoint.cc> (raw)
In-Reply-To: <1488653627-4815-1-git-send-email-pablo@netfilter.org>

Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> Phil Sutter reports that IPv6 AH header matching is broken. From
> userspace, nft generates bytecode that expects to find the AH header at
> NFT_PAYLOAD_TRANSPORT_HEADER both for IPv4 and IPv6. However,
> pktinfo->thoff is set to the inner header after the AH header in IPv6,
> while in IPv4 pktinfo->thoff points to the AH header indeed. This
> behaviour is inconsistent. This patch fixes this problem by updating
> ipv6_find_hdr() to get the IP6_FH_F_AUTH flag so this function stops at
> the AH header, so both IPv4 and IPv6 pktinfo->thoff point to the AH
> header.

This looks wrong.  We need to search until we find a l4 header,
after this patch "tcp dort 22" won't match anymore if an AH header
exists.

  reply	other threads:[~2017-03-04 19:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-04 18:53 [PATCH nf] netfilter: nf_tables: set pktinfo->thoff at AH header if found Pablo Neira Ayuso
2017-03-04 19:43 ` Florian Westphal [this message]
2017-03-04 22:58   ` Pablo Neira Ayuso
2017-03-04 23:16     ` Florian Westphal

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=20170304194342.GA6457@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=phil@nwl.cc \
    /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).