netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Phil Sutter <phil@nwl.cc>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	netfilter-devel@vger.kernel.org, fw@strlen.de
Subject: Re: [PATCH] netfilter: nf_tables: restrict expression reduction to first expression
Date: Wed, 18 May 2022 13:48:07 +0200	[thread overview]
Message-ID: <20220518114807.GE4316@breakpoint.cc> (raw)
In-Reply-To: <YoTbJTDxuQ131EDG@orbyte.nwl.cc>

Phil Sutter <phil@nwl.cc> wrote:
> > > | reduce = reduce && expr->ops->type->reduce;
> > 
> > Could you elaborate?
> 
> Well, an expression which may set verdict register to NFT_BREAK should
> prevent reduction of later expressions in same rule as it may stop rule
> evaluation at run-time. This is obvious for nft_cmp, but nft_meta is
> also a candidate: NFT_META_IFTYPE causes NFT_BREAK if pkt->skb->dev is
> NULL. The optimizer must not assume later expressions are evaluated.

This all seems fragile to me, with huge potential to add subtle bugs
that will be hard to track down.

  reply	other threads:[~2022-05-18 11:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-18 10:08 [PATCH] netfilter: nf_tables: restrict expression reduction to first expression Pablo Neira Ayuso
2022-05-18 10:51 ` Phil Sutter
2022-05-18 11:01   ` Pablo Neira Ayuso
2022-05-18 11:40     ` Phil Sutter
2022-05-18 11:48       ` Florian Westphal [this message]
2022-05-18 12:26         ` Pablo Neira Ayuso
2022-05-18 12:38           ` Florian Westphal
2022-05-18 12:49             ` Pablo Neira Ayuso
2022-05-18 12:21       ` Pablo Neira Ayuso
2022-05-18 12:33         ` Pablo Neira Ayuso
2022-05-18 12:43         ` 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=20220518114807.GE4316@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).