[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHsH6Gupw7o96e5hOmaLBCZtqgoV0LZ4L7h-Y+2oROtXSXvTxw@mail.gmail.com>
Date: Tue, 8 Dec 2020 16:47:02 +0200
From: Eyal Birger <eyal.birger@...il.com>
To: Phil Sutter <phil@....cc>
Cc: Steffen Klassert <steffen.klassert@...unet.com>,
linux-crypto@...r.kernel.org, netfilter-devel@...r.kernel.org,
Linux Kernel Network Developers <netdev@...r.kernel.org>,
Nicolas Dichtel <nicolas.dichtel@...nd.com>
Subject: Re: [PATCH v2] xfrm: interface: Don't hide plain packets from netfilter
Hi Phil,
On Mon, Dec 7, 2020 at 4:07 PM Phil Sutter <phil@....cc> wrote:
>
> With an IPsec tunnel without dedicated interface, netfilter sees locally
> generated packets twice as they exit the physical interface: Once as "the
> inner packet" with IPsec context attached and once as the encrypted
> (ESP) packet.
>
> With xfrm_interface, the inner packet did not traverse NF_INET_LOCAL_OUT
> hook anymore, making it impossible to match on both inner header values
> and associated IPsec data from that hook.
>
Why wouldn't locally generated traffic not traverse the
NF_INET_LOCAL_OUT hook via e.g. __ip_local_out() when xmitted on an xfrmi?
I would expect it to appear in netfilter, but without the IPsec
context, as it's not
there yet.
> Fix this by looping packets transmitted from xfrm_interface through
> NF_INET_LOCAL_OUT before passing them on to dst_output(), which makes
> behaviour consistent again from netfilter's point of view.
When an XFRM interface is used when forwarding, why would it be correct
for NF_INET_LOCAL_OUT to observe the inner packet?
What am I missing?
Thanks!
Eyal.
Powered by blists - more mailing lists