| /linux/kernel/ |
| H A D | utsname.c | 36 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 90 new_ns = clone_uts_ns(user_ns, old_ns); in copy_utsname() 100 put_user_ns(ns->user_ns); in free_uts_ns() 132 if (!ns_capable(ns->user_ns, CAP_SYS_ADMIN) || in utsns_install() 133 !ns_capable(nsset->cred->user_ns, CAP_SYS_ADMIN)) in utsns_install() 144 return to_uts_ns(ns)->user_ns; in utsns_owner()
|
| H A D | nsproxy.c | 68 struct task_struct *tsk, struct user_namespace *user_ns, in create_new_namespaces() argument 78 new_nsp->mnt_ns = copy_mnt_ns(flags, tsk->nsproxy->mnt_ns, user_ns, new_fs); in create_new_namespaces() 84 new_nsp->uts_ns = copy_utsname(flags, user_ns, tsk->nsproxy->uts_ns); in create_new_namespaces() 90 new_nsp->ipc_ns = copy_ipcs(flags, user_ns, tsk->nsproxy->ipc_ns); in create_new_namespaces() 97 copy_pid_ns(flags, user_ns, tsk->nsproxy->pid_ns_for_children); in create_new_namespaces() 103 new_nsp->cgroup_ns = copy_cgroup_ns(flags, user_ns, in create_new_namespaces() 110 new_nsp->net_ns = copy_net_ns(flags, user_ns, tsk->nsproxy->net_ns); in create_new_namespaces() 116 new_nsp->time_ns_for_children = copy_time_ns(flags, user_ns, in create_new_namespaces() 150 struct user_namespace *user_ns = task_cred_xxx(tsk, user_ns); in copy_namespaces() local 161 } else if (!ns_capable(user_ns, CAP_SYS_ADMIN)) in copy_namespaces() [all …]
|
| H A D | uid16.c | 70 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 D | pid_namespace.c | 76 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() 293 if (write && !checkpoint_restore_ns_capable(pid_ns->user_ns)) in pid_ns_ctl_handler() 407 if (!ns_capable(new->user_ns, CAP_SYS_ADMIN) || in pidns_install() 408 !ns_capable(nsset->cred->user_ns, CAP_SYS_ADMIN)) in pidns_install() [all …]
|
| H A D | groups.c | 40 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 D | cred.c | 60 .user_ns = &init_user_ns, 88 put_user_ns(cred->user_ns); in put_cred_rcu() 225 get_user_ns(new->user_ns); in prepare_creds() 355 const struct user_namespace *set_ns = set->user_ns; in cred_cap_issubset() 356 const struct user_namespace *subset_ns = subset->user_ns; in cred_cap_issubset() 436 if (new->user != old->user || new->user_ns != old->user_ns) in commit_creds() 440 if (new->user != old->user || new->user_ns != old->user_ns) in commit_creds() 541 if (old_ucounts->ns == new->user_ns && uid_eq(old_ucounts->uid, new->uid)) in set_cred_ucounts() 544 if (!(new_ucounts = alloc_ucounts(new->user_ns, new->uid))) in set_cred_ucounts() 599 get_user_ns(new->user_ns); in prepare_kernel_cred()
|
| H A D | user_namespace.c | 44 static void set_cred_user_ns(struct cred *cred, struct user_namespace *user_ns) in set_cred_user_ns() argument 60 cred->user_ns = user_ns; in set_cred_user_ns() 85 struct user_namespace *ns, *parent_ns = new->user_ns; in create_user_ns() 896 const struct user_namespace *file_ns = file->f_cred->user_ns; in verify_root_map() 1330 struct user_namespace *user_ns; in userns_get() local 1333 user_ns = get_user_ns(__task_cred(task)->user_ns); in userns_get() 1336 return user_ns ? &user_ns->ns : NULL; in userns_get() 1346 struct user_namespace *user_ns = to_user_ns(ns); in userns_install() local 1352 if (user_ns == current_user_ns()) in userns_install() 1362 if (!ns_capable(user_ns, CAP_SYS_ADMIN)) in userns_install() [all …]
|
| /linux/kernel/cgroup/ |
| H A D | namespace.c | 42 put_user_ns(ns->user_ns); in free_cgroup_ns() 50 struct user_namespace *user_ns, in copy_cgroup_ns() argument 65 if (!ns_capable(user_ns, CAP_SYS_ADMIN)) in copy_cgroup_ns() 68 ucounts = inc_cgroup_namespaces(user_ns); in copy_cgroup_ns() 85 new_ns->user_ns = get_user_ns(user_ns); in copy_cgroup_ns() 97 if (!ns_capable(nsset->cred->user_ns, CAP_SYS_ADMIN) || in cgroupns_install() 98 !ns_capable(cgroup_ns->user_ns, CAP_SYS_ADMIN)) in cgroupns_install() 135 return to_cg_ns(ns)->user_ns; in cgroupns_owner()
|
| /linux/ipc/ |
| H A D | namespace.c | 39 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() 99 put_user_ns(ns->user_ns); in create_ipc_ns() 110 struct user_namespace *user_ns, struct ipc_namespace *ns) in copy_ipcs() argument 114 return create_ipc_ns(user_ns, ns); in copy_ipcs() 163 put_user_ns(ns->user_ns); in free_ipc_ns() 235 if (!ns_capable(ns->user_ns, CAP_SYS_ADMIN) || in ipcns_install() 236 !ns_capable(nsset->cred->user_ns, CAP_SYS_ADMIN)) in ipcns_install() 246 return to_ipc_ns(ns)->user_ns; in ipcns_owner()
|
| /linux/net/netfilter/ |
| H A D | xt_owner.c | 32 (current_user_ns() != net->user_ns)) in owner_check() 37 kuid_t uid_min = make_kuid(net->user_ns, info->uid_min); in owner_check() 38 kuid_t uid_max = make_kuid(net->user_ns, info->uid_max); in owner_check() 49 kgid_t gid_min = make_kgid(net->user_ns, info->gid_min); in owner_check() 50 kgid_t gid_max = make_kgid(net->user_ns, info->gid_max); in owner_check() 88 kuid_t uid_min = make_kuid(net->user_ns, info->uid_min); in owner_mt() 89 kuid_t uid_max = make_kuid(net->user_ns, info->uid_max); in owner_mt() 100 kgid_t gid_min = make_kgid(net->user_ns, info->gid_min); in owner_mt() 101 kgid_t gid_max = make_kgid(net->user_ns, info->gid_max); in owner_mt()
|
| /linux/kernel/time/ |
| H A D | namespace.c | 79 static struct time_namespace *clone_time_ns(struct user_namespace *user_ns, in clone_time_ns() argument 87 ucounts = inc_time_namespaces(user_ns); in clone_time_ns() 105 ns->user_ns = get_user_ns(user_ns); in clone_time_ns() 133 struct user_namespace *user_ns, struct time_namespace *old_ns) in copy_time_ns() argument 138 return clone_time_ns(user_ns, old_ns); in copy_time_ns() 257 put_user_ns(ns->user_ns); in free_time_ns() 315 if (!ns_capable(ns->user_ns, CAP_SYS_ADMIN) || in timens_install() 316 !ns_capable(nsset->cred->user_ns, CAP_SYS_ADMIN)) in timens_install() 347 return to_time_ns(ns)->user_ns; in timens_owner() 396 if (!file_ns_capable(file, time_ns->user_ns, CAP_SYS_TIME)) { in proc_timens_set_offset() [all …]
|
| /linux/net/bridge/ |
| H A D | br_ioctl.c | 91 if (!ns_capable(net->user_ns, CAP_NET_ADMIN)) in add_del_if() 219 if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN)) in br_dev_siocdevprivate() 226 if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN)) in br_dev_siocdevprivate() 233 if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN)) in br_dev_siocdevprivate() 240 if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN)) in br_dev_siocdevprivate() 280 if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN)) in br_dev_siocdevprivate() 287 if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN)) in br_dev_siocdevprivate() 296 if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN)) in br_dev_siocdevprivate() 310 if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN)) in br_dev_siocdevprivate() 379 if (!ns_capable(net->user_ns, CAP_NET_ADMIN)) in old_deviceless() [all …]
|
| /linux/security/keys/ |
| H A D | proc.c | 66 struct user_namespace *user_ns = seq_user_ns(p); in key_serial_next() local 71 if (kuid_has_mapping(user_ns, key->user->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->user->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, n); in key_user_first()
|
| H A D | process_keys.c | 38 static struct key *get_user_register(struct user_namespace *user_ns) in get_user_register() argument 40 struct key *reg_keyring = READ_ONCE(user_ns->user_keyring_register); in get_user_register() 45 down_write(&user_ns->keyring_sem); in get_user_register() 50 reg_keyring = user_ns->user_keyring_register; in get_user_register() 53 user_ns->owner, INVALID_GID, in get_user_register() 60 smp_store_release(&user_ns->user_keyring_register, in get_user_register() 64 up_write(&user_ns->keyring_sem); in get_user_register() 78 struct user_namespace *user_ns = current_user_ns(); in look_up_user_keyrings() local 82 uid_t uid = from_kuid(user_ns, cred->user->uid); in look_up_user_keyrings() 90 reg_keyring = get_user_register(user_ns); in look_up_user_keyrings() [all …]
|
| /linux/fs/proc/ |
| H A D | root.c | 154 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 233 fs_info->pid_gid = make_kgid(user_ns, ctx->gid); in proc_apply_options() 339 put_user_ns(fc->user_ns); in proc_init_fs_context() 340 fc->user_ns = get_user_ns(ctx->pid_ns->user_ns); in proc_init_fs_context()
|
| /linux/security/ |
| H A D | commoncap.c | 127 const struct user_namespace *cred_ns = cred->user_ns; in cap_capable() 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() 209 if (cred->user_ns == child_cred->user_ns && in cap_ptrace_traceme() 212 if (has_ns_capability(parent, child_cred->user_ns, CAP_SYS_PTRACE)) in cap_ptrace_traceme() 254 if (cap_capable(current_cred(), current_cred()->user_ns, in cap_inh_is_capped() 925 root_uid = make_kuid(new->user_ns, 0); in cap_bprm_creds_from_file() 942 !ptracer_capable(current, new->user_ns))) { in cap_bprm_creds_from_file() 944 if (!ns_capable(new->user_ns, CAP_SETUID) || in cap_bprm_creds_from_file() 1018 struct user_namespace *user_ns = dentry->d_sb->s_user_ns; in cap_inode_setxattr() local [all …]
|
| /linux/include/linux/ |
| H A D | posix_acl_xattr.h | 36 struct posix_acl *posix_acl_from_xattr(struct user_namespace *user_ns, 40 posix_acl_from_xattr(struct user_namespace *user_ns, const void *value, in posix_acl_from_xattr() argument 47 int posix_acl_to_xattr(struct user_namespace *user_ns,
|
| H A D | cgroup_namespace.h | 9 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 D | uts_namespace.h | 13 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 D | pid_namespace.h | 38 struct user_namespace *user_ns; member 87 struct user_namespace *user_ns, struct pid_namespace *ns); 109 struct user_namespace *user_ns, struct pid_namespace *ns) in copy_pid_ns() argument
|
| H A D | ipc_namespace.h | 75 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
|
| /linux/fs/ |
| H A D | binfmt_misc.c | 183 const struct user_namespace *user_ns; in load_binfmt_misc() local 186 user_ns = current_user_ns(); in load_binfmt_misc() 187 while (user_ns) { in load_binfmt_misc() 189 misc = smp_load_acquire(&user_ns->binfmt_misc); in load_binfmt_misc() 193 user_ns = user_ns->parent; in load_binfmt_misc() 920 struct user_namespace *user_ns = sb->s_fs_info; in bm_put_super() local 923 put_user_ns(user_ns); in bm_put_super() 935 struct user_namespace *user_ns = sb->s_user_ns; in bm_fill_super() local 943 if (WARN_ON(user_ns != current_user_ns())) in bm_fill_super() 961 misc = user_ns->binfmt_misc; in bm_fill_super() [all …]
|
| H A D | nsfs.c | 200 struct user_namespace *user_ns; in ns_ioctl() local 226 user_ns = container_of(ns, struct user_namespace, ns); in ns_ioctl() 228 uid = from_kuid_munged(current_user_ns(), user_ns->owner); in ns_ioctl() 505 owning_ns = to_cg_ns(ns)->user_ns; in nsfs_fh_to_dentry() 511 owning_ns = to_ipc_ns(ns)->user_ns; in nsfs_fh_to_dentry() 516 owning_ns = to_mnt_ns(ns)->user_ns; in nsfs_fh_to_dentry() 521 owning_ns = to_net_ns(ns)->user_ns; in nsfs_fh_to_dentry() 527 owning_ns = to_pid_ns(ns)->user_ns; in nsfs_fh_to_dentry() 537 owning_ns = to_time_ns(ns)->user_ns; in nsfs_fh_to_dentry() 549 owning_ns = to_uts_ns(ns)->user_ns; in nsfs_fh_to_dentry()
|
| H A D | pidfs.c | 304 struct user_namespace *user_ns; in pidfd_info() local 370 user_ns = current_user_ns(); in pidfd_info() 371 kinfo.ruid = from_kuid_munged(user_ns, c->uid); in pidfd_info() 372 kinfo.rgid = from_kgid_munged(user_ns, c->gid); in pidfd_info() 373 kinfo.euid = from_kuid_munged(user_ns, c->euid); in pidfd_info() 374 kinfo.egid = from_kgid_munged(user_ns, c->egid); in pidfd_info() 375 kinfo.suid = from_kuid_munged(user_ns, c->suid); in pidfd_info() 376 kinfo.sgid = from_kgid_munged(user_ns, c->sgid); in pidfd_info() 377 kinfo.fsuid = from_kuid_munged(user_ns, c->fsuid); in pidfd_info() 378 kinfo.fsgid = from_kgid_munged(user_ns, c->fsgid); in pidfd_info() [all …]
|
| /linux/fs/sysfs/ |
| H A D | mount.c | 75 put_user_ns(fc->user_ns); in sysfs_init_fs_context() 76 fc->user_ns = get_user_ns(netns->user_ns); in sysfs_init_fs_context()
|