netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [iptables PATCH 0/4] Make rule parsing strict
@ 2022-12-15 16:17 Phil Sutter
  2022-12-15 16:17 ` [iptables PATCH 1/4] nft: Parse icmp header matches Phil Sutter
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Phil Sutter @ 2022-12-15 16:17 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Florian Westphal, Pablo Neira Ayuso

Abort the program when encountering rules with unsupported matches.

While nft_is_table_compatible() tries to catch this situation, it boils
down to merely accepting or rejecting expressions based on type. Yet
these may still be used in incompatible ways.

Patch 1 fixes for payload matches on ICMP(v6) headers and is almost
independent of the rest.

Patch 2 prepares arptables rule parsing for the error message added by
patch 3.

Patch 3 makes various situations complain by emitting error messages. It
was compiled after reviewing all callees of rule_to_cs callback for
unhandled unexpected input.

Patch 5 then finally does it's thing.

Phil Sutter (4):
  nft: Parse icmp header matches
  arptables: Check the mandatory ar_pln match
  nft: Increase rule parser strictness
  nft: Make rule parsing errors fatal

 iptables/nft-arp.c                            |   9 +-
 iptables/nft-bridge.c                         |   4 +
 iptables/nft-ipv4.c                           |   4 +-
 iptables/nft-ipv6.c                           |   4 +-
 iptables/nft-shared.c                         | 113 ++++++++++++++++--
 .../nft-only/0010-iptables-nft-save.txt       |   6 +-
 6 files changed, 123 insertions(+), 17 deletions(-)

-- 
2.38.0


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

end of thread, other threads:[~2022-12-20 21:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-15 16:17 [iptables PATCH 0/4] Make rule parsing strict Phil Sutter
2022-12-15 16:17 ` [iptables PATCH 1/4] nft: Parse icmp header matches Phil Sutter
2022-12-15 16:17 ` [iptables PATCH 2/4] arptables: Check the mandatory ar_pln match Phil Sutter
2022-12-15 16:17 ` [iptables PATCH 3/4] nft: Increase rule parser strictness Phil Sutter
2022-12-15 16:17 ` [iptables PATCH 4/4] nft: Make rule parsing errors fatal Phil Sutter
2022-12-20 21:24 ` [iptables PATCH 0/4] Make rule parsing strict Phil Sutter

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).