Re: [PATCH RFC net-next 3/3] net/core/sock.c: sk_clone_lock() should only do get_net() if the parent is not a kernel socket

2015-07-30 Thread Eric Dumazet
On Thu, 2015-07-30 at 11:29 -0700, Cong Wang wrote: > On Thu, Jul 30, 2015 at 6:06 AM, Eric Dumazet wrote: > > CC Eric Biederman > > > > It looks this should be submitted for 'net' tree, not 'net-next' > > > > It only affects TCP kernel sockets, and we only have few use cases in tree, > and it l

Re: [PATCH RFC net-next 3/3] net/core/sock.c: sk_clone_lock() should only do get_net() if the parent is not a kernel socket

2015-07-30 Thread Cong Wang
On Thu, Jul 30, 2015 at 6:06 AM, Eric Dumazet wrote: > On Thu, 2015-07-30 at 04:55 -0400, Sowmini Varadhan wrote: >> The newsk returned by sk_clone_lock should hold a get_net() >> reference if, and only if, the parent is not a kernel socket >> (making this similar to sk_alloc()). >> >> E.g,. for t

Re: [PATCH RFC net-next 3/3] net/core/sock.c: sk_clone_lock() should only do get_net() if the parent is not a kernel socket

2015-07-30 Thread Eric Dumazet
On Thu, 2015-07-30 at 04:55 -0400, Sowmini Varadhan wrote: > The newsk returned by sk_clone_lock should hold a get_net() > reference if, and only if, the parent is not a kernel socket > (making this similar to sk_alloc()). > > E.g,. for the SYN_RECV call path, tcp_v4_syn_recv_sock->..inet_csk_clon

[PATCH RFC net-next 3/3] net/core/sock.c: sk_clone_lock() should only do get_net() if the parent is not a kernel socket

2015-07-30 Thread Sowmini Varadhan
The newsk returned by sk_clone_lock should hold a get_net() reference if, and only if, the parent is not a kernel socket (making this similar to sk_alloc()). E.g,. for the SYN_RECV call path, tcp_v4_syn_recv_sock->..inet_csk_clone_lock sets up the syn_recv newsk from sk_clone_lock. When the parent