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 <netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH nft] evalute: don't BUG on unexpected base datatype
Date: Sat, 14 Jun 2025 23:53:20 +0200	[thread overview]
Message-ID: <aE3vUEmr6Ua291dK@calendula> (raw)
In-Reply-To: <aExGZDqWdNgG0_BD@orbyte.nwl.cc>

On Fri, Jun 13, 2025 at 05:40:20PM +0200, Phil Sutter wrote:
> On Fri, Jun 13, 2025 at 04:46:06PM +0200, Florian Westphal wrote:
> > Included bogo will cause a crash but this is the evaluation
> > stage where we can just emit an error instead.
> > 
> > Signed-off-by: Florian Westphal <fw@strlen.de>
> > ---
> >  I wonder if we should just replace all BUGs in evaluate.c
> >  with expr_error() calls, it avoids constant whack-a-mole.

I think that can help uncover bugs, or are those json induced bugs?

> I guess the expectation was that bison catches these but I fear JSON
> parser has weakened that quite a bit.

It would be good to harden json parser to reject trivial non-sense, no
need to postpone this to the evaluation phase. If fuzzer can help in
that regard. I understand some issues can be more easily identified
from the evaluation step. I am not telling to only handle this from
the parser, I mean "it depends" on the issue.

> I wish libnftables to well-behave in error cases unless critical ones
> like ENOMEM.

Yes, I guess that's completary to my request above.

  reply	other threads:[~2025-06-14 21:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-13 14:46 [PATCH nft] evalute: don't BUG on unexpected base datatype Florian Westphal
2025-06-13 15:40 ` Phil Sutter
2025-06-14 21:53   ` Pablo Neira Ayuso [this message]
2025-06-16  9:16     ` Florian Westphal
2025-06-17 22:09       ` Pablo Neira Ayuso

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=aE3vUEmr6Ua291dK@calendula \
    --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.