[PATCH nf] netfilter: nf_ct_dccp/sctp: fix memory leak after netns cleanup

2017-06-04 Thread Liping Zhang
From: Liping Zhang After running the following commands for a while, kmemleak reported that "1879 new suspected memory leaks" happened: # while : ; do ip netns add test ip netns delete test done unreferenced object 0x88006342fa38 (size 1024): comm "ip", pid 15477, jiffies 4295982

Re: [PATCH] ipset: Fix ipset command replacement in runtest.sh

2017-06-04 Thread Jozsef Kadlecsik
Hi, On Tue, 30 May 2017, Neutron Soutmun wrote: > Fix the ipset command replacement. > > For ipset="/sbin/ipset" > > Actual: > /sbin//sbin/ipset 2>.foo.err | ... | xargs -n1 ipset > Expected: > /sbin/ipset 2>.foo.err | ... | xargs -n1 /sbin/ipset > --- > tests/runtest.sh | 2 +-

[PATCH nf-next RFC 4/5] netfilter: complete the netns support for the user cthelpers

2017-06-04 Thread Liping Zhang
From: Liping Zhang First, we should make the global nfnl_cthelper_list become per-net, so different netns's user cthelpers will be linked to the different global lists. Second, when we do the netns cleanup work, we may invoke the nfnl_cthelper_net_exit and nf_conntrack_helper_put in different or

[PATCH nf-next RFC 5/5] netfilter: complete the netns support for the kernel built-in cthelpers

2017-06-04 Thread Liping Zhang
From: Liping Zhang In order to support net namespace for these built-in cthelpers, we must kmemdup the nf_conntrack_helper and the related _expect_policy before we insert them to the nf_ct_helper_hash. Then free them after unregistration. These are all done by helper_register/unregister. But ano

[PATCH nf-next RFC 3/5] netfilter: make each ct helper belong to a specific netns

2017-06-04 Thread Liping Zhang
From: Liping Zhang This is the first part to support net namespace for ct helpers. When we register a ct helper, we will store the related netns. So later, we can only find the ct helper belong to a specified netns, i.e. we will add "struct net *" parameter to these ct_helper_find functions and

[PATCH nf-next RFC 2/5] netfilter: make nf_conntrack_helper_register become per-net

2017-06-04 Thread Liping Zhang
From: Liping Zhang Now we add "struct net *" parameter to the nf_conntrack_helper_register/ unregister function, and make the kernel built-in ct helpers to use pernet subsys operation. Also note, after this patch, we only support ct helper register in &init_net netns, but the followup patches wi

[PATCH nf-next RFC 1/5] netfilter: use nf_conntrack_helpers_register when possible

2017-06-04 Thread Liping Zhang
From: Liping Zhang amanda_helper, nf_conntrack_helper_ras and nf_conntrack_helper_q931 are all arrays, so we can use nf_conntrack_helpers_register to register the ct helper, this will help us to eliminate some "goto errX" statements. Also introduce h323_helper_init/exit helper function to regist

[PATCH nf-next RFC 0/5] netfilter: add net namespace support for cthelper

2017-06-04 Thread Liping Zhang
This patch set aims to add net namespace support for the ct helper, it is a little large, but I try my best to split them to a relative smaller patches, which will help to review. Comments are welcome. Actually, I split the whole thing into 4 parts: 1. make nf_conntrack_helper_register become per-

Re: [PATCH nf-next RFC 0/5] netfilter: add net namespace support for cthelper

2017-06-04 Thread Florian Westphal
Liping Zhang wrote: > This patch set aims to add net namespace support for the ct helper, > it is a little large, but I try my best to split them to a relative > smaller patches, which will help to review. Comments are welcome. Why? Could you explain what kind of functionality is added here, or

Re: [PATCH nf-next RFC 0/5] netfilter: add net namespace support for cthelper

2017-06-04 Thread Pablo Neira Ayuso
On Sun, Jun 04, 2017 at 06:07:53PM +0200, Florian Westphal wrote: > Liping Zhang wrote: > > This patch set aims to add net namespace support for the ct helper, > > it is a little large, but I try my best to split them to a relative > > smaller patches, which will help to review. Comments are welco

Re: [PATCH nf-next RFC 0/5] netfilter: add net namespace support for cthelper

2017-06-04 Thread Liping Zhang
Hi Florian & Pablo, 2017-06-05 0:07 GMT+08:00 Florian Westphal : > Liping Zhang wrote: >> This patch set aims to add net namespace support for the ct helper, >> it is a little large, but I try my best to split them to a relative >> smaller patches, which will help to review. Comments are welcome.