aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net/core/net_namespace.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2020-06-12 09:57:00 -0600
committerRob Herring <robh@kernel.org>2020-06-12 09:57:00 -0600
commit8440d4a75d90556cfb8fb3e244443f67381aafd6 (patch)
tree2e1c986942c3beb6257121e52449f827a8ce4eaf /net/core/net_namespace.c
parentscripts/dtc: use pkg-config to include <yaml.h> in non-standard path (diff)
parentdt-bindings: Remove redundant 'maxItems' (diff)
downloadwireguard-linux-8440d4a75d90556cfb8fb3e244443f67381aafd6.tar.xz
wireguard-linux-8440d4a75d90556cfb8fb3e244443f67381aafd6.zip
Merge branch 'dt/schema-cleanups' into dt/linus
Diffstat (limited to 'net/core/net_namespace.c')
-rw-r--r--net/core/net_namespace.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 190ca66a383b..dcd61aca343e 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -1353,12 +1353,13 @@ static void netns_put(struct ns_common *ns)
put_net(to_net_ns(ns));
}
-static int netns_install(struct nsproxy *nsproxy, struct ns_common *ns)
+static int netns_install(struct nsset *nsset, struct ns_common *ns)
{
+ struct nsproxy *nsproxy = nsset->nsproxy;
struct net *net = to_net_ns(ns);
if (!ns_capable(net->user_ns, CAP_SYS_ADMIN) ||
- !ns_capable(current_user_ns(), CAP_SYS_ADMIN))
+ !ns_capable(nsset->cred->user_ns, CAP_SYS_ADMIN))
return -EPERM;
put_net(nsproxy->net_ns);