From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org, Florian Westphal <fw@strlen.de>
Subject: Re: [libnftnl PATCH 0/6] Attribute policies for expressions
Date: Wed, 6 Mar 2024 15:43:31 +0100 [thread overview]
Message-ID: <ZeiBExEY08CTbvEI@orbyte.nwl.cc> (raw)
In-Reply-To: <20231215215350.17691-1-phil@nwl.cc>
On Fri, Dec 15, 2023 at 10:53:44PM +0100, Phil Sutter wrote:
> This is the former RFC turned into a complete implementation including
> Florian's suggested improvements.
>
> Patch 1 is fallout, took me a while debugging the segfaulting test case
> until I noticed it wasn't my fault! :)
>
> Patch 2 is the same as in the RFC.
>
> Patch 3 separates the type value checking from patch 2 and drops
> expressions' default switch cases where all possible values are handled.
>
> Patch 4 is prep work for patch 5.
>
> Patch 5 adds the new struct expr_ops field and defines policies for all
> expressions.
>
> Patch 6 then enables policy checking.
>
> Some remarks for consideration:
>
> * This adds kernel-internal knowledge to libnftnl, namely in max name
> lengths. Maybe not ideal, but I found it more sensible than Florian's
> suggested alternative of using 65528 to just not exceed netlink
> limits.
>
> * nftnl_expr_set_u*() setters start failing when they would happily
> overstep boundaries before. This is intentional, but getting the
> policy values right (at first I thought 'sizeof(enum nft_registers)'
> was a good idea) showed how hard to diagnose bugs in that area are. I
> think we should make the setters return success/fail like
> nftnl_expr_set_str does already, even if that breaks ABI (does it?).
> nftables probably benefits from setter wrappers which call
> netlink_abi_error() if the setter fails.
>
> Phil Sutter (6):
> tests: Fix objref test case
> expr: Repurpose struct expr_ops::max_attr field
> expr: Call expr_ops::set with legal types only
> include: Sync nf_log.h with kernel headers
> expr: Introduce struct expr_ops::attr_policy
> expr: Enforce attr_policy compliance in nftnl_expr_set()
Series applied after checking theres no effect on nftables' py testsuite
results in different releases (v0.9.9, v1.0.6, v1.0.9).
prev parent reply other threads:[~2024-03-06 14:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-15 21:53 [libnftnl PATCH 0/6] Attribute policies for expressions Phil Sutter
2023-12-15 21:53 ` [libnftnl PATCH 1/6] tests: Fix objref test case Phil Sutter
2023-12-15 21:53 ` [libnftnl PATCH 2/6] expr: Repurpose struct expr_ops::max_attr field Phil Sutter
2023-12-15 21:53 ` [libnftnl PATCH 3/6] expr: Call expr_ops::set with legal types only Phil Sutter
2023-12-15 21:53 ` [libnftnl PATCH 4/6] include: Sync nf_log.h with kernel headers Phil Sutter
2023-12-15 21:53 ` [libnftnl PATCH 5/6] expr: Introduce struct expr_ops::attr_policy Phil Sutter
2023-12-15 21:53 ` [libnftnl PATCH 6/6] expr: Enforce attr_policy compliance in nftnl_expr_set() Phil Sutter
2024-03-06 14:43 ` Phil Sutter [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=ZeiBExEY08CTbvEI@orbyte.nwl.cc \
--to=phil@nwl.cc \
--cc=fw@strlen.de \
--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).