/linux/fs/ksmbd/ |
A D | vfs.h | 74 int ksmbd_vfs_query_maximal_access(struct user_namespace *user_ns, 102 ssize_t ksmbd_vfs_getxattr(struct user_namespace *user_ns, 106 ssize_t ksmbd_vfs_casexattr_len(struct user_namespace *user_ns, 109 int ksmbd_vfs_setxattr(struct user_namespace *user_ns, 114 int ksmbd_vfs_remove_xattr(struct user_namespace *user_ns, 131 int ksmbd_vfs_unlink(struct user_namespace *user_ns, 135 struct user_namespace *user_ns, 141 int ksmbd_vfs_remove_acl_xattrs(struct user_namespace *user_ns, 143 int ksmbd_vfs_remove_sd_xattrs(struct user_namespace *user_ns, 146 struct user_namespace *user_ns, [all …]
|
A D | vfs.c | 203 struct user_namespace *user_ns; in ksmbd_vfs_mkdir() local 219 user_ns = mnt_user_ns(path.mnt); in ksmbd_vfs_mkdir() 454 err = ksmbd_vfs_setxattr(user_ns, in ksmbd_vfs_stream_write() 591 struct user_namespace *user_ns; in ksmbd_vfs_remove_file() local 606 user_ns = mnt_user_ns(path.mnt); in ksmbd_vfs_remove_file() 780 struct user_namespace *user_ns; in ksmbd_vfs_fp_rename() local 824 user_ns, in ksmbd_vfs_fp_rename() 973 err = vfs_setxattr(user_ns, in ksmbd_vfs_setxattr() 1423 struct user_namespace *user_ns, in ksmbd_vfs_set_sd_xattr() argument 1497 struct user_namespace *user_ns, in ksmbd_vfs_get_sd_xattr() argument [all …]
|
A D | smbacl.c | 284 uid = kuid_from_mnt(user_ns, uid); in sid_to_id() 301 gid = kgid_from_mnt(user_ns, gid); in sid_to_id() 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() 884 parse_dacl(user_ns, dacl_ptr, end_of_acl, in parse_sec_desc() 953 set_mode_dacl(user_ns, dacl_ptr, fattr); in build_sec_desc() 1137 ksmbd_vfs_set_sd_xattr(conn, user_ns, in smb_inherit_dacl() 1353 rc = set_posix_acl(user_ns, inode, in set_info_sec() 1360 rc = set_posix_acl(user_ns, inode, in set_info_sec() [all …]
|
/linux/kernel/ |
A D | nsproxy.c | 68 struct task_struct *tsk, struct user_namespace *user_ns, in create_new_namespaces() argument 103 new_nsp->cgroup_ns = copy_cgroup_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() 214 struct user_namespace *user_ns; in unshare_nsproxy_namespaces() local 222 user_ns = new_cred ? new_cred->user_ns : current_user_ns(); in unshare_nsproxy_namespaces() 223 if (!ns_capable(user_ns, CAP_SYS_ADMIN)) in unshare_nsproxy_namespaces() 360 struct user_namespace *user_ns = NULL; in validate_nsset() local 402 user_ns = get_user_ns(__task_cred(tsk)->user_ns); in validate_nsset() 414 ret = validate_ns(nsset, &user_ns->ns); in validate_nsset() [all …]
|
A 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()
|
A 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 …]
|
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()
|
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() 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()
|
A 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->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 …]
|
A D | user_namespace.c | 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() 1344 put_user_ns(cred->user_ns); in userns_install() [all …]
|
/linux/ipc/ |
A 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/kernel/cgroup/ |
A 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/net/netfilter/ |
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() 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/kernel/time/ |
A 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/net/bridge/ |
A D | br_ioctl.c | 90 if (!ns_capable(net->user_ns, CAP_NET_ADMIN)) in add_del_if() 199 if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN)) in br_dev_siocdevprivate() 206 if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN)) in br_dev_siocdevprivate() 213 if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN)) in br_dev_siocdevprivate() 220 if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN)) in br_dev_siocdevprivate() 260 if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN)) in br_dev_siocdevprivate() 267 if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN)) in br_dev_siocdevprivate() 276 if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN)) in br_dev_siocdevprivate() 290 if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN)) in br_dev_siocdevprivate() 353 if (!ns_capable(net->user_ns, CAP_NET_ADMIN)) in old_deviceless() [all …]
|
/linux/security/keys/ |
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()
|
A D | process_keys.c | 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() 64 up_write(&user_ns->keyring_sem); in get_user_register() 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() 94 down_write(&user_ns->keyring_sem); in look_up_user_keyrings() 158 up_write(&user_ns->keyring_sem); in look_up_user_keyrings() 176 up_write(&user_ns->keyring_sem); in look_up_user_keyrings() 205 from_kuid(cred->user_ns, in get_user_session_keyring_rcu() [all …]
|
/linux/security/ |
A D | commoncap.c | 76 if (ns == cred->user_ns) in cap_capable() 83 if (ns->level <= cred->user_ns->level) in cap_capable() 146 if (cred->user_ns == child_cred->user_ns && in cap_ptrace_access_check() 178 if (cred->user_ns == child_cred->user_ns && in cap_ptrace_traceme() 904 root_uid = make_kuid(new->user_ns, 0); in cap_bprm_creds_from_file() 923 if (!ns_capable(new->user_ns, CAP_SETUID) || in cap_bprm_creds_from_file() 1009 if (!ns_capable(user_ns, CAP_SYS_ADMIN)) in cap_inode_setxattr() 1053 if (!ns_capable(user_ns, CAP_SYS_ADMIN)) in cap_inode_removexattr() 1089 kuid_t root_uid = make_kuid(old->user_ns, 0); in cap_emulate_setxuid() 1146 kuid_t root_uid = make_kuid(old->user_ns, 0); in cap_task_fix_setuid() [all …]
|
/linux/fs/ |
A D | posix_acl.c | 240 if (!kuid_has_mapping(user_ns, pa->e_uid)) in posix_acl_valid() 255 if (!kgid_has_mapping(user_ns, pa->e_gid)) in posix_acl_valid() 759 struct user_namespace *user_ns = current_user_ns(); in posix_acl_fix_xattr_from_user() local 760 if ((user_ns == &init_user_ns) && (mnt_userns == &init_user_ns)) in posix_acl_fix_xattr_from_user() 769 struct user_namespace *user_ns = current_user_ns(); in posix_acl_fix_xattr_to_user() local 770 if ((user_ns == &init_user_ns) && (mnt_userns == &init_user_ns)) in posix_acl_fix_xattr_to_user() 780 posix_acl_from_xattr(struct user_namespace *user_ns, in posix_acl_from_xattr() argument 820 make_kuid(user_ns, in posix_acl_from_xattr() 827 make_kgid(user_ns, in posix_acl_from_xattr() 872 cpu_to_le32(from_kuid(user_ns, acl_e->e_uid)); in posix_acl_to_xattr() [all …]
|
/linux/include/linux/ |
A 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
|
A 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
|
A D | ipc_namespace.h | 67 struct user_namespace *user_ns; member 125 struct user_namespace *user_ns, struct ipc_namespace *ns); 147 struct user_namespace *user_ns, struct ipc_namespace *ns) in copy_ipcs() argument
|
/linux/fs/sysfs/ |
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()
|
/linux/fs/proc/ |
A D | root.c | 150 struct user_namespace *user_ns) in proc_apply_options() argument 155 fs_info->pid_gid = make_kgid(user_ns, ctx->gid); in proc_apply_options() 256 put_user_ns(fc->user_ns); in proc_init_fs_context() 257 fc->user_ns = get_user_ns(ctx->pid_ns->user_ns); in proc_init_fs_context()
|
A D | array.c | 145 struct user_namespace *user_ns = seq_user_ns(m); in task_state() local 183 seq_put_decimal_ull(m, "\nUid:\t", from_kuid_munged(user_ns, cred->uid)); in task_state() 184 seq_put_decimal_ull(m, "\t", from_kuid_munged(user_ns, cred->euid)); in task_state() 185 seq_put_decimal_ull(m, "\t", from_kuid_munged(user_ns, cred->suid)); in task_state() 186 seq_put_decimal_ull(m, "\t", from_kuid_munged(user_ns, cred->fsuid)); in task_state() 187 seq_put_decimal_ull(m, "\nGid:\t", from_kgid_munged(user_ns, cred->gid)); in task_state() 188 seq_put_decimal_ull(m, "\t", from_kgid_munged(user_ns, cred->egid)); in task_state() 189 seq_put_decimal_ull(m, "\t", from_kgid_munged(user_ns, cred->sgid)); in task_state() 190 seq_put_decimal_ull(m, "\t", from_kgid_munged(user_ns, cred->fsgid)); in task_state() 197 from_kgid_munged(user_ns, group_info->gid[g])); in task_state()
|