/linux-6.6.21/kernel/ |
D | utsname.c | 45 static struct uts_namespace *clone_uts_ns(struct user_namespace *user_ns, in clone_uts_ns() argument 53 ucounts = inc_uts_namespaces(user_ns); in clone_uts_ns() 71 ns->user_ns = get_user_ns(user_ns); in clone_uts_ns() 90 struct user_namespace *user_ns, struct uts_namespace *old_ns) in copy_utsname() argument 100 new_ns = clone_uts_ns(user_ns, old_ns); in copy_utsname() 109 put_user_ns(ns->user_ns); in free_uts_ns() 145 if (!ns_capable(ns->user_ns, CAP_SYS_ADMIN) || in utsns_install() 146 !ns_capable(nsset->cred->user_ns, CAP_SYS_ADMIN)) in utsns_install() 157 return to_uts_ns(ns)->user_ns; in utsns_owner()
|
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() 154 struct user_namespace *user_ns = task_cred_xxx(tsk, user_ns); in copy_namespaces() local 165 } else if (!ns_capable(user_ns, CAP_SYS_ADMIN)) in copy_namespaces() [all …]
|
D | pid_namespace.c | 72 static struct pid_namespace *create_pid_namespace(struct user_namespace *user_ns, in create_pid_namespace() argument 81 if (!in_userns(parent_pid_ns->user_ns, user_ns)) in create_pid_namespace() 87 ucounts = inc_pid_namespaces(user_ns); in create_pid_namespace() 110 ns->user_ns = get_user_ns(user_ns); in create_pid_namespace() 132 put_user_ns(ns->user_ns); in delayed_free_pidns() 146 struct user_namespace *user_ns, struct pid_namespace *old_ns) in copy_pid_ns() argument 152 return create_pid_namespace(user_ns, old_ns); in copy_pid_ns() 286 if (write && !checkpoint_restore_ns_capable(pid_ns->user_ns)) in pid_ns_ctl_handler() 400 if (!ns_capable(new->user_ns, CAP_SYS_ADMIN) || in pidns_install() 401 !ns_capable(nsset->cred->user_ns, CAP_SYS_ADMIN)) in pidns_install() [all …]
|
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()
|
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()
|
D | cred.c | 60 .user_ns = &init_user_ns, 88 put_user_ns(cred->user_ns); in put_cred_rcu() 220 get_user_ns(new->user_ns); in prepare_creds() 351 const struct user_namespace *set_ns = set->user_ns; in cred_cap_issubset() 352 const struct user_namespace *subset_ns = subset->user_ns; in cred_cap_issubset() 432 if (new->user != old->user || new->user_ns != old->user_ns) in commit_creds() 436 if (new->user != old->user || new->user_ns != old->user_ns) in commit_creds() 588 if (old_ucounts->ns == new->user_ns && uid_eq(old_ucounts->uid, new->uid)) in set_cred_ucounts() 591 if (!(new_ucounts = alloc_ucounts(new->user_ns, new->uid))) in set_cred_ucounts() 646 get_user_ns(new->user_ns); in prepare_kernel_cred()
|
D | user_namespace.c | 43 static void set_cred_user_ns(struct cred *cred, struct user_namespace *user_ns) in set_cred_user_ns() argument 59 cred->user_ns = user_ns; in set_cred_user_ns() 84 struct user_namespace *ns, *parent_ns = new->user_ns; in create_user_ns() 883 const struct user_namespace *file_ns = file->f_cred->user_ns; in verify_root_map() 1322 struct user_namespace *user_ns; in userns_get() local 1325 user_ns = get_user_ns(__task_cred(task)->user_ns); in userns_get() 1328 return user_ns ? &user_ns->ns : NULL; in userns_get() 1338 struct user_namespace *user_ns = to_user_ns(ns); in userns_install() local 1344 if (user_ns == current_user_ns()) in userns_install() 1354 if (!ns_capable(user_ns, CAP_SYS_ADMIN)) in userns_install() [all …]
|
/linux-6.6.21/ipc/ |
D | namespace.c | 38 static struct ipc_namespace *create_ipc_ns(struct user_namespace *user_ns, in create_ipc_ns() argument 47 ucounts = inc_ipc_namespaces(user_ns); in create_ipc_ns() 70 ns->user_ns = get_user_ns(user_ns); in create_ipc_ns() 97 put_user_ns(ns->user_ns); in create_ipc_ns() 108 struct user_namespace *user_ns, struct ipc_namespace *ns) in copy_ipcs() argument 112 return create_ipc_ns(user_ns, ns); in copy_ipcs() 161 put_user_ns(ns->user_ns); in free_ipc_ns() 237 if (!ns_capable(ns->user_ns, CAP_SYS_ADMIN) || in ipcns_install() 238 !ns_capable(nsset->cred->user_ns, CAP_SYS_ADMIN)) in ipcns_install() 248 return to_ipc_ns(ns)->user_ns; in ipcns_owner()
|
/linux-6.6.21/kernel/cgroup/ |
D | namespace.c | 44 put_user_ns(ns->user_ns); in free_cgroup_ns() 51 struct user_namespace *user_ns, in copy_cgroup_ns() argument 66 if (!ns_capable(user_ns, CAP_SYS_ADMIN)) in copy_cgroup_ns() 69 ucounts = inc_cgroup_namespaces(user_ns); in copy_cgroup_ns() 86 new_ns->user_ns = get_user_ns(user_ns); in copy_cgroup_ns() 103 if (!ns_capable(nsset->cred->user_ns, CAP_SYS_ADMIN) || in cgroupns_install() 104 !ns_capable(cgroup_ns->user_ns, CAP_SYS_ADMIN)) in cgroupns_install() 141 return to_cg_ns(ns)->user_ns; in cgroupns_owner()
|
/linux-6.6.21/net/netfilter/ |
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-6.6.21/kernel/time/ |
D | namespace.c | 78 static struct time_namespace *clone_time_ns(struct user_namespace *user_ns, in clone_time_ns() argument 86 ucounts = inc_time_namespaces(user_ns); in clone_time_ns() 107 ns->user_ns = get_user_ns(user_ns); in clone_time_ns() 134 struct user_namespace *user_ns, struct time_namespace *old_ns) in copy_time_ns() argument 139 return clone_time_ns(user_ns, old_ns); in copy_time_ns() 250 put_user_ns(ns->user_ns); in free_time_ns() 312 if (!ns_capable(ns->user_ns, CAP_SYS_ADMIN) || in timens_install() 313 !ns_capable(nsset->cred->user_ns, CAP_SYS_ADMIN)) in timens_install() 344 return to_time_ns(ns)->user_ns; in timens_owner() 393 if (!file_ns_capable(file, time_ns->user_ns, CAP_SYS_TIME)) { in proc_timens_set_offset() [all …]
|
/linux-6.6.21/security/keys/ |
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()
|
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-6.6.21/net/bridge/ |
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-6.6.21/security/ |
D | commoncap.c | 77 if (ns == cred->user_ns) in cap_capable() 84 if (ns->level <= cred->user_ns->level) in cap_capable() 91 if ((ns->parent == cred->user_ns) && uid_eq(ns->owner, cred->euid)) in cap_capable() 147 if (cred->user_ns == child_cred->user_ns && in cap_ptrace_access_check() 150 if (ns_capable(child_cred->user_ns, CAP_SYS_PTRACE)) in cap_ptrace_access_check() 179 if (cred->user_ns == child_cred->user_ns && in cap_ptrace_traceme() 182 if (has_ns_capability(parent, child_cred->user_ns, CAP_SYS_PTRACE)) in cap_ptrace_traceme() 224 if (cap_capable(current_cred(), current_cred()->user_ns, in cap_inh_is_capped() 901 root_uid = make_kuid(new->user_ns, 0); in cap_bprm_creds_from_file() 918 !ptracer_capable(current, new->user_ns))) { in cap_bprm_creds_from_file() [all …]
|
/linux-6.6.21/include/linux/ |
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,
|
D | utsname.h | 26 struct user_namespace *user_ns; member 39 struct user_namespace *user_ns, struct uts_namespace *old_ns); 59 struct user_namespace *user_ns, struct uts_namespace *old_ns) in copy_utsname() argument
|
D | pid_namespace.h | 37 struct user_namespace *user_ns; member 76 struct user_namespace *user_ns, struct pid_namespace *ns); 95 struct user_namespace *user_ns, struct pid_namespace *ns) in copy_pid_ns() argument
|
D | ipc_namespace.h | 75 struct user_namespace *user_ns; member 133 struct user_namespace *user_ns, struct ipc_namespace *ns); 155 struct user_namespace *user_ns, struct ipc_namespace *ns) in copy_ipcs() argument
|
D | tsacct_kern.h | 14 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
|
D | time_namespace.h | 20 struct user_namespace *user_ns; member 43 struct user_namespace *user_ns, 129 struct user_namespace *user_ns, in copy_time_ns() argument
|
/linux-6.6.21/fs/sysfs/ |
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()
|
/linux-6.6.21/net/unix/ |
D | diag.c | 118 struct user_namespace *user_ns) in sk_diag_dump_uid() argument 120 uid_t uid = from_kuid_munged(user_ns, sock_i_uid(sk)); in sk_diag_dump_uid() 125 struct user_namespace *user_ns, in sk_diag_fill() argument 172 sk_diag_dump_uid(sk, skb, user_ns)) in sk_diag_fill() 184 struct user_namespace *user_ns, in sk_diag_dump() argument 196 return sk_diag_fill(sk, skb, req, user_ns, portid, seq, flags, sk_ino); in sk_diag_dump()
|
/linux-6.6.21/fs/proc/ |
D | root.c | 147 struct user_namespace *user_ns) in proc_apply_options() argument 152 fs_info->pid_gid = make_kgid(user_ns, ctx->gid); in proc_apply_options() 253 put_user_ns(fc->user_ns); in proc_init_fs_context() 254 fc->user_ns = get_user_ns(ctx->pid_ns->user_ns); in proc_init_fs_context()
|
/linux-6.6.21/net/ |
D | sysctl_net.c | 48 if (ns_capable_noaudit(net->user_ns, CAP_NET_ADMIN)) { in net_ctl_permissions() 64 ns_root_uid = make_kuid(net->user_ns, 0); in net_ctl_set_ownership() 68 ns_root_gid = make_kgid(net->user_ns, 0); in net_ctl_set_ownership()
|