Skip to content

Netfilter 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 Latest36 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/36ipvs: handle connections started by real-serversinclude/net/ip_vs.h net/netfilter/ipvs/ip_vs_core.c net/netfilter/ipvs/ip_vs_ctl.c +1 more+231 -10 replies
2/36ipvs: optimize release of connections in OPS modenet/netfilter/ipvs/ip_vs_conn.c+23 -30 replies
3/36ipvs: don't alter conntrack in OPS modenet/netfilter/ipvs/ip_vs_conn.c net/netfilter/ipvs/ip_vs_nfct.c+6 -10 replies
4/36netfilter: conntrack: move generation seqcnt out of netns_ctinclude/net/netns/conntrack.h net/netfilter/nf_conntrack_core.c+11 -100 replies
5/36netfilter: conntrack: use get_random_once for nat and expectationsnet/netfilter/nf_conntrack_expect.c net/netfilter/nf_nat_core.c+7 -60 replies
6/36netfilter: conntrack: use get_random_once for conntrack hash seedinclude/net/netfilter/nf_conntrack.h net/netfilter/nf_conntrack_core.c+3 -250 replies
7/36netfilter: nf_tables: introduce nft_setelem_parse_flags() helpernet/netfilter/nf_tables_api.c+22 -120 replies
8/36netfilter: nf_tables: parse element flags from nft_del_setelem()net/netfilter/nf_tables_api.c+33 -50 replies
9/36netfilter: nft_rbtree: introduce nft_rbtree_interval_end() helpernet/netfilter/nft_rbtree.c+6 -30 replies
10/36netfilter: nft_rbtree: allow adjacent intervals with dynamic updatesnet/netfilter/nft_rbtree.c+35 -50 replies
11/36netfilter: nf_ct_helper: disable automatic helper assignmentnet/netfilter/nf_conntrack_helper.c+2 -20 replies
12/36netfilter: ip6t_SYNPROXY: unnecessary to check whether ip6_route_output returns NULLnet/ipv6/netfilter/ip6t_SYNPROXY.c+1 -10 replies
13/36netfilter: fix IS_ERR_VALUE usageinclude/linux/netfilter/x_tables.h net/ipv4/netfilter/arp_tables.c net/ipv4/netfilter/ip_tables.c +1 more+15 -90 replies
14/36netfilter: nftables: add connlabel set supportnet/netfilter/nft_ct.c+30 -00 replies
15/36netfilter: conntrack: keep BH enabled during lookupnet/netfilter/nf_conntrack_core.c+8 -170 replies
16/36netfilter: conntrack: fix lookup race during hash resizenet/netfilter/nf_conntrack_core.c+19 -50 replies
17/36netfilter: conntrack: don't attempt to iterate over empty tablenet/netfilter/nf_conntrack_core.c+3 -00 replies
18/36netfilter: conntrack: use nf_ct_key_equal() in more placesnet/netfilter/nf_conntrack_core.c+11 -180 replies
19/36netfilter: conntrack: small refactoring of conntrack seq_printfnet/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c+19 -50 replies
20/36netfilter: conntrack: check netns when comparing conntrack objectsnet/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c net/netfilter/nf_conntrack_core.c net/netfilter/nf_conntrack_netlink.c+22 -120 replies
21/36netfilter: conntrack: make netns address part of hashnet/netfilter/nf_conntrack_core.c+18 -170 replies
22/36netfilter: conntrack: use a single hashtable for all namespacesinclude/net/netfilter/nf_conntrack_core.h include/net/netns/conntrack.h net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c +7 more+62 -680 replies
23/36netfilter: conntrack: consider ct netns in early_drop logicnet/netfilter/nf_conntrack_core.c+25 -180 replies
24/36netfilter: conntrack: __nf_ct_l4proto_find() always returns valid pointernet/netfilter/nf_conntrack_core.c+1 -10 replies
25/36netfilter: conntrack: introduce nf_ct_acct_update()net/netfilter/nf_conntrack_core.c+19 -230 replies
26/36netfilter: conntrack: introduce clash resolution on insertion raceinclude/net/netfilter/nf_conntrack_l4proto.h net/netfilter/nf_conntrack_core.c net/netfilter/nf_conntrack_proto_udp.c +1 more+57 -30 replies
27/36openvswitch: __nf_ct_l{3,4}proto_find() always return a valid pointernet/openvswitch/conntrack.c+0 -80 replies
28/36netfilter: x_tables: get rid of old and inconsistent debuggingnet/ipv4/netfilter/arp_tables.c net/ipv4/netfilter/ip_tables.c net/ipv6/netfilter/ip6_tables.c+117 -5730 replies
29/36netfilter: nf_tables: allow set names up to 32 bytesinclude/net/netfilter/nf_tables.h include/uapi/linux/netfilter/nf_tables.h net/netfilter/nf_tables_api.c+5 -40 replies
30/36ipvs: make drop_entry protection effective for SIP-penet/netfilter/ipvs/ip_vs_conn.c net/netfilter/ipvs/ip_vs_core.c+26 -40 replies
31/36netfilter: conntrack: check netns when walking expect hashnet/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c net/netfilter/nf_conntrack_expect.c net/netfilter/nf_conntrack_netlink.c+30 -40 replies
32/36netfilter: conntrack: make netns address part of expect hashnet/netfilter/nf_conntrack_expect.c+10 -70 replies
33/36netfilter: conntrack: use a single expectation table for all namespacesinclude/net/netfilter/nf_conntrack_expect.h include/net/netns/conntrack.h net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c +3 more+25 -330 replies
34/36netfilter: conntrack: make netns address part of nat bysrc hashnet/netfilter/nf_nat_core.c+3 -30 replies
35/36netfilter: conntrack: use a single nat bysource table for all namespacesinclude/net/netns/conntrack.h net/netfilter/nf_nat_core.c+17 -200 replies
36/36netfilter: conntrack: use single slab cacheinclude/net/netns/conntrack.h net/netfilter/nf_conntrack_core.c+14 -240 replies

Reviews trailers per patch

4 of 36 patches have a Reviewed-by or Acked-by.

PatchJulian AnastasovJarno RajahalmeJoe Stringer
1/36A-b
2/36A-b
3/36
4/36
5/36
6/36
7/36
8/36
9/36
10/36
11/36
12/36
13/36
14/36
15/36
16/36
17/36
18/36
19/36
20/36
21/36
22/36
23/36
24/36
25/36
26/36
27/36A-b A-b
28/36
29/36
30/36A-b
31/36
32/36
33/36
34/36
35/36
36/36

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH 00/36] Netfilter updates for net-next

Hi David,

The following large patchset contains Netfilter updates for your net-next tree. My initial intention was to send you this in two goes but when I looked back twice I already had this burden on top of me.

Several updates for IPVS from Marco Angaroni:

1) Allow SIP connections originating from real-servers to be load balanced by the SIP persistence engine as is already implemented in the other direction.

2) Release connections immediately for One-packet-scheduling (OPS) in IPVS, instead of making it via timer and rcu callback.

3) Skip deleting conntracks for each one packet in OPS, and don't call nf_conntrack_alter_reply() since no reply is expected.

4) Enable drop on exhaustion for OPS + SIP persistence.

Miscelaneous conntrack updates from Florian Westphal, including fix for hash resize:

5) Move conntrack generation counter out of conntrack pernet structure since this is only used by the init_ns to allow hash resizing.

6) Use get_random_once() from packet path to collect hash random seed instead of our compound.

7) Don't disable BH from ____nf_conntrack_find() for statistics, use NF_CT_STAT_INC_ATOMIC() instead.

8) Fix lookup race during conntrack hash resizing.

9) Introduce clash resolution on conntrack insertion for connectionless protocol.

Then, Florian's netns rework to get rid of per-netns conntrack table, thus we use one single table for them all. There was consensus on this change during the NFWS 2015 and, on top of that, it has recently been pointed as a source of multiple problems from unpriviledged netns:

11) Use a single conntrack hashtable for all namespaces. Include netns in object comparisons and make it part of the hash calculation. Adapt early_drop() to consider netns.

12) Use single expectation and NAT hashtable for all namespaces.

13) Use a single slab cache for all namespaces for conntrack objects.

14) Skip full table scanning from nf_ct_iterate_cleanup() if the pernet conntrack counter tells us the table is empty (ie. equals zero).

Fixes for nf_tables interval set element handling, support to set conntrack connlabels and allow set names up to 32 bytes.

15) Parse element flags from element deletion path and pass it up to the backend set implementation.

16) Allow adjacent intervals in the rbtree set type for dynamic interval updates.

17) Add support to set connlabel from nf_tables, from Florian Westphal.

18) Allow set names up to 32 bytes in nf_tables.

Several x_tables fixes and updates:

19) Fix incorrect use of IS_ERR_VALUE() in x_tables, original patch from Andrzej Hajda.

And finally, miscelaneous netfilter updates such as:

20) Disable automatic helper assignment by default. Note this proc knob was introduced by a9006892643a ("netfilter: nf_ct_helper: allow to disable automatic helper assignment") 4 years ago to start moving towards explicit conntrack helper configuration via iptables CT target.

21) Get rid of obsolete and inconsistent debugging instrumentation in x_tables.

22) Remove unnecessary check for null after ip6_route_output().

You can pull these changes from:

git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next.git

Thanks!

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

The following changes since commit 15cfd40771e18a4e9b788c64c9db2606f958b93d:

hv_netvsc: Fix the list processing for network change event (2016-04-24 23:27:58 -0400)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next.git HEAD

for you to fetch changes up to 0c5366b3a8c77fd6d67b763c5a76dfdc314e7726:

netfilter: conntrack: use single slab cache (2016-05-09 16:45:50 +0200)

----------------------------------------------------------------
Florian Westphal (19):
netfilter: conntrack: move generation seqcnt out of netns_ct
netfilter: conntrack: use get_random_once for nat and expectations
netfilter: conntrack: use get_random_once for conntrack hash seed
netfilter: nftables: add connlabel set support
netfilter: conntrack: keep BH enabled during lookup
netfilter: conntrack: fix lookup race during hash resize
netfilter: conntrack: don't attempt to iterate over empty table
netfilter: conntrack: use nf_ct_key_equal() in more places
netfilter: conntrack: small refactoring of conntrack seq_printf
netfilter: conntrack: check netns when comparing conntrack objects
netfilter: conntrack: make netns address part of hash
netfilter: conntrack: use a single hashtable for all namespaces
netfilter: conntrack: consider ct netns in early_drop logic
netfilter: conntrack: check netns when walking expect hash
netfilter: conntrack: make netns address part of expect hash
netfilter: conntrack: use a single expectation table for all namespaces
netfilter: conntrack: make netns address part of nat bysrc hash
netfilter: conntrack: use a single nat bysource table for all namespaces
netfilter: conntrack: use single slab cache

Liping Zhang (1):
netfilter: ip6t_SYNPROXY: unnecessary to check whether ip6_route_output returns NULL

Marco Angaroni (4):
ipvs: handle connections started by real-servers
ipvs: optimize release of connections in OPS mode
ipvs: don't alter conntrack in OPS mode
ipvs: make drop_entry protection effective for SIP-pe

Pablo Neira Ayuso (14):
netfilter: nf_tables: introduce nft_setelem_parse_flags() helper
netfilter: nf_tables: parse element flags from nft_del_setelem()
netfilter: nft_rbtree: introduce nft_rbtree_interval_end() helper
netfilter: nft_rbtree: allow adjacent intervals with dynamic updates
netfilter: nf_ct_helper: disable automatic helper assignment Merge tag 'ipvs-for-v4.7' of https://git.kernel.org/.../horms/ipvs-next
netfilter: fix IS_ERR_VALUE usage
netfilter: conntrack: __nf_ct_l4proto_find() always returns valid pointer
netfilter: conntrack: introduce nf_ct_acct_update()
netfilter: conntrack: introduce clash resolution on insertion race
openvswitch: __nf_ct_l{3,4}proto_find() always return a valid pointer
netfilter: x_tables: get rid of old and inconsistent debugging
netfilter: nf_tables: allow set names up to 32 bytes
Merge tag 'ipvs2-for-v4.7' of https://git.kernel.org/.../horms/ipvs-next

 include/linux/netfilter/x_tables.h                 |   6 +-
 include/net/ip_vs.h                                |  17 +
 include/net/netfilter/nf_conntrack.h               |   2 -
 include/net/netfilter/nf_conntrack_core.h          |   1 +
 include/net/netfilter/nf_conntrack_expect.h        |   1 +
 include/net/netfilter/nf_conntrack_l4proto.h       |   3 +
 include/net/netfilter/nf_tables.h                  |   2 +-
 include/net/netns/conntrack.h                      |  10 -
 include/uapi/linux/netfilter/nf_tables.h           |   1 +
 net/ipv4/netfilter/arp_tables.c                    | 223 ++---------
 net/ipv4/netfilter/ip_tables.c                     | 250 +++----------
 net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c     |   2 +-
 .../netfilter/nf_conntrack_l3proto_ipv4_compat.c   |  47 ++-
 net/ipv6/netfilter/ip6_tables.c                    | 235 +++---------
 net/ipv6/netfilter/ip6t_SYNPROXY.c                 |   2 +-
 net/netfilter/ipvs/ip_vs_conn.c                    |  51 ++-
 net/netfilter/ipvs/ip_vs_core.c                    | 162 +++++++-
 net/netfilter/ipvs/ip_vs_ctl.c                     |  46 ++-
 net/netfilter/ipvs/ip_vs_nfct.c                    |   4 +
 net/netfilter/ipvs/ip_vs_pe_sip.c                  |  15 +
 net/netfilter/nf_conntrack_core.c                  | 415 +++++++++++----------
 net/netfilter/nf_conntrack_expect.c                |  83 +++--
 net/netfilter/nf_conntrack_helper.c                |  12 +-
 net/netfilter/nf_conntrack_netlink.c               |  29 +-
 net/netfilter/nf_conntrack_proto_udp.c             |   2 +
 net/netfilter/nf_conntrack_proto_udplite.c         |   2 +
 net/netfilter/nf_conntrack_standalone.c            |  13 +-
 net/netfilter/nf_nat_core.c                        |  39 +-
 net/netfilter/nf_tables_api.c                      |  78 +++-
 net/netfilter/nfnetlink_cttimeout.c                |   6 +-
 net/netfilter/nft_ct.c                             |  30 ++
 net/netfilter/nft_rbtree.c                         |  49 ++-
 net/openvswitch/conntrack.c                        |   8 -
 33 files changed, 916 insertions(+), 930 deletions(-)