Re: [PATCH v2 2/3] net: Add BUG_ON() to get_net()

2018-01-10 Thread Kirill Tkhai
On 10.01.2018 12:58, Eric Dumazet wrote: > On Wed, 2018-01-10 at 10:37 +0300, Kirill Tkhai wrote: >> On 09.01.2018 21:52, Eric Dumazet wrote: >>> On Tue, 2018-01-09 at 18:00 +0300, Kirill Tkhai wrote: Since people may mistakenly obtain destroying net from net_namespace_list and from

Re: [PATCH v2 2/3] net: Add BUG_ON() to get_net()

2018-01-10 Thread Eric Dumazet
On Wed, 2018-01-10 at 10:37 +0300, Kirill Tkhai wrote: > On 09.01.2018 21:52, Eric Dumazet wrote: > > On Tue, 2018-01-09 at 18:00 +0300, Kirill Tkhai wrote: > > > Since people may mistakenly obtain destroying net > > > from net_namespace_list and from net::netns_ids > > > without checking for its

Re: [PATCH v2 2/3] net: Add BUG_ON() to get_net()

2018-01-09 Thread Kirill Tkhai
On 09.01.2018 21:52, Eric Dumazet wrote: > On Tue, 2018-01-09 at 18:00 +0300, Kirill Tkhai wrote: >> Since people may mistakenly obtain destroying net >> from net_namespace_list and from net::netns_ids >> without checking for its net::counter, let's protect >> against such situations and insert

Re: [PATCH v2 2/3] net: Add BUG_ON() to get_net()

2018-01-09 Thread Eric Dumazet
On Tue, 2018-01-09 at 18:00 +0300, Kirill Tkhai wrote: > Since people may mistakenly obtain destroying net > from net_namespace_list and from net::netns_ids > without checking for its net::counter, let's protect > against such situations and insert BUG_ON() to stop > move on after this. > > Panic

[PATCH v2 2/3] net: Add BUG_ON() to get_net()

2018-01-09 Thread Kirill Tkhai
Since people may mistakenly obtain destroying net from net_namespace_list and from net::netns_ids without checking for its net::counter, let's protect against such situations and insert BUG_ON() to stop move on after this. Panic is better, than memory corruption and undefined behavior.