Skip to content

nft: Fix and improve base chain handling

Phil Sutter netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4nft: cache: Avoid double free of unrecognized base-chainsiptables/nft-cache.c iptables/tests/shell/testcases/chain/0004extra-base_0+28 -30 replies
2/4nft: Check base-chain compatibility when adding to cacheiptables/nft-cache.c iptables/nft.c iptables/nft.h +2 more+65 -440 replies
3/4nft-chain: Introduce base_slot fieldiptables/nft-cache.c iptables/nft-chain.h iptables/nft.c+5 -290 replies
4/4nft: Delete builtin chains compatiblyiptables/nft-cmd.c iptables/nft.c iptables/tests/shell/testcases/chain/0005base-delete_0+66 -91 reply

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchFlorian Westphal
1/4
2/4
3/4
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [iptables PATCH 0/4] nft: Fix and improve base chain handling

This is a combined series of fixes and improvements:

* Patch 1 fixes a double free happening if the ruleset contains more than one base-chains for a given hook.

* Patch 2 improves iptables-nft behaviour in above case, allowing to continue even if there is a base chain which doesn't fit. Since iptables-nft doesn't fetch the full ruleset from kernel in all cases anymore, it is prone to miss offending ruleset parts, anyway.

* Patch 4 tries to avoid the negative side-effects that came with Florian's patch allowing to delete base-chains.

* Patch 3 adds a bit of convenience used by patch 4.

Phil Sutter (4):
nft: cache: Avoid double free of unrecognized base-chains
nft: Check base-chain compatibility when adding to cache
nft-chain: Introduce base_slot field
nft: Delete builtin chains compatibly

 iptables/nft-cache.c                          |  52 +++++---
 iptables/nft-chain.h                          |   1 +
 iptables/nft-cmd.c                            |   2 +-
 iptables/nft.c                                | 112 +++++++-----------
 iptables/nft.h                                |   2 +
 .../shell/testcases/chain/0004extra-base_0    |  37 ++++++
 .../shell/testcases/chain/0005base-delete_0   |  34 ++++++
 iptables/xtables-save.c                       |   3 +
 8 files changed, 161 insertions(+), 82 deletions(-)
 create mode 100755 iptables/tests/shell/testcases/chain/0004extra-base_0
 create mode 100755 iptables/tests/shell/testcases/chain/0005base-delete_0
Signature · 1 line
2.33.0