Home
last modified time | relevance | path

Searched refs:user_ns (Results 1 – 25 of 152) sorted by relevance

1234567

/linux/kernel/
H A Dnsproxy.c89 struct task_struct *tsk, struct user_namespace *user_ns, in create_new_namespaces() argument
100 user_ns, new_fs); in create_new_namespaces()
106 new_nsp->uts_ns = copy_utsname(flags, user_ns, tsk->nsproxy->uts_ns); in create_new_namespaces()
112 new_nsp->ipc_ns = copy_ipcs(flags, user_ns, tsk->nsproxy->ipc_ns); in create_new_namespaces()
119 copy_pid_ns(flags, user_ns, tsk->nsproxy->pid_ns_for_children); in create_new_namespaces()
125 new_nsp->cgroup_ns = copy_cgroup_ns(flags, user_ns, in create_new_namespaces()
132 new_nsp->net_ns = copy_net_ns(flags, user_ns, tsk->nsproxy->net_ns); in create_new_namespaces()
138 new_nsp->time_ns_for_children = copy_time_ns(flags, user_ns, in create_new_namespaces()
172 struct user_namespace *user_ns = task_cred_xxx(tsk, user_ns); in copy_namespaces() local
214 struct user_namespace *user_ns; unshare_nsproxy_namespaces() local
402 struct user_namespace *user_ns = NULL; validate_nsset() local
[all...]
H A Dutsname.c36 static struct uts_namespace *clone_uts_ns(struct user_namespace *user_ns, in clone_uts_ns() argument
44 ucounts = inc_uts_namespaces(user_ns); in clone_uts_ns()
60 ns->user_ns = get_user_ns(user_ns); in clone_uts_ns()
80 struct user_namespace *user_ns, struct uts_namespace *old_ns) in copy_utsname() argument
89 new_ns = clone_uts_ns(user_ns, old_ns); in copy_utsname()
99 put_user_ns(ns->user_ns); in free_uts_ns()
131 if (!ns_capable(ns->user_ns, CAP_SYS_ADMIN) || in utsns_install()
132 !ns_capable(nsset->cred->user_ns, CAP_SYS_ADMIN)) in utsns_install()
143 return to_uts_ns(ns)->user_ns; in utsns_owner()
H A Duid16.c70 ruid = high2lowuid(from_kuid_munged(cred->user_ns, cred->uid)); in SYSCALL_DEFINE3()
71 euid = high2lowuid(from_kuid_munged(cred->user_ns, cred->euid)); in SYSCALL_DEFINE3()
72 suid = high2lowuid(from_kuid_munged(cred->user_ns, cred->suid)); in SYSCALL_DEFINE3()
93 rgid = high2lowgid(from_kgid_munged(cred->user_ns, cred->gid)); in SYSCALL_DEFINE3()
94 egid = high2lowgid(from_kgid_munged(cred->user_ns, cred->egid)); in SYSCALL_DEFINE3()
95 sgid = high2lowgid(from_kgid_munged(cred->user_ns, cred->sgid)); in SYSCALL_DEFINE3()
117 struct user_namespace *user_ns = current_user_ns(); in groups16_to_user() local
124 group = high2lowgid(from_kgid_munged(user_ns, kgid)); in groups16_to_user()
135 struct user_namespace *user_ns = current_user_ns(); in groups16_from_user() local
144 kgid = make_kgid(user_ns, low2highgid(group)); in groups16_from_user()
H A Dpid_namespace.c76 static struct pid_namespace *create_pid_namespace(struct user_namespace *user_ns, in create_pid_namespace() argument
85 if (!in_userns(parent_pid_ns->user_ns, user_ns)) in create_pid_namespace()
91 ucounts = inc_pid_namespaces(user_ns); in create_pid_namespace()
117 ns->user_ns = get_user_ns(user_ns); in create_pid_namespace()
145 put_user_ns(ns->user_ns); in delayed_free_pidns()
176 struct user_namespace *user_ns, struct pid_namespace *old_ns) in copy_pid_ns() argument
182 return create_pid_namespace(user_ns, old_ns); in copy_pid_ns()
294 if (write && !checkpoint_restore_ns_capable(pid_ns->user_ns)) in pid_ns_ctl_handler()
399 if (!ns_capable(new->user_ns, CAP_SYS_ADMIN) || in pidns_install()
400 !ns_capable(nsset->cred->user_ns, CAP_SYS_ADMIN)) in pidns_install()
[all …]
H A Dgroups.c40 struct user_namespace *user_ns = current_user_ns(); in groups_to_user() local
46 gid = from_kgid_munged(user_ns, group_info->gid[i]); in groups_to_user()
57 struct user_namespace *user_ns = current_user_ns(); in groups_from_user() local
67 kgid = make_kgid(user_ns, gid); in groups_from_user()
187 struct user_namespace *user_ns = current_user_ns(); in may_setgroups() local
189 return ns_capable_setid(user_ns, CAP_SETGID) && in may_setgroups()
190 userns_may_setgroups(user_ns); in may_setgroups()
H A Dnstree.c214 struct user_namespace *user_ns; in __ns_tree_add_raw() local
217 user_ns = ops->owner(ns); in __ns_tree_add_raw()
218 if (user_ns) { in __ns_tree_add_raw()
219 struct ns_common *owner = &user_ns->ns; in __ns_tree_add_raw()
236 struct user_namespace *user_ns; in __ns_tree_remove() local
251 user_ns = ops->owner(ns); in __ns_tree_remove()
252 if (user_ns) { in __ns_tree_remove()
253 struct ns_common *owner = &user_ns->ns; in __ns_tree_remove()
409 struct user_namespace *user_ns; member
416 put_user_ns(kls->user_ns); in __free_klistns_free()
[all...]
H A Duser_namespace.c45 static void set_cred_user_ns(struct cred *cred, struct user_namespace *user_ns) in set_cred_user_ns() argument
64 cred->user_ns = user_ns; in enforced_nproc_rlimit()
89 struct user_namespace *ns, *parent_ns = new->user_ns; in create_user_ns()
137 /* Leave the new->user_ns reference with the new user namespace. */ in create_user_ns()
904 const struct user_namespace *file_ns = file->f_cred->user_ns; in verify_root_map()
1361 struct user_namespace *user_ns; in userns_get()
1364 user_ns = get_user_ns(__task_cred(task)->user_ns); in userns_get()
1367 return user_ns
1358 struct user_namespace *user_ns; userns_get() local
1374 struct user_namespace *user_ns = to_user_ns(ns); userns_install() local
[all...]
/linux/kernel/cgroup/
H A Dnamespace.c41 put_user_ns(ns->user_ns); in free_cgroup_ns()
49 struct user_namespace *user_ns, in copy_cgroup_ns() argument
62 if (!ns_capable(user_ns, CAP_SYS_ADMIN)) in copy_cgroup_ns()
65 ucounts = inc_cgroup_namespaces(user_ns); in copy_cgroup_ns()
82 new_ns->user_ns = get_user_ns(user_ns); in copy_cgroup_ns()
95 if (!ns_capable(nsset->cred->user_ns, CAP_SYS_ADMIN) || in cgroupns_install()
96 !ns_capable(cgroup_ns->user_ns, CAP_SYS_ADMIN)) in cgroupns_install()
133 return to_cg_ns(ns)->user_ns; in cgroupns_owner()
/linux/ipc/
H A Dnamespace.c39 static struct ipc_namespace *create_ipc_ns(struct user_namespace *user_ns, in create_ipc_ns() argument
48 ucounts = inc_ipc_namespaces(user_ns); in create_ipc_ns()
69 ns->user_ns = get_user_ns(user_ns); in create_ipc_ns()
100 put_user_ns(ns->user_ns); in create_ipc_ns()
111 struct user_namespace *user_ns, struct ipc_namespace *ns) in copy_ipcs()
115 return create_ipc_ns(user_ns, ns); in copy_ipcs()
164 put_user_ns(ns->user_ns); in free_ipc_ns()
236 if (!ns_capable(ns->user_ns, CAP_SYS_ADMIN) || in ipcns_install()
237 !ns_capable(nsset->cred->user_ns, CAP_SYS_ADMI in ipcns_install()
112 copy_ipcs(u64 flags,struct user_namespace * user_ns,struct ipc_namespace * ns) copy_ipcs() argument
[all...]
/linux/fs/
H A Dbinfmt_misc_bpf.c41 struct user_namespace *user_ns; member
49 static struct bm_bpf_ops_reg *bm_bpf_ops_find(const struct user_namespace *user_ns, in bm_bpf_ops_find() argument
57 if (reg->user_ns == user_ns && !strcmp(reg->ops->name, name)) in bm_bpf_ops_find()
76 const struct binfmt_misc_ops *binfmt_misc_get_ops(struct user_namespace *user_ns, in binfmt_misc_get_ops() argument
83 reg = bm_bpf_ops_find(user_ns, name); in binfmt_misc_get_ops()
411 reg->user_ns = get_user_ns(current_user_ns()); in bm_bpf_reg()
415 if (bm_bpf_ops_find(reg->user_ns, ops->name)) { in bm_bpf_reg()
416 put_user_ns(reg->user_ns); in bm_bpf_reg()
434 put_user_ns(reg->user_ns); in bm_bpf_unreg()
H A Dpidfs.c378 struct user_namespace *user_ns; in pidfd_info()
456 user_ns = current_user_ns(); in pidfd_info()
457 kinfo.ruid = from_kuid_munged(user_ns, c->uid); in pidfd_info()
458 kinfo.rgid = from_kgid_munged(user_ns, c->gid); in pidfd_info()
459 kinfo.euid = from_kuid_munged(user_ns, c->euid); in pidfd_info()
460 kinfo.egid = from_kgid_munged(user_ns, c->egid); in pidfd_info()
461 kinfo.suid = from_kuid_munged(user_ns, c->suid); in pidfd_info()
462 kinfo.sgid = from_kgid_munged(user_ns, c->sgid); in pidfd_info()
463 kinfo.fsuid = from_kuid_munged(user_ns, c->fsuid); in pidfd_info()
464 kinfo.fsgid = from_kgid_munged(user_ns, in pidfd_info()
372 struct user_namespace *user_ns; pidfd_info() local
647 struct user_namespace *user_ns; pidfd_ioctl() local
[all...]
H A Dnsfs.c216 struct user_namespace *user_ns; in ns_ioctl() local
244 user_ns = container_of(ns, struct user_namespace, ns); in ns_ioctl()
246 uid = from_kuid_munged(current_user_ns(), user_ns->owner); in ns_ioctl()
579 owning_ns = to_cg_ns(ns)->user_ns; in nsfs_fh_to_dentry()
585 owning_ns = to_ipc_ns(ns)->user_ns; in nsfs_fh_to_dentry()
590 owning_ns = to_mnt_ns(ns)->user_ns; in nsfs_fh_to_dentry()
595 owning_ns = to_net_ns(ns)->user_ns; in nsfs_fh_to_dentry()
601 owning_ns = to_pid_ns(ns)->user_ns; in nsfs_fh_to_dentry()
611 owning_ns = to_time_ns(ns)->user_ns; in nsfs_fh_to_dentry()
623 owning_ns = to_uts_ns(ns)->user_ns; in nsfs_fh_to_dentry()
[all...]
H A Dfs_context.c283 fc->user_ns = get_user_ns(fc->cred->user_ns); in alloc_fs_context()
286 fc->user_ns = get_user_ns(reference->d_sb->s_user_ns); in alloc_fs_context()
290 fc->user_ns = get_user_ns(reference->d_sb->s_user_ns); in alloc_fs_context()
386 get_user_ns(fc->user_ns); in vfs_dup_fs_context()
506 put_user_ns(fc->user_ns); in put_fs_context()
/linux/fs/fuse/
H A Dreq.c11 kuid_t fsuid = mapped_fsuid(idmap, fc->user_ns); in fuse_fill_creds()
12 kgid_t fsgid = mapped_fsgid(idmap, fc->user_ns); in fuse_fill_creds()
21 args->uid = from_kuid_munged(fc->user_ns, current_fsuid()); in fuse_fill_creds()
22 args->gid = from_kgid_munged(fc->user_ns, current_fsgid()); in fuse_fill_creds()
43 args->uid = from_kuid(fc->user_ns, fsuid); in fuse_fill_creds()
44 args->gid = from_kgid(fc->user_ns, fsgid); in fuse_fill_creds()
/linux/security/keys/
H A Dproc.c66 struct user_namespace *user_ns = seq_user_ns(p); in key_serial_next() local
71 if (kuid_has_mapping(user_ns, key->uid)) in key_serial_next()
80 struct user_namespace *user_ns = seq_user_ns(p); in find_ge_key() local
103 if (kuid_has_mapping(user_ns, minkey->uid)) in find_ge_key()
252 static struct rb_node *__key_user_next(struct user_namespace *user_ns, struct rb_node *n) in __key_user_next() argument
256 if (kuid_has_mapping(user_ns, user->uid)) in __key_user_next()
263 static struct rb_node *key_user_next(struct user_namespace *user_ns, struct rb_node *n) in key_user_next() argument
265 return __key_user_next(user_ns, rb_next(n)); in key_user_next()
268 static struct rb_node *key_user_first(struct user_namespace *user_ns, struct rb_root *r) in key_user_first() argument
271 return __key_user_next(user_ns, in key_user_first()
[all...]
H A Dprocess_keys.c48 static struct key *get_user_register(struct user_namespace *user_ns) in get_user_register()
50 struct key *reg_keyring = READ_ONCE(user_ns->user_keyring_register); in get_user_register()
55 down_write(&user_ns->keyring_sem); in get_user_register()
60 reg_keyring = user_ns->user_keyring_register; in get_user_register()
63 user_ns->owner, INVALID_GID, in get_user_register()
70 smp_store_release(&user_ns->user_keyring_register,
74 up_write(&user_ns->keyring_sem); in look_up_user_keyrings()
76 /* We don't return a ref since the keyring is pinned by the user_ns */ in look_up_user_keyrings()
88 struct user_namespace *user_ns = current_user_ns(); in look_up_user_keyrings()
92 uid_t uid = from_kuid(user_ns, cre in look_up_user_keyrings()
38 get_user_register(struct user_namespace * user_ns) get_user_register() argument
78 struct user_namespace *user_ns = current_user_ns(); look_up_user_keyrings() local
[all...]
/linux/security/
H A Dcommoncap.c127 const struct user_namespace *cred_ns = cred->user_ns; in cap_capable()
155 * If we are in the same or an ancestor user_ns and have all the target
157 * If we have the ptrace capability to the target user_ns, then ptrace
177 if (cred->user_ns == child_cred->user_ns && in cap_ptrace_access_check()
180 if (ns_capable(child_cred->user_ns, CAP_SYS_PTRACE)) in cap_ptrace_access_check()
192 * If parent is in the same or an ancestor user_ns and has all current's
194 * If parent has the ptrace capability to current's user_ns, then ptrace
209 if (cred->user_ns == child_cred->user_ns in cap_ptrace_traceme()
1028 struct user_namespace *user_ns = dentry->d_sb->s_user_ns; cap_inode_setxattr() local
1069 struct user_namespace *user_ns = dentry->d_sb->s_user_ns; cap_inode_removexattr() local
[all...]
/linux/fs/proc/
H A Droot.c154 if (!ns_capable(target->user_ns, CAP_SYS_ADMIN)) { in proc_parse_pidns_param()
163 put_user_ns(fc->user_ns); in proc_parse_pidns_param()
164 fc->user_ns = get_user_ns(ctx->pid_ns->user_ns); in proc_parse_pidns_param()
228 struct user_namespace *user_ns) in proc_apply_options() argument
238 fs_info->pid_gid = make_kgid(user_ns, ctx->gid); in proc_apply_options()
350 put_user_ns(fc->user_ns); in proc_init_fs_context()
351 fc->user_ns = get_user_ns(ctx->pid_ns->user_ns); in proc_init_fs_context()
/linux/include/linux/
H A Dcgroup_namespace.h9 struct user_namespace *user_ns; member
26 struct user_namespace *user_ns,
47 copy_cgroup_ns(u64 flags, struct user_namespace *user_ns, in copy_cgroup_ns() argument
H A Duts_namespace.h13 struct user_namespace *user_ns; member
32 struct user_namespace *user_ns, struct uts_namespace *old_ns);
52 struct user_namespace *user_ns, struct uts_namespace *old_ns) in copy_utsname() argument
H A Dipc_namespace.h75 struct user_namespace *user_ns; member
138 struct user_namespace *user_ns, struct ipc_namespace *ns);
160 struct user_namespace *user_ns, struct ipc_namespace *ns) in copy_ipcs() argument
H A Dtsacct_kern.h14 extern void bacct_add_tsk(struct user_namespace *user_ns,
18 static inline void bacct_add_tsk(struct user_namespace *user_ns, in bacct_add_tsk() argument
/linux/net/
H A Dsysctl_net.c48 if (ns_capable_noaudit(net->user_ns, CAP_NET_ADMIN)) { in net_ctl_permissions()
63 ns_root_uid = make_kuid(net->user_ns, 0); in net_ctl_set_ownership()
67 ns_root_gid = make_kgid(net->user_ns, 0); in net_ctl_set_ownership()
/linux/fs/nfs/
H A Dnfs4idmap.c73 struct user_namespace *user_ns; member
78 if (idmap && idmap->user_ns) in idmap_userns()
79 return idmap->user_ns; in idmap_userns()
290 if (!idmap->user_ns || idmap->user_ns == &init_user_ns) in nfs_idmap_request_key()
453 idmap->user_ns = get_user_ns(clp->cl_rpcclient->cl_cred->user_ns); in nfs_idmap_new()
477 put_user_ns(idmap->user_ns); in nfs_idmap_new()
494 put_user_ns(idmap->user_ns); in nfs_idmap_delete()
/linux/net/core/
H A Dnet_namespace.c408 static __net_init void preinit_net(struct net *net, struct user_namespace *user_ns) in preinit_net()
416 net->user_ns = user_ns; in preinit_net()
558 struct user_namespace *user_ns, struct net *old_net) in copy_net_ns()
567 ucounts = inc_net_namespaces(user_ns); in copy_net_ns()
577 preinit_net(net, user_ns); in copy_net_ns()
579 get_user_ns(user_ns); in copy_net_ns()
600 put_user_ns(user_ns); in copy_net_ns()
621 kuid_t ns_root_uid = make_kuid(net->user_ns, 0); in net_ns_get_ownership()
622 kgid_t ns_root_gid = make_kgid(net->user_ns, in net_ns_get_ownership()
403 preinit_net(struct net * net,struct user_namespace * user_ns) preinit_net() argument
551 copy_net_ns(u64 flags,struct user_namespace * user_ns,struct net * old_net) copy_net_ns() argument
[all...]

1234567