All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, netfilter-devel@vger.kernel.org,
	hannes@stressinduktion.org, jiri@resnulli.us
Subject: Re: [PATCH 0/9] netfilter: Compress hook function signatures.
Date: Sat, 4 Apr 2015 13:49:28 +0200	[thread overview]
Message-ID: <20150404114928.GA3829@salvia> (raw)
In-Reply-To: <20150403.220734.1272465850706339981.davem@davemloft.net>

On Fri, Apr 03, 2015 at 10:07:34PM -0400, David Miller wrote:
> 
> Currently netfilter hooks have a function signature that is huge and
> has many arguments.  This propagates from the hook entry points down
> into the individual hook implementations themselves.
> 
> This means that if, for example, we want to change the type of one of
> these arguments then we have to touch hundreds of locations.
> 
> The main initial motivation behind this is that we'd like to change
> the signature of "okfn" so that a socket pointer can be passed in (and
> reference counted properly) for the sake of using the proper socket
> context in the case of tunnels whilst not releasing the top level user
> socket from skb->sk (and thus releasing it's socket memory quota
> usage) in order to accomodate this.
> 
> This also makes it clear who actually uses 'okfn', nf_queue().  It is
> absolutely critical to make this obvious because any user of 'okfn'
> down in these hook chains have the be strictly audited for
> escapability.  Specifically, escapability of references to objects
> outside of the packet processing path.  And that's exactly what
> nf_queue() does via it's packet reinjection framework.
> 
> In fact this points out a bug in Jiri's original attempt to push the
> socket pointer down through netfilter's okfn.  It didn't grab and drop
> a reference to the socket in net/netfilter/nf_queue.c as needed.
>
> Furthermore, so many code paths are simplified, and should in fact be
> more efficient because we aren't passing in arguments that often are
> simply not used by the netfilter hook at all.
> 
> Further simplifications are probably possible, but this series takes
> care of the main cases.
> 
> Unfortunately I couldn't convert ebt_do_table() because ebtables is
> complete and utter crap and uses ebt_do_table() outside of the hook
> call chains.  But that should not be news to anyone.
> 
> Signed-off-by: David S. Miller <davem@davemloft.net>

Nice series. If you route them through net-next, please add:

Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>

or I can place them in nf-next, your call.

Regarding Jiri's okfn() signature changes, please let me know on those
patches, they will simplify a patchset I'll submit soon. And count on
me to help on that change too, of course.

Thanks a lot David!

  reply	other threads:[~2015-04-04 11:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-04  2:07 [PATCH 0/9] netfilter: Compress hook function signatures David Miller
2015-04-04 11:49 ` Pablo Neira Ayuso [this message]
2015-04-04 15:54   ` David Miller

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=20150404114928.GA3829@salvia \
    --to=pablo@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=hannes@stressinduktion.org \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.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.