hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/kernel/utsname.c
....@@ -1,12 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2004 IBM Corporation
34 *
45 * Author: Serge Hallyn <serue@us.ibm.com>
5
- *
6
- * This program is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU General Public License as
8
- * published by the Free Software Foundation, version 2 of the
9
- * License.
106 */
117
128 #include <linux/export.h>
....@@ -144,12 +140,13 @@
144140 put_uts_ns(to_uts_ns(ns));
145141 }
146142
147
-static int utsns_install(struct nsproxy *nsproxy, struct ns_common *new)
143
+static int utsns_install(struct nsset *nsset, struct ns_common *new)
148144 {
145
+ struct nsproxy *nsproxy = nsset->nsproxy;
149146 struct uts_namespace *ns = to_uts_ns(new);
150147
151148 if (!ns_capable(ns->user_ns, CAP_SYS_ADMIN) ||
152
- !ns_capable(current_user_ns(), CAP_SYS_ADMIN))
149
+ !ns_capable(nsset->cred->user_ns, CAP_SYS_ADMIN))
153150 return -EPERM;
154151
155152 get_uts_ns(ns);