Skip to content

nf_tables: Export rule optimizer results to user space

Phil Sutter netfilter-devel 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest4 patches 1 replyIn review
  2. v34 patches 0 repliesSuperseded
  3. v22 patches 2 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v12 patches0 repliesSuperseded

Changes in v4 from the cover letter

- Add missing chunks to patch 1

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4netfilter: nf_tables: Store net size in nft_expr_ops::sizeinclude/net/netfilter/nf_tables.h net/netfilter/nf_tables_api.c+18 -130 replies
2/4netfilter: nf_tables: Introduce struct nft_expr_dpinclude/net/netfilter/nf_tables.h net/netfilter/nf_tables_api.c+16 -40 replies
3/4netfilter: nf_tables: Introduce expression flagsinclude/net/netfilter/nf_tables.h include/uapi/linux/netfilter/nf_tables.h net/netfilter/nf_tables_api.c+6 -00 replies
4/4netfilter: nf_tables: Annotate reduced expressionsinclude/uapi/linux/netfilter/nf_tables.h net/netfilter/nf_tables_api.c+13 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [nf-next PATCH v4 0/4] nf_tables: Export rule optimizer results to user space

Changes since v3:
- Add missing chunks to patch 1

Changes since v2:
- New patches 1 and 2

Changes since v1:
- Fixed two bugs in patch 2.

While transforming rules into binary blob, code checks if certain expressions may be omitted. Any bugs in this code might lead to very subtle breakage of firewall rulesets, so a way of asserting optimizer correctness is highly necessary.

This series achieves this in the most minimal way by annotating omitted expressions with a flag. Integrated into libnftnl print output, testsuites in user space may verify optimizer effect and assert correctness.

First patch prepares for a blob-specific variant of struct nft_expr which is smaller than the original. Second patch introduces this variant. Third patch extends struct nft_expr by a new field and finally fourth patch populates it.

Phil Sutter (4):
netfilter: nf_tables: Store net size in nft_expr_ops::size
netfilter: nf_tables: Introduce struct nft_expr_dp
netfilter: nf_tables: Introduce expression flags
netfilter: nf_tables: Annotate reduced expressions

 include/net/netfilter/nf_tables.h        | 18 +++++++---
 include/uapi/linux/netfilter/nf_tables.h |  8 +++++
 net/netfilter/nf_tables_api.c            | 42 ++++++++++++++++--------
 3 files changed, 51 insertions(+), 17 deletions(-)
Signature · 1 line
2.34.1