From: Florian Westphal <fw@strlen.de>
To: Daniel Mack <daniel@zonque.org>
Cc: Florian Westphal <fw@strlen.de>,
pablo@netfilter.org, daniel@iogearbox.net,
netfilter-devel@vger.kernel.org, netdev@vger.kernel.org,
balazs.scheidler@balabit.com
Subject: Re: [PATCH RFC 0/3] Allow postponed netfilter handling for socket matches
Date: Mon, 21 Sep 2015 21:05:55 +0200 [thread overview]
Message-ID: <20150921190555.GD931@breakpoint.cc> (raw)
In-Reply-To: <560035B4.9010504@zonque.org>
Daniel Mack <daniel@zonque.org> wrote:
> >> LOCAL_IN, for ingress only? In a sense, it would be called from the
> >> protocol handlers, just as my patches do right now, but instead of
> >> conditionally re-iterating the same rules again, we would walk a
> >> different chain?
> >
> > Yes, something like that. Obviously, you'll need to dru^W brib^W
> > convince a LOT of people before that could ever fly.
> >
> > I think we should not do this and that this 'match on ingress sk
> > properties' is just bad[tm].
> >
> > f.e. you'd also have to move all of the stuff you want into
> > sock_common ... 8-(
>
> Hmm, I'm not sure whether I understand which problems you see, or which
> corner cases I am missing in my assessment. I did a quick test with the
> attached 4 patches that
>
> 1) Allow hook callbacks to look at the socket passed to nf_hook(), so
> skb->sk does not have to be set
>
> 2) Make nft_meta look at pkt->sk rather that skb->sk (only for cgroups
> as proof of concept)
>
> 3) Introduce a new POST_DEMUX netfilter chain (the name is not
> perfect, admittedly)
>
> 4) Iterate POST_DEMUX chains for v4 TCP and UDP unicast+multicast
> sockets.
>
> With some really trivial modifications to libnftnl/nftables (which just
> map strings to the new enum value), this works fine in my tests.
> Multicast receivers that match a netclass ID in the ruleset won't see
> any packets, while others do.
>
> Some more considerations: if we cannot determine a socket for a packet
> and hence don't deliver it, it's IMO perfectly fine not to run the
> netfilter rules for them. All we need to achieve with this chain is that
> for packets that _are_ delivered to a socket, all the necessary rules
> have been processed, at a time when we know who the final receiver of
> the skb is.
Not sure if thats true. What about Timewait sockets?
Its easy to imagine someone using this feature and then complaining
that it doesn't match some packets, at which point we'd have to grow
sock_common to accomondate all sk member we support matching for :-/
If we'd have kernel releases where we drop features this wouldn't be
much of an issue since we could back out in case it causes issues later.
But once we add your proposed feature we cannot go back...
I'm not sure; I dislike this feature proposal but I can't think of
any alternative [other than "don't do this"] :-(
prev parent reply other threads:[~2015-09-21 19:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-16 15:42 [PATCH RFC 0/3] Allow postponed netfilter handling for socket matches Daniel Mack
2015-09-16 15:42 ` [PATCH RFC 1/3] netfilter: add socket to struct nft_pktinfo Daniel Mack
2015-09-16 15:42 ` [PATCH RFC 2/3] netfilter: nft_meta: mark skbs for postponed filter processing Daniel Mack
2015-09-16 15:43 ` [PATCH RFC 3/3] net: tcp_ipv4: re-run netfilter chains for marked skbs Daniel Mack
2015-09-16 21:21 ` [PATCH RFC 0/3] Allow postponed netfilter handling for socket matches Florian Westphal
2015-09-17 10:04 ` Daniel Mack
2015-09-17 16:00 ` Florian Westphal
2015-09-21 16:52 ` Daniel Mack
2015-09-21 19:05 ` Florian Westphal [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=20150921190555.GD931@breakpoint.cc \
--to=fw@strlen.de \
--cc=balazs.scheidler@balabit.com \
--cc=daniel@iogearbox.net \
--cc=daniel@zonque.org \
--cc=netdev@vger.kernel.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 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).