Skip to content

nf_tables updates for net-next

Pablo Neira Ayuso netdev netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest23 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/23netfilter: nft_reject: fix compilation warning if NF_TABLES_IPV6 is disablednet/netfilter/nft_reject.c+2 -12 replies
2/23netfilter: nf_tables: make chain types override the default AF functionsnet/bridge/netfilter/nf_tables_bridge.c net/ipv4/netfilter/nf_tables_arp.c net/ipv4/netfilter/nf_tables_ipv4.c +2 more+81 -960 replies
3/23netfilter: nf_tables: add hook ops to struct nft_pktinfoinclude/net/netfilter/nf_tables.h net/netfilter/nf_tables_core.c net/netfilter/nft_log.c +1 more+8 -70 replies
4/23netfilter: nf_tables: add support for multi family tablesinclude/net/netfilter/nf_tables.h net/bridge/netfilter/nf_tables_bridge.c net/ipv4/netfilter/nf_tables_arp.c +4 more+45 -250 replies
5/23netfilter: nf_tables: add "inet" table for IPv4/IPv6include/net/netfilter/nf_tables_ipv4.h include/net/netfilter/nf_tables_ipv6.h include/net/netns/nftables.h +6 more+116 -20 replies
6/23netfilter: nf_tables: add nfproto support to meta expressioninclude/uapi/linux/netfilter/nf_tables.h net/netfilter/nft_meta.c+6 -00 replies
7/23netfilter: nft_meta: add l4proto supportinclude/net/netfilter/nf_tables.h include/net/netfilter/nf_tables_ipv4.h include/net/netfilter/nf_tables_ipv6.h +2 more+10 -10 replies
8/23netfilter: nft_ct: load both IPv4 and IPv6 conntrack modules for NFPROTO_INETnet/netfilter/nft_ct.c+36 -34 replies
9/23netfilter: nft_ct: Add support to set the connmarkinclude/uapi/linux/netfilter/nf_tables.h net/netfilter/nft_ct.c+136 -300 replies
10/23netfilter: nft_meta: fix lack of validation of the input registernet/netfilter/nft_meta.c+3 -00 replies
11/23netfilter: nf_tables: split chain policy validation from actually setting itnet/netfilter/nf_tables_api.c+20 -360 replies
12/23netfilter: nf_tables: restore chain change atomicitynet/netfilter/nf_tables_api.c+21 -220 replies
13/23netfilter: nf_tables: fix check for table overflownet/netfilter/nf_tables_api.c+3 -30 replies
14/23netfilter: nf_tables: fix chain type module reference handlinginclude/net/netfilter/nf_tables.h net/netfilter/nf_tables_api.c+25 -220 replies
15/23netfilter: nf_tables: add missing module references to chain typesnet/bridge/netfilter/nf_tables_bridge.c net/ipv4/netfilter/nf_tables_arp.c net/ipv4/netfilter/nf_tables_ipv4.c +2 more+5 -00 replies
16/23netfilter: nf_tables: replay request after dropping locks to load chain typenet/netfilter/nf_tables_api.c+8 -40 replies
17/23netfilter: nf_tables: constify chain type definitions and pointersinclude/net/netfilter/nf_tables.h net/bridge/netfilter/nf_tables_bridge.c net/ipv4/netfilter/nf_tables_arp.c +8 more+19 -190 replies
18/23netfilter: nf_tables: minor nf_chain_type cleanupsinclude/net/netfilter/nf_tables.h net/bridge/netfilter/nf_tables_bridge.c net/ipv4/netfilter/nf_tables_arp.c +8 more+44 -340 replies
19/23netfilter: nf_tables: perform flags validation before table allocationnet/netfilter/nf_tables_api.c+9 -130 replies
20/23netfilter: nf_tables: take AF module reference when creating a tablenet/netfilter/nf_tables_api.c+7 -10 replies
21/23netfilter: nf_tables: prohibit deletion of a table with existing setsnet/netfilter/nf_tables_api.c+1 -10 replies
22/23netfilter: nf_tables: rename nft_do_chain_pktinfo() to nft_do_chain()include/net/netfilter/nf_tables.h net/bridge/netfilter/nf_tables_bridge.c net/ipv4/netfilter/nf_tables_arp.c +7 more+12 -120 replies
23/23netfilter: nf_tables: fix error path in the init functionsnet/ipv4/netfilter/nf_tables_ipv4.c net/ipv6/netfilter/nf_tables_ipv6.c net/netfilter/nf_tables_inet.c+21 -30 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 00/23] nf_tables updates for net-next

Hi David,

The following patchset contains the following nf_tables updates, mostly updates from Patrick McHardy, they are:

* Add the "inet" table and filter chain type for this new netfilter
family: NFPROTO_INET. This special table/chain allows IPv4 and IPv6 rules, this should help to simplify the burden in the administration of dual stack firewalls. This also includes several patches to prepare the infrastructure for this new table and a new meta extension to match the layer 3 and 4 protocol numbers, from Patrick McHardy.

* Load both IPv4 and IPv6 conntrack modules in nft_ct if the rule is used in NFPROTO_INET, as we don't certainly know which one would be used, also from Patrick McHardy.

* Do not allow to delete a table that contains sets, otherwise these sets become orphan, from Patrick McHardy.

* Hold a reference to the corresponding nf_tables family module when creating a table of that family type, to avoid the module deletion when in use, from Patrick McHardy.

* Update chain counters before setting the chain policy to ensure that we don't leave the chain in inconsistent state in case of errors (aka. restore chain atomicity). This also fixes a possible leak if it fails to allocate the chain counters if no counters are passed to be restored, from Patrick McHardy.

* Don't check for overflows in the table counter if we are just renaming a chain, from Patrick McHardy.

* Replay the netlink request after dropping the nfnl lock to load the module that supports provides a chain type, from Patrick.

* Fix chain type module references, from Patrick.

* Several cleanups, function renames, constification and code refactorizations also from Patrick McHardy.

* Add support to set the connmark, this can be used to set it based on the meta mark (similar feature to -j CONNMARK --restore), from Kristian Evensen.

* A couple of fixes to the recently added meta/set support and nft_reject, and fix missing chain type unregistration if we fail to register our the family table/filter chain type, from myself.

You can pull these changes from:

git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nftables.git master

Thanks!

----------------------------------------------------------------

The following changes since commit cdb3f4a31b64c3a1c6eef40bc01ebc9594c58a8c:

net: Do not enable tx-nocache-copy by default (2014-01-07 16:20:19 -0500)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nftables.git master

for you to fetch changes up to cf4dfa85395ebe2769267a072b39e48301669842:

netfilter: nf_tables: fix error path in the init functions (2014-01-09 23:25:48 +0100)

----------------------------------------------------------------
Kristian Evensen (1):
netfilter: nft_ct: Add support to set the connmark

Pablo Neira Ayuso (3):
netfilter: nft_reject: fix compilation warning if NF_TABLES_IPV6 is disabled
netfilter: nft_meta: fix lack of validation of the input register
netfilter: nf_tables: fix error path in the init functions

Patrick McHardy (19):
netfilter: nf_tables: make chain types override the default AF functions
netfilter: nf_tables: add hook ops to struct nft_pktinfo
netfilter: nf_tables: add support for multi family tables
netfilter: nf_tables: add "inet" table for IPv4/IPv6
netfilter: nf_tables: add nfproto support to meta expression
netfilter: nft_meta: add l4proto support
netfilter: nft_ct: load both IPv4 and IPv6 conntrack modules for NFPROTO_INET
netfilter: nf_tables: split chain policy validation from actually setting it
netfilter: nf_tables: restore chain change atomicity
netfilter: nf_tables: fix check for table overflow
netfilter: nf_tables: fix chain type module reference handling
netfilter: nf_tables: add missing module references to chain types
netfilter: nf_tables: replay request after dropping locks to load chain type
netfilter: nf_tables: constify chain type definitions and pointers
netfilter: nf_tables: minor nf_chain_type cleanups
netfilter: nf_tables: perform flags validation before table allocation
netfilter: nf_tables: take AF module reference when creating a table
netfilter: nf_tables: prohibit deletion of a table with existing sets
netfilter: nf_tables: rename nft_do_chain_pktinfo() to nft_do_chain()

 include/net/netfilter/nf_tables.h         |   47 ++++--
 include/net/netfilter/nf_tables_ipv4.h    |    5 +-
 include/net/netfilter/nf_tables_ipv6.h    |    3 +
 include/net/netns/nftables.h              |    1 +
 include/uapi/linux/netfilter.h            |    1 +
 include/uapi/linux/netfilter/nf_tables.h  |    6 +
 net/bridge/netfilter/nf_tables_bridge.c   |   44 +++---
 net/ipv4/netfilter/nf_tables_arp.c        |   44 +++---
 net/ipv4/netfilter/nf_tables_ipv4.c       |   60 ++++----
 net/ipv4/netfilter/nft_chain_nat_ipv4.c   |   10 +-
 net/ipv4/netfilter/nft_chain_route_ipv4.c |   10 +-
 net/ipv6/netfilter/nf_tables_ipv6.c       |   65 ++++-----
 net/ipv6/netfilter/nft_chain_nat_ipv6.c   |   10 +-
 net/ipv6/netfilter/nft_chain_route_ipv6.c |   10 +-
 net/netfilter/Kconfig                     |    8 ++
 net/netfilter/Makefile                    |    1 +
 net/netfilter/nf_tables_api.c             |  223 +++++++++++++++--------------
 net/netfilter/nf_tables_core.c            |    6 +-
 net/netfilter/nf_tables_inet.c            |  104 ++++++++++++++
 net/netfilter/nft_compat.c                |    8 +-
 net/netfilter/nft_ct.c                    |  199 +++++++++++++++++++++----
 net/netfilter/nft_log.c                   |    2 +-
 net/netfilter/nft_meta.c                  |   11 ++
 net/netfilter/nft_reject.c                |    9 +-
 24 files changed, 595 insertions(+), 292 deletions(-)
 create mode 100644 net/netfilter/nf_tables_inet.c