Netdev List
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] net namespace support in l2tp_core
@ 2013-01-04 17:51 Tom Parkin
  2013-01-04 17:51 ` [RFC PATCH 1/3] l2tp: set netnsok flag for netlink messages Tom Parkin
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tom Parkin @ 2013-01-04 17:51 UTC (permalink / raw)
  To: netdev; +Cc: Tom Parkin

This exploratory patchset is an attempt to fix up l2tp_core to behave properly
with network namespaces, based on issues raised previously on netdev[1].

The reason I'm posting it as an RFC is that I'm seeing some bugs that I'm
having trouble tracking down, and I'd appreciate any suggestions as to what
I'm doing wrong.

During stress testing I see kernel oopses after a few hours.  My stress test is 
a script which spawns lots of sub-processes which create and delete multiple 
namespaces containing multiple l2tp tunnels.  I've seen oopses in various 
locations -- for example, ndist_net_exit, dst_ifdown, 
netlink_broadcast_filtered, dev_change_net_namespace.  I'm assuming my changes 
are causing some race condition which might bite in multiple places depending 
on timing.

So far I'm guessing that the method I'm using to clean up l2tp tunnel sockets
in the net namespace callback may be to blame.  In the case of "unmanaged"
sockets (see patch 3 for details) the socket is created using:

	sock_create_kern
	sk_change_net

to create a socket without a namespace reference.  When the namespace exits, I
walk the per-namespace list of tunnels, calling sk_release_kernel to release
the socket.  The l2tp-specific resources are freed in the socket destructor
function.

This general pattern of socket creation and destruction
(sock_create_kern/sk_change_net/sk_release_kernel) seems to be used
elsewhere, for example inet_ctl_sock_create and inet_ctl_sock_destroy.  So
this seems reasonable.  I'm not sure if hanging resource deallocation off
sk_destruct in this context is OK, though.  Any comments welcome!

Thanks,
Tom

[1].
	http://www.spinics.net/lists/netdev/msg214776.html
	http://www.spinics.net/lists/netdev/msg212234.html

Tom Parkin (3):
  l2tp: set netnsok flag for netlink messages
  l2tp: prevent tunnel creation on netns mismatch
  l2tp: fix network namespace use for unmanaged tunnel sockets

 net/l2tp/l2tp_core.c    |   94 ++++++++++++++++++++++++++++++-----------------
 net/l2tp/l2tp_netlink.c |    1 +
 2 files changed, 62 insertions(+), 33 deletions(-)

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-01-04 17:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-04 17:51 [RFC PATCH 0/3] net namespace support in l2tp_core Tom Parkin
2013-01-04 17:51 ` [RFC PATCH 1/3] l2tp: set netnsok flag for netlink messages Tom Parkin
2013-01-04 17:51 ` [RFC 2/3] l2tp: prevent tunnel creation on netns mismatch Tom Parkin
2013-01-04 17:51 ` [RFC PATCH 3/3] l2tp: fix network namespace use for unmanaged tunnel sockets Tom Parkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox