diff options
Diffstat (limited to 'net/socket.c')
-rw-r--r-- | net/socket.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/socket.c b/net/socket.c index b09eb9036a17..a714c6d4e4a1 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -84,6 +84,7 @@ | |||
84 | #include <linux/kmod.h> | 84 | #include <linux/kmod.h> |
85 | #include <linux/audit.h> | 85 | #include <linux/audit.h> |
86 | #include <linux/wireless.h> | 86 | #include <linux/wireless.h> |
87 | #include <linux/nsproxy.h> | ||
87 | 88 | ||
88 | #include <asm/uaccess.h> | 89 | #include <asm/uaccess.h> |
89 | #include <asm/unistd.h> | 90 | #include <asm/unistd.h> |
@@ -1071,7 +1072,7 @@ call_kill: | |||
1071 | return 0; | 1072 | return 0; |
1072 | } | 1073 | } |
1073 | 1074 | ||
1074 | static int __sock_create(int family, int type, int protocol, | 1075 | static int __sock_create(struct net *net, int family, int type, int protocol, |
1075 | struct socket **res, int kern) | 1076 | struct socket **res, int kern) |
1076 | { | 1077 | { |
1077 | int err; | 1078 | int err; |
@@ -1147,7 +1148,7 @@ static int __sock_create(int family, int type, int protocol, | |||
1147 | /* Now protected by module ref count */ | 1148 | /* Now protected by module ref count */ |
1148 | rcu_read_unlock(); | 1149 | rcu_read_unlock(); |
1149 | 1150 | ||
1150 | err = pf->create(sock, protocol); | 1151 | err = pf->create(net, sock, protocol); |
1151 | if (err < 0) | 1152 | if (err < 0) |
1152 | goto out_module_put; | 1153 | goto out_module_put; |
1153 | 1154 | ||
@@ -1186,12 +1187,12 @@ out_release: | |||
1186 | 1187 | ||
1187 | int sock_create(int family, int type, int protocol, struct socket **res) | 1188 | int sock_create(int family, int type, int protocol, struct socket **res) |
1188 | { | 1189 | { |
1189 | return __sock_create(family, type, protocol, res, 0); | 1190 | return __sock_create(current->nsproxy->net_ns, family, type, protocol, res, 0); |
1190 | } | 1191 | } |
1191 | 1192 | ||
1192 | int sock_create_kern(int family, int type, int protocol, struct socket **res) | 1193 | int sock_create_kern(int family, int type, int protocol, struct socket **res) |
1193 | { | 1194 | { |
1194 | return __sock_create(family, type, protocol, res, 1); | 1195 | return __sock_create(&init_net, family, type, protocol, res, 1); |
1195 | } | 1196 | } |
1196 | 1197 | ||
1197 | asmlinkage long sys_socket(int family, int type, int protocol) | 1198 | asmlinkage long sys_socket(int family, int type, int protocol) |