Re: linux-next: net->netns_ids is used after calling idr_destroy for it

2016-11-16 Thread Cong Wang
On Tue, Nov 15, 2016 at 2:45 PM, Andrei Vagin wrote: > On Tue, Nov 15, 2016 at 2:21 PM, Andrei Vagin wrote: >> I would like to agree with you here, but looks like sockets with >> NETLINK_F_LISTEN_ALL_NSID are able to catch these messages. > > Actually I found that I was wrong. > > do_one_broadcas

Re: linux-next: net->netns_ids is used after calling idr_destroy for it

2016-11-15 Thread Andrei Vagin
On Tue, Nov 15, 2016 at 2:21 PM, Andrei Vagin wrote: > On Tue, Nov 15, 2016 at 1:07 PM, Cong Wang wrote: >> On Tue, Nov 15, 2016 at 12:48 PM, Andrei Vagin wrote: >>> On Tue, Nov 15, 2016 at 10:50 AM, Cong Wang >>> wrote: On Tue, Nov 15, 2016 at 10:04 AM, Cong Wang wrote: > On M

Re: linux-next: net->netns_ids is used after calling idr_destroy for it

2016-11-15 Thread Andrei Vagin
On Tue, Nov 15, 2016 at 1:07 PM, Cong Wang wrote: > On Tue, Nov 15, 2016 at 12:48 PM, Andrei Vagin wrote: >> On Tue, Nov 15, 2016 at 10:50 AM, Cong Wang wrote: >>> On Tue, Nov 15, 2016 at 10:04 AM, Cong Wang >>> wrote: On Mon, Nov 14, 2016 at 10:23 PM, Andrei Vagin wrote: > Hi Nicola

Re: linux-next: net->netns_ids is used after calling idr_destroy for it

2016-11-15 Thread Cong Wang
On Tue, Nov 15, 2016 at 12:48 PM, Andrei Vagin wrote: > On Tue, Nov 15, 2016 at 10:50 AM, Cong Wang wrote: >> On Tue, Nov 15, 2016 at 10:04 AM, Cong Wang wrote: >>> On Mon, Nov 14, 2016 at 10:23 PM, Andrei Vagin wrote: Hi Nicolas, cleanup_net() calls idr_destroy(net->netns_ids) f

Re: linux-next: net->netns_ids is used after calling idr_destroy for it

2016-11-15 Thread Andrei Vagin
On Tue, Nov 15, 2016 at 10:50 AM, Cong Wang wrote: > On Tue, Nov 15, 2016 at 10:04 AM, Cong Wang wrote: >> On Mon, Nov 14, 2016 at 10:23 PM, Andrei Vagin wrote: >>> Hi Nicolas, >>> >>> cleanup_net() calls idr_destroy(net->netns_ids) for network namespaces >>> and then it calls unregister_netdevi

Re: linux-next: net->netns_ids is used after calling idr_destroy for it

2016-11-15 Thread Cong Wang
On Tue, Nov 15, 2016 at 10:04 AM, Cong Wang wrote: > On Mon, Nov 14, 2016 at 10:23 PM, Andrei Vagin wrote: >> Hi Nicolas, >> >> cleanup_net() calls idr_destroy(net->netns_ids) for network namespaces >> and then it calls unregister_netdevice_many() which calls >> idr_alloc(net0>netns_ids). It look

Re: linux-next: net->netns_ids is used after calling idr_destroy for it

2016-11-15 Thread Cong Wang
On Mon, Nov 14, 2016 at 10:23 PM, Andrei Vagin wrote: > Hi Nicolas, > > cleanup_net() calls idr_destroy(net->netns_ids) for network namespaces > and then it calls unregister_netdevice_many() which calls > idr_alloc(net0>netns_ids). It looks wrong, doesn't it? > netns id is designed to allocate la

Re: linux-next: net->netns_ids is used after calling idr_destroy for it

2016-11-14 Thread Andrei Vagin
On Mon, Nov 14, 2016 at 10:23 PM, Andrei Vagin wrote: > Hi Nicolas, > > cleanup_net() calls idr_destroy(net->netns_ids) for network namespaces > and then it calls unregister_netdevice_many() which calls > idr_alloc(net0>netns_ids). It looks wrong, doesn't it? Here is a report from kmemleak detect

linux-next: net->netns_ids is used after calling idr_destroy for it

2016-11-14 Thread Andrei Vagin
Hi Nicolas, cleanup_net() calls idr_destroy(net->netns_ids) for network namespaces and then it calls unregister_netdevice_many() which calls idr_alloc(net0>netns_ids). It looks wrong, doesn't it? I compiled the kernel with the next patch: diff --git a/lib/idr.c b/lib/idr.c index 6098336..c0a3a32