All of lore.kernel.org
 help / color / mirror / Atom feed
* [iptables PATCH 0/8] nft: Implement forward compat for future binaries
@ 2024-07-31 22:26 Phil Sutter
  2024-07-31 22:26 ` [iptables PATCH 1/8] ebtables: Zero freed pointers in ebt_cs_clean() Phil Sutter
                   ` (8 more replies)
  0 siblings, 9 replies; 14+ messages in thread
From: Phil Sutter @ 2024-07-31 22:26 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Florian Westphal, Pablo Neira Ayuso, Jan Engelhardt

Time to abandon earlier attempts at providing compatibility for old
binaries, choose the next best option which is not relying upon any
kernel changes.

Basically, all extensions replaced by native bytecode are appended to
rule userdata so when nftnl rule parsing code fails, it may retry
omitting all these expressions and restoring an extension from userdata
instead.

The idea behind this is that extensions are stable which relieves native
bytecode from being the same. With this series in place, one may
(re-)start converting extensions into native nftables bytecode again.

For now, appending compat extensions is always active. Keeping it
disabled by default and enabling via commandline flag or (simpler) env
variable might make sense (I haven't tested performance yet). The
parsing component will take action only if standard rule parsing fails,
so no need to manually enable this IMO.

The actual implementation sits in patch 8, the preceeding ones are
(mostly) preparation.

To forcibly exercise the fallback rule parsing code, compile with
CFLAGS='-DDEBUG_COMPAT_EXT=1'.

Phil Sutter (8):
  ebtables: Zero freed pointers in ebt_cs_clean()
  ebtables: Introduce nft_bridge_init_cs()
  nft: Reduce overhead in nft_rule_find()
  nft: ruleparse: Drop 'iter' variable in
    nft_rule_to_iptables_command_state
  nft: ruleparse: Introduce nft_parse_rule_expr()
  nft: __add_{match,target}() can't fail
  nft: Introduce UDATA_TYPE_COMPAT_EXT
  nft: Support compat extensions in rule userdata

 configure.ac             |   9 ++
 iptables/Makefile.am     |   1 +
 iptables/nft-bridge.c    |  12 +--
 iptables/nft-compat.c    | 217 +++++++++++++++++++++++++++++++++++++++
 iptables/nft-compat.h    |  54 ++++++++++
 iptables/nft-ruleparse.c | 106 +++++++++++--------
 iptables/nft-ruleparse.h |   4 +
 iptables/nft.c           | 112 +++++++++++---------
 iptables/nft.h           |  14 +++
 iptables/xtables-eb.c    |   4 +-
 10 files changed, 438 insertions(+), 95 deletions(-)
 create mode 100644 iptables/nft-compat.c
 create mode 100644 iptables/nft-compat.h

-- 
2.43.0


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-09-17 21:27 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-31 22:26 [iptables PATCH 0/8] nft: Implement forward compat for future binaries Phil Sutter
2024-07-31 22:26 ` [iptables PATCH 1/8] ebtables: Zero freed pointers in ebt_cs_clean() Phil Sutter
2024-07-31 22:26 ` [iptables PATCH 2/8] ebtables: Introduce nft_bridge_init_cs() Phil Sutter
2024-07-31 22:26 ` [iptables PATCH 3/8] nft: Reduce overhead in nft_rule_find() Phil Sutter
2024-07-31 22:26 ` [iptables PATCH 4/8] nft: ruleparse: Drop 'iter' variable in nft_rule_to_iptables_command_state Phil Sutter
2024-07-31 22:27 ` [iptables PATCH 5/8] nft: ruleparse: Introduce nft_parse_rule_expr() Phil Sutter
2024-07-31 22:27 ` [iptables PATCH 6/8] nft: __add_{match,target}() can't fail Phil Sutter
2024-07-31 22:27 ` [iptables PATCH 7/8] nft: Introduce UDATA_TYPE_COMPAT_EXT Phil Sutter
2024-07-31 22:27 ` [iptables RFC PATCH 8/8] nft: Support compat extensions in rule userdata Phil Sutter
2024-08-07 17:56   ` Pablo Neira Ayuso
2024-08-08 13:05     ` Phil Sutter
2024-09-15 22:13   ` Pablo Neira Ayuso
2024-09-17 21:27     ` Phil Sutter
2024-08-14  7:52 ` [iptables PATCH 0/8] nft: Implement forward compat for future binaries Phil Sutter

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.