netfilter: xtables: stricter ruleset validation
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest17 patches 5 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/17 | netfilter: x_tables: don't move to non-existent next rulenet/ net/ net/ | +13 | 0 replies | |
| 2/17 | netfilter: x_tables: validate targets of jumpsnet/ net/ net/ | +48 | 1 reply | |
| 3/17 | netfilter: x_tables: add and use xt_check_entry_offsetsinclude/ net/ net/ +2 more | +41 | 0 replies | |
| 4/17 | netfilter: x_tables: kill check_entry helpernet/ net/ net/ | +24 | 0 replies | |
| 5/17 | netfilter: x_tables: assert minimum target sizenet/ | +3 | 0 replies | |
| 6/17 | netfilter: x_tables: add compat version of xt_check_entry_offsetsinclude/ net/ net/ +2 more | +31 | 0 replies | |
| 7/17 | netfilter: x_tables: check standard target size toonet/ | +15 | 0 replies | |
| 8/17 | netfilter: x_tables: check for bogus target offsetinclude/ net/ net/ +2 more | +26 | 0 replies | |
| 9/17 | netfilter: x_tables: validate all offsets and sizes in a rulenet/ | +76 | 0 replies | |
| 10/17 | netfilter: ip_tables: simplify translate_compat_table argsnet/ | +24 | 0 replies | |
| 11/17 | netfilter: ip6_tables: simplify translate_compat_table argsnet/ | +24 | 0 replies | |
| 12/17 | netfilter: arp_tables: simplify translate_compat_table argsnet/ | +36 | 0 replies | |
| 13/17 | netfilter: x_tables: xt_compat_match_from_user doesn't need a retvalinclude/ net/ net/ +2 more | +26 | 0 replies | |
| 14/17 | netfilter: x_tables: do compat validation via translate_tablenet/ net/ net/ +1 more | +83 | 0 replies | |
| 15/17 | netfilter: x_tables: remove obsolete overflow check for compat case toonet/ net/ net/ | +0 | 0 replies | |
| 16/17 | netfilter: x_tables: remove obsolete checknet/ net/ net/ | +0 | 0 replies | |
| 17/17 | netfilter: x_tables: introduce and use xt_copy_counters_from_userinclude/ net/ net/ +2 more | +91 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH nf 00/17] netfilter: xtables: stricter ruleset validation
This series adds more checks on xtables (arp, ip, ip6tables) rulesets.
- check all offsets (target, next) of all rules during initial pass after copy from userspace.
- check targets of jumps (-j bla): offset should be start of a rule
- assert that alleged target size is at least as big as minimum target structure
- change CONFIG_COMPAT code path to push ruleset via normal setsockopt path after initial 32->64 bit conversion to avoid duplicating checks
- use a common helper to copy counters from userspace instead of the ip/ip6/arp implementation.
Tested:
- iptables.git iptables-test.py passes
- made a few performance tests w. really silly rulesets to verify that things don't slow down too much, see individual patches for details.
include/linux/netfilter/x_tables.h | 12 + net/ipv4/netfilter/arp_tables.c | 303 ++++++++++------------------------ net/ipv4/netfilter/ip_tables.c | 327 +++++++++---------------------------- net/ipv6/netfilter/ip6_tables.c | 320 ++++++++---------------------------- net/netfilter/x_tables.c | 244 +++++++++++++++++++++++++++ 5 files changed, 506 insertions(+), 700 deletions(-)