From: Denis V. Lunev Date: Sat, 19 Jan 2008 07:55:19 +0000 (-0800) Subject: [NETNS]: Namespace stop vs 'ip r l' race. X-Git-Tag: v2.6.25-rc1~1162^2~271 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=775516bfa2bd7993620c9039191a0c30b8d8a496;p=pandora-kernel.git [NETNS]: Namespace stop vs 'ip r l' race. During network namespace stop process kernel side netlink sockets belonging to a namespace should be closed. They should not prevent namespace to stop, so they do not increment namespace usage counter. Though this counter will be put during last sock_put. The raplacement of the correct netns for init_ns solves the problem only partial as socket to be stoped until proper stop is a valid netlink kernel socket and can be looked up by the user processes. This is not a problem until it resides in initial namespace (no processes inside this net), but this is not true for init_net. So, hold the referrence for a socket, remove it from lookup tables and only after that change namespace and perform a last put. Signed-off-by: Denis V. Lunev Tested-by: Alexey Dobriyan Signed-off-by: David S. Miller --- Reading git-diff-tree failed