/Linux-v5.15/fs/ksmbd/ |
D | vfs.h | 110 int ksmbd_vfs_lock_parent(struct user_namespace *user_ns, struct dentry *parent, 112 int ksmbd_vfs_may_delete(struct user_namespace *user_ns, struct dentry *dentry); 113 int ksmbd_vfs_query_maximal_access(struct user_namespace *user_ns, 141 ssize_t ksmbd_vfs_getxattr(struct user_namespace *user_ns, 145 ssize_t ksmbd_vfs_casexattr_len(struct user_namespace *user_ns, 148 int ksmbd_vfs_setxattr(struct user_namespace *user_ns, 153 int ksmbd_vfs_remove_xattr(struct user_namespace *user_ns, 170 int ksmbd_vfs_unlink(struct user_namespace *user_ns, 174 struct user_namespace *user_ns, 180 int ksmbd_vfs_remove_acl_xattrs(struct user_namespace *user_ns, [all …]
|
D | vfs.c | 73 int ksmbd_vfs_lock_parent(struct user_namespace *user_ns, struct dentry *parent, in ksmbd_vfs_lock_parent() argument 80 dentry = lookup_one(user_ns, child->d_name.name, parent, in ksmbd_vfs_lock_parent() 100 int ksmbd_vfs_may_delete(struct user_namespace *user_ns, in ksmbd_vfs_may_delete() argument 107 ret = ksmbd_vfs_lock_parent(user_ns, parent, dentry); in ksmbd_vfs_may_delete() 113 ret = inode_permission(user_ns, d_inode(parent), in ksmbd_vfs_may_delete() 121 int ksmbd_vfs_query_maximal_access(struct user_namespace *user_ns, in ksmbd_vfs_query_maximal_access() argument 129 if (!inode_permission(user_ns, d_inode(dentry), MAY_OPEN | MAY_WRITE)) in ksmbd_vfs_query_maximal_access() 135 if (!inode_permission(user_ns, d_inode(dentry), MAY_OPEN | MAY_READ)) in ksmbd_vfs_query_maximal_access() 138 if (!inode_permission(user_ns, d_inode(dentry), MAY_OPEN | MAY_EXEC)) in ksmbd_vfs_query_maximal_access() 142 ret = ksmbd_vfs_lock_parent(user_ns, parent, dentry); in ksmbd_vfs_query_maximal_access() [all …]
|
D | smbacl.c | 256 static int sid_to_id(struct user_namespace *user_ns, in sid_to_id() argument 284 uid = kuid_from_mnt(user_ns, uid); in sid_to_id() 301 gid = kgid_from_mnt(user_ns, gid); in sid_to_id() 376 static void parse_dacl(struct user_namespace *user_ns, in parse_dacl() argument 503 ret = sid_to_id(user_ns, &ppace[i]->sid, SIDOWNER, &temp_fattr); in parse_dacl() 589 static void set_posix_acl_entries_dacl(struct user_namespace *user_ns, in set_posix_acl_entries_dacl() argument 614 uid = posix_acl_uid_translate(user_ns, pace); in set_posix_acl_entries_dacl() 621 gid = posix_acl_gid_translate(user_ns, pace); in set_posix_acl_entries_dacl() 680 uid = posix_acl_uid_translate(user_ns, pace); in set_posix_acl_entries_dacl() 685 gid = posix_acl_gid_translate(user_ns, pace); in set_posix_acl_entries_dacl() [all …]
|
/Linux-v5.15/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 164 } else if (!ns_capable(user_ns, CAP_SYS_ADMIN)) in copy_namespaces() [all …]
|
D | pid_namespace.c | 71 static struct pid_namespace *create_pid_namespace(struct user_namespace *user_ns, in create_pid_namespace() argument 80 if (!in_userns(parent_pid_ns->user_ns, user_ns)) in create_pid_namespace() 86 ucounts = inc_pid_namespaces(user_ns); in create_pid_namespace() 109 ns->user_ns = get_user_ns(user_ns); in create_pid_namespace() 129 put_user_ns(ns->user_ns); in delayed_free_pidns() 143 struct user_namespace *user_ns, struct pid_namespace *old_ns) in copy_pid_ns() argument 149 return create_pid_namespace(user_ns, old_ns); in copy_pid_ns() 266 if (write && !checkpoint_restore_ns_capable(pid_ns->user_ns)) in pid_ns_ctl_handler() 381 if (!ns_capable(new->user_ns, CAP_SYS_ADMIN) || in pidns_install() 382 !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() 174 struct user_namespace *user_ns = current_user_ns(); in may_setgroups() local 176 return ns_capable_setid(user_ns, CAP_SETGID) && in may_setgroups() 177 userns_may_setgroups(user_ns); in may_setgroups()
|
D | cred.c | 61 .user_ns = &init_user_ns, 125 put_user_ns(cred->user_ns); in put_cred_rcu() 274 get_user_ns(new->user_ns); in prepare_creds() 410 const struct user_namespace *set_ns = set->user_ns; in cred_cap_issubset() 411 const struct user_namespace *subset_ns = subset->user_ns; in cred_cap_issubset() 498 if (new->user != old->user || new->user_ns != old->user_ns) in commit_creds() 502 if (new->user != old->user || new->user_ns != old->user_ns) in commit_creds() 672 if (new->user == old->user && new->user_ns == old->user_ns) in set_cred_ucounts() 679 if (old_ucounts && old_ucounts->ns == new->user_ns && uid_eq(old_ucounts->uid, new->euid)) in set_cred_ucounts() 682 if (!(new_ucounts = alloc_ucounts(new->user_ns, new->euid))) in set_cred_ucounts() [all …]
|
D | user_namespace.c | 42 static void set_cred_user_ns(struct cred *cred, struct user_namespace *user_ns) in set_cred_user_ns() argument 58 cred->user_ns = user_ns; in set_cred_user_ns() 71 struct user_namespace *ns, *parent_ns = new->user_ns; in create_user_ns() 866 const struct user_namespace *file_ns = file->f_cred->user_ns; in verify_root_map() 1305 struct user_namespace *user_ns; in userns_get() local 1308 user_ns = get_user_ns(__task_cred(task)->user_ns); in userns_get() 1311 return user_ns ? &user_ns->ns : NULL; in userns_get() 1321 struct user_namespace *user_ns = to_user_ns(ns); in userns_install() local 1327 if (user_ns == current_user_ns()) in userns_install() 1337 if (!ns_capable(user_ns, CAP_SYS_ADMIN)) in userns_install() [all …]
|
/Linux-v5.15/ipc/ |
D | namespace.c | 32 static struct ipc_namespace *create_ipc_ns(struct user_namespace *user_ns, in create_ipc_ns() argument 40 ucounts = inc_ipc_namespaces(user_ns); in create_ipc_ns() 55 ns->user_ns = get_user_ns(user_ns); in create_ipc_ns() 69 put_user_ns(ns->user_ns); in create_ipc_ns() 80 struct user_namespace *user_ns, struct ipc_namespace *ns) in copy_ipcs() argument 84 return create_ipc_ns(user_ns, ns); in copy_ipcs() 129 put_user_ns(ns->user_ns); in free_ipc_ns() 204 if (!ns_capable(ns->user_ns, CAP_SYS_ADMIN) || in ipcns_install() 205 !ns_capable(nsset->cred->user_ns, CAP_SYS_ADMIN)) in ipcns_install() 215 return to_ipc_ns(ns)->user_ns; in ipcns_owner()
|
/Linux-v5.15/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-v5.15/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() 85 kuid_t uid_min = make_kuid(net->user_ns, info->uid_min); in owner_mt() 86 kuid_t uid_max = make_kuid(net->user_ns, info->uid_max); in owner_mt() 95 kgid_t gid_min = make_kgid(net->user_ns, info->gid_min); in owner_mt() 96 kgid_t gid_max = make_kgid(net->user_ns, info->gid_max); in owner_mt()
|
/Linux-v5.15/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() 232 put_user_ns(ns->user_ns); in free_time_ns() 294 if (!ns_capable(ns->user_ns, CAP_SYS_ADMIN) || in timens_install() 295 !ns_capable(nsset->cred->user_ns, CAP_SYS_ADMIN)) in timens_install() 326 return to_time_ns(ns)->user_ns; in timens_owner() 375 if (!file_ns_capable(file, time_ns->user_ns, CAP_SYS_TIME)) { in proc_timens_set_offset() [all …]
|
/Linux-v5.15/net/bridge/ |
D | br_ioctl.c | 89 if (!ns_capable(net->user_ns, CAP_NET_ADMIN)) in add_del_if() 198 if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN)) in br_dev_siocdevprivate() 205 if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN)) in br_dev_siocdevprivate() 212 if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN)) in br_dev_siocdevprivate() 219 if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN)) in br_dev_siocdevprivate() 259 if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN)) in br_dev_siocdevprivate() 266 if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN)) in br_dev_siocdevprivate() 275 if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN)) in br_dev_siocdevprivate() 289 if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN)) in br_dev_siocdevprivate() 351 if (!ns_capable(net->user_ns, CAP_NET_ADMIN)) in old_deviceless() [all …]
|
/Linux-v5.15/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-v5.15/security/ |
D | commoncap.c | 76 if (ns == cred->user_ns) in cap_capable() 83 if (ns->level <= cred->user_ns->level) in cap_capable() 90 if ((ns->parent == cred->user_ns) && uid_eq(ns->owner, cred->euid)) in cap_capable() 146 if (cred->user_ns == child_cred->user_ns && in cap_ptrace_access_check() 149 if (ns_capable(child_cred->user_ns, CAP_SYS_PTRACE)) in cap_ptrace_access_check() 178 if (cred->user_ns == child_cred->user_ns && in cap_ptrace_traceme() 181 if (has_ns_capability(parent, child_cred->user_ns, CAP_SYS_PTRACE)) in cap_ptrace_traceme() 223 if (cap_capable(current_cred(), current_cred()->user_ns, in cap_inh_is_capped() 904 root_uid = make_kuid(new->user_ns, 0); in cap_bprm_creds_from_file() 921 !ptracer_capable(current, new->user_ns))) { in cap_bprm_creds_from_file() [all …]
|
/Linux-v5.15/fs/ |
D | posix_acl.c | 221 posix_acl_valid(struct user_namespace *user_ns, const struct posix_acl *acl) in posix_acl_valid() argument 241 if (!kuid_has_mapping(user_ns, pa->e_uid)) in posix_acl_valid() 256 if (!kgid_has_mapping(user_ns, pa->e_gid)) in posix_acl_valid() 760 struct user_namespace *user_ns = current_user_ns(); in posix_acl_fix_xattr_from_user() local 761 if ((user_ns == &init_user_ns) && (mnt_userns == &init_user_ns)) in posix_acl_fix_xattr_from_user() 763 posix_acl_fix_xattr_userns(&init_user_ns, user_ns, mnt_userns, value, in posix_acl_fix_xattr_from_user() 770 struct user_namespace *user_ns = current_user_ns(); in posix_acl_fix_xattr_to_user() local 771 if ((user_ns == &init_user_ns) && (mnt_userns == &init_user_ns)) in posix_acl_fix_xattr_to_user() 773 posix_acl_fix_xattr_userns(user_ns, &init_user_ns, mnt_userns, value, in posix_acl_fix_xattr_to_user() 781 posix_acl_from_xattr(struct user_namespace *user_ns, in posix_acl_from_xattr() argument [all …]
|
/Linux-v5.15/include/linux/ |
D | utsname.h | 25 struct user_namespace *user_ns; member 38 struct user_namespace *user_ns, struct uts_namespace *old_ns); 58 struct user_namespace *user_ns, struct uts_namespace *old_ns) in copy_utsname() argument
|
D | pid_namespace.h | 30 struct user_namespace *user_ns; member 49 struct user_namespace *user_ns, struct pid_namespace *ns); 63 struct user_namespace *user_ns, struct pid_namespace *ns) in copy_pid_ns() argument
|
D | ipc_namespace.h | 67 struct user_namespace *user_ns; member 125 struct user_namespace *user_ns, struct ipc_namespace *ns); 137 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
|
/Linux-v5.15/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-v5.15/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()
|