From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Lezcano Subject: netns : close all sockets at unshare ? Date: Tue, 02 Oct 2007 23:45:24 +0200 Message-ID: <4702BBF4.60903@fr.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: "Eric W. Biederman" Cc: Linux Containers List-Id: containers.vger.kernel.org Hi, I was looking at some cornercases and trying to figure out what happens if someone does: 1 - fd = socket(...) 2 - unshare(CLONE_NEWNET) 3 - bind(fd, ...) / listen(fd, ...) There is here an interaction between two namespaces. Trying to catch all these little tricky paths everywhere with the network namespace is painful, perhaps we should consider a more radical solution. Shall we close all fd sockets when doing an unshare ? like a close-on-exec behavior ?