[NET]: Make socket creation namespace safe.
authorEric W. Biederman <ebiederm@xmission.com>
Tue, 9 Oct 2007 06:24:22 +0000 (23:24 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 10 Oct 2007 23:49:07 +0000 (16:49 -0700)
commit1b8d7ae42d02e483ad94035cca851e4f7fbecb40
tree81f8cc0ee49ef99cc67dfed3dc7b7ecb510abf8b
parent457c4cbc5a3dde259d2a1f15d5f9785290397267
[NET]: Make socket creation namespace safe.

This patch passes in the namespace a new socket should be created in
and has the socket code do the appropriate reference counting.  By
virtue of this all socket create methods are touched.  In addition
the socket create methods are modified so that they will fail if
you attempt to create a socket in a non-default network namespace.

Failing if we attempt to create a socket outside of the default
network namespace ensures that as we incrementally make the network stack
network namespace aware we will not export functionality that someone
has not audited and made certain is network namespace safe.
Allowing us to partially enable network namespaces before all of the
exotic protocols are supported.

Any protocol layers I have missed will fail to compile because I now
pass an extra parameter into the socket creation code.

[ Integrated AF_IUCV build fixes from Andrew Morton... -DaveM ]

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
44 files changed:
drivers/net/pppoe.c
drivers/net/pppol2tp.c
drivers/net/pppox.c
include/linux/if_pppox.h
include/linux/net.h
include/net/iucv/af_iucv.h
include/net/llc_conn.h
include/net/sock.h
net/appletalk/ddp.c
net/atm/common.c
net/atm/common.h
net/atm/pvc.c
net/atm/svc.c
net/ax25/af_ax25.c
net/bluetooth/af_bluetooth.c
net/bluetooth/bnep/sock.c
net/bluetooth/cmtp/sock.c
net/bluetooth/hci_sock.c
net/bluetooth/hidp/sock.c
net/bluetooth/l2cap.c
net/bluetooth/rfcomm/sock.c
net/bluetooth/sco.c
net/core/sock.c
net/decnet/af_decnet.c
net/econet/af_econet.c
net/ipv4/af_inet.c
net/ipv6/af_inet6.c
net/ipx/af_ipx.c
net/irda/af_irda.c
net/iucv/af_iucv.c
net/key/af_key.c
net/llc/af_llc.c
net/llc/llc_conn.c
net/netlink/af_netlink.c
net/netrom/af_netrom.c
net/packet/af_packet.c
net/rose/af_rose.c
net/rxrpc/af_rxrpc.c
net/sctp/ipv6.c
net/sctp/protocol.c
net/socket.c
net/tipc/socket.c
net/unix/af_unix.c
net/x25/af_x25.c