Skip to content

Netfilter fixes for net

Pablo Neira Ayuso netdev netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8netfilter: nfnl_cthelper: fix incorrect helper->expect_class_maxnet/netfilter/nfnetlink_cthelper.c+11 -90 replies
2/8netfilter: nfnl_cthelper: fix runtime expectation policy updatesnet/netfilter/nfnetlink_cthelper.c+84 -20 replies
3/8netfilter: nfnl_cthelper: Fix memory leaknet/netfilter/nfnetlink_cthelper.c+9 -30 replies
4/8netfilter: invoke synchronize_rcu after set the _hook_ to NULLnet/ipv4/netfilter/nf_nat_snmp_basic.c net/netfilter/nf_conntrack_ecache.c net/netfilter/nf_conntrack_netlink.c +2 more+7 -10 replies
5/8netfilter: nfnl_cthelper: fix a race when walk the nf_ct_helper_hash tablenet/netfilter/nfnetlink_cthelper.c+81 -960 replies
6/8netfilter: nf_ct_ext: fix possible panic after nf_ct_extend_unregisternet/netfilter/nf_conntrack_extend.c+10 -30 replies
7/8netfilter: nf_nat_snmp: Fix panic when snmp_trap_helper fails to registernet/ipv4/netfilter/nf_nat_snmp_basic.c+1 -180 replies
8/8netfilter: nfnetlink_queue: fix secctx memory leaknet/netfilter/nfnetlink_queue.c+7 -20 replies

Reviews trailers per patch

2 of 8 patches have a Reviewed-by or Acked-by.

PatchLiping ZhangFlorian Westphal
1/8
2/8A-b
3/8
4/8
5/8
6/8A-b
7/8
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/8] Netfilter fixes for net

Hi David,

The following patchset contains a rather large update with Netfilter fixes, specifically targeted to incorrect RCU usage in several spots and the userspace conntrack helper infrastructure (nfnetlink_cthelper), more specifically they are:

1) expect_class_max is incorrect set via cthelper, as in kernel semantics mandate that this represents the array of expectation classes minus 1. Patch from Liping Zhang.

2) Expectation policy updates via cthelper are currently broken for several
reasons: This code allows illegal changes in the policy such as changing the number of expeciation classes, it is leaking the updated policy and such update occurs with no RCU protection at all. Fix this by adding a new nfnl_cthelper_update_policy() that describes what is really legal on the update path.

3) Fix several memory leaks in cthelper, from Jeffy Chen.

4) synchronize_rcu() is missing in the removal path of several modules, this may lead to races since CPU may still be running on code that has just gone. Also from Liping Zhang.

5) Don't use the helper hashtable from cthelper, it is not safe to walk over those bits without the helper mutex. Fix this by introducing a new independent list for userspace helpers. From Liping Zhang.

6) nf_ct_extend_unregister() needs synchronize_rcu() to make sure no packets are walking on any conntrack extension that is gone after module removal, again from Liping.

7) nf_nat_snmp may crash if we fail to unregister the helper due to accidental leftover code, from Gao Feng.

8) Fix leak in nfnetlink_queue with secctx support, from Liping Zhang.

You can pull these changes from:

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

Thanks!

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

The following changes since commit db7f00b8dba6d687b6ab1f2e9309acfd214fcb4b:

tcp: tcp_get_info() should read tcp_time_stamp later (2017-03-16 21:37:13 -0700)

are available in the git repository at:

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

for you to fetch changes up to 77c1c03c5b8ef28e55bb0aff29b1e006037ca645:

netfilter: nfnetlink_queue: fix secctx memory leak (2017-03-29 12:20:50 +0200)

----------------------------------------------------------------
Gao Feng (1):
netfilter: nf_nat_snmp: Fix panic when snmp_trap_helper fails to register

Jeffy Chen (1):
netfilter: nfnl_cthelper: Fix memory leak

Liping Zhang (5):
netfilter: nfnl_cthelper: fix incorrect helper->expect_class_max
netfilter: invoke synchronize_rcu after set the _hook_ to NULL
netfilter: nfnl_cthelper: fix a race when walk the nf_ct_helper_hash table
netfilter: nf_ct_ext: fix possible panic after nf_ct_extend_unregister
netfilter: nfnetlink_queue: fix secctx memory leak

Pablo Neira Ayuso (1):
netfilter: nfnl_cthelper: fix runtime expectation policy updates

 net/ipv4/netfilter/nf_nat_snmp_basic.c |  20 +--
 net/netfilter/nf_conntrack_ecache.c    |   2 +
 net/netfilter/nf_conntrack_extend.c    |  13 +-
 net/netfilter/nf_conntrack_netlink.c   |   1 +
 net/netfilter/nf_nat_core.c            |   2 +
 net/netfilter/nfnetlink_cthelper.c     | 287 +++++++++++++++++++++------------
 net/netfilter/nfnetlink_cttimeout.c    |   2 +-
 net/netfilter/nfnetlink_queue.c        |   9 +-
 8 files changed, 206 insertions(+), 130 deletions(-)