Skip to content

Make rule parsing strict

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: Parse icmp header matchesiptables/nft-shared.c iptables/tests/shell/testcases/nft-only/0010-iptables-nft-save.txt+77 -30 replies
2/4arptables: Check the mandatory ar_pln matchiptables/nft-arp.c+6 -10 replies
3/4nft: Increase rule parser strictnessiptables/nft-arp.c iptables/nft-bridge.c iptables/nft-ipv4.c +2 more+37 -120 replies
4/4nft: Make rule parsing errors fataliptables/nft-shared.c+3 -10 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [iptables PATCH 0/4] Make rule parsing strict

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(-)
Signature · 1 line
2.38.0