All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Phil Sutter <phil@nwl.cc>, Florian Westphal <fw@strlen.de>,
	netfilter-devel@vger.kernel.org
Subject: Re: [nf-next PATCH v2] netfilter: nf_tables: Introduce NFTA_RULE_ACTUAL_EXPR
Date: Mon, 6 Feb 2023 10:52:26 +0100	[thread overview]
Message-ID: <Y+DN2miPlSlBAIaj@salvia> (raw)
In-Reply-To: <Y97HaXaEtIlFUQSJ@orbyte.nwl.cc>

On Sat, Feb 04, 2023 at 10:00:25PM +0100, Phil Sutter wrote:
> On Sat, Feb 04, 2023 at 10:41:37AM +0100, Pablo Neira Ayuso wrote:
> > On Fri, Feb 03, 2023 at 05:21:29PM +0100, Phil Sutter wrote:
> > [...]
> > > On Fri, Feb 03, 2023 at 04:32:01PM +0100, Pablo Neira Ayuso wrote:
> > [...]
> > > > I also wonder if this might cause problems with nftables and implicit
> > > > sets, they are bound to one single lookup expression that, when gone,
> > > > the set is released. Now you will have two expressions pointing to an
> > > > implicit set. Same thing with implicit chains. This might get tricky
> > > > with the transaction interface.
> > > 
> > > While indeed two lookup expressions will refer to the same anonymous
> > > set, only one of those expressions will ever be in use. There's no way
> > > the kernel would switch between rule variants (or use both at the same
> > > time).
> > 
> > OK, but control plane will reject two lookup expressions that refer to
> > the same anonymous set.
> 
> Only if it sees the second expression: If NFTA_RULE_ACTUAL_EXPR is
> present, the kernel will copy the content of NFTA_RULE_EXPRESSIONS into
> a buffer pointed to by nft_rule::dump_expr. It does not inspect the
> content apart from nla_policy checking which merely ensures it's a
> nested array of elements conforming to nft_expr_policy (i.e., have a
> NAME and DATA attribute).
> 
> The copied data is touched only by nf_tables_fill_rule_info() which
> copies it as-is into the skb. Later, nf_tables_rule_destroy() just frees
> the whole blob.
> 
> So effectively the kernel doesn't know or care what expressions are
> contained in NFTA_RULE_EXPRESSIONS.

Copy should work, sorry I thought you were parsing the expression again.

  reply	other threads:[~2023-02-06  9:53 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-21 14:22 [nf-next PATCH v2] netfilter: nf_tables: Introduce NFTA_RULE_ACTUAL_EXPR Phil Sutter
2023-01-12 10:15 ` Phil Sutter
2023-01-12 11:06   ` Pablo Neira Ayuso
2023-01-12 12:02     ` Phil Sutter
2023-01-18 11:58       ` Pablo Neira Ayuso
2023-01-18 13:48         ` Phil Sutter
2023-02-02 21:31           ` Pablo Neira Ayuso
2023-02-03 13:48             ` Phil Sutter
2023-02-03 15:32               ` Pablo Neira Ayuso
2023-02-03 16:21                 ` Phil Sutter
2023-02-04  9:41                   ` Pablo Neira Ayuso
2023-02-04 21:00                     ` Phil Sutter
2023-02-06  9:52                       ` Pablo Neira Ayuso [this message]
2023-02-07 10:43                         ` Pablo Neira Ayuso
2023-02-07 10:56                           ` Phil Sutter
2023-02-16 10:55                             ` Phil Sutter
2023-02-16 11:29                               ` Pablo Neira Ayuso
2023-02-16 12:05                                 ` Phil Sutter
2023-04-26 19:58                                   ` Pablo Neira Ayuso
2023-04-27 10:57                                     ` Phil Sutter
2023-04-27 11:01                                       ` Pablo Neira Ayuso
2023-04-27 11:33                                         ` Phil Sutter
2023-04-27 13:07                                           ` Pablo Neira Ayuso
2023-04-27 22:45                                             ` Phil Sutter

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=Y+DN2miPlSlBAIaj@salvia \
    --to=pablo@netfilter.org \
    --cc=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.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 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.