| /linux/fs/ |
| A D | mnt_idmapping.c | 85 if (idmap == &nop_mnt_idmap) in make_vfsuid() 283 kfree(idmap); in free_mnt_idmap() 288 struct mnt_idmap *idmap; in alloc_mnt_idmap() local 292 if (!idmap) in alloc_mnt_idmap() 300 free_mnt_idmap(idmap); in alloc_mnt_idmap() 301 idmap = ERR_PTR(ret); in alloc_mnt_idmap() 303 return idmap; in alloc_mnt_idmap() 316 if (idmap != &nop_mnt_idmap && idmap != &invalid_mnt_idmap) in mnt_idmap_get() 319 return idmap; in mnt_idmap_get() 332 if (idmap != &nop_mnt_idmap && idmap != &invalid_mnt_idmap && in mnt_idmap_put() [all …]
|
| A D | attr.c | 42 if (!in_group_or_capable(idmap, inode, i_gid_into_vfsgid(idmap, inode))) in setattr_should_drop_sgid() 73 kill |= setattr_should_drop_sgid(idmap, inode); in setattr_should_drop_suidgid() 94 static bool chown_ok(struct mnt_idmap *idmap, in chown_ok() argument 121 static bool chgrp_ok(struct mnt_idmap *idmap, in chgrp_ok() argument 195 if (!inode_owner_or_capable(idmap, inode)) in setattr_prepare() 201 vfsgid = i_gid_into_vfsgid(idmap, inode); in setattr_prepare() 210 if (!inode_owner_or_capable(idmap, inode)) in setattr_prepare() 304 i_uid_update(idmap, attr, inode); in setattr_copy() 305 i_gid_update(idmap, attr, inode); in setattr_copy() 314 if (!in_group_or_capable(idmap, inode, in setattr_copy() [all …]
|
| A D | posix_acl.c | 390 vfsuid = i_uid_into_vfsuid(idmap, inode); in posix_acl_permission() 395 vfsuid = make_vfsuid(idmap, fs_userns, in posix_acl_permission() 401 vfsgid = i_gid_into_vfsgid(idmap, inode); in posix_acl_permission() 409 vfsgid = make_vfsgid(idmap, fs_userns, in posix_acl_permission() 718 if (!in_group_or_capable(idmap, inode, in posix_acl_update_mode() 719 i_gid_into_vfsgid(idmap, inode))) in posix_acl_update_mode() 947 if (!inode_owner_or_capable(idmap, inode)) in set_posix_acl() 1023 error = posix_acl_update_mode(idmap, inode, in simple_set_acl() 1121 error = may_write_xattr(idmap, inode); in vfs_set_acl() 1229 error = may_write_xattr(idmap, inode); in vfs_remove_acl() [all …]
|
| A D | xattr.c | 103 if (HAS_UNMAPPED_ID(idmap, inode)) in may_write_xattr() 119 ret = may_write_xattr(idmap, inode); in xattr_permission() 151 !inode_owner_or_capable(idmap, inode)) in xattr_permission() 155 return inode_permission(idmap, inode, mask); in xattr_permission() 222 int __vfs_setxattr_noperm(struct mnt_idmap *idmap, in __vfs_setxattr_noperm() argument 534 __vfs_removexattr_locked(struct mnt_idmap *idmap, in __vfs_removexattr_locked() argument 553 error = __vfs_removexattr(idmap, dentry, name); in __vfs_removexattr_locked() 575 error = __vfs_removexattr_locked(idmap, dentry, in vfs_removexattr() 772 error = do_getxattr(idmap, d, &ctx); in getxattr() 906 return vfs_remove_acl(idmap, d, name); in removexattr() [all …]
|
| A D | bad_inode.c | 30 static int bad_inode_create(struct mnt_idmap *idmap, in bad_inode_create() argument 54 static int bad_inode_symlink(struct mnt_idmap *idmap, in bad_inode_symlink() argument 61 static int bad_inode_mkdir(struct mnt_idmap *idmap, struct inode *dir, in bad_inode_mkdir() argument 72 static int bad_inode_mknod(struct mnt_idmap *idmap, struct inode *dir, in bad_inode_mknod() argument 78 static int bad_inode_rename2(struct mnt_idmap *idmap, in bad_inode_rename2() argument 92 static int bad_inode_permission(struct mnt_idmap *idmap, in bad_inode_permission() argument 98 static int bad_inode_getattr(struct mnt_idmap *idmap, in bad_inode_getattr() argument 105 static int bad_inode_setattr(struct mnt_idmap *idmap, in bad_inode_setattr() argument 148 static int bad_inode_tmpfile(struct mnt_idmap *idmap, in bad_inode_tmpfile() argument 155 static int bad_inode_set_acl(struct mnt_idmap *idmap, in bad_inode_set_acl() argument
|
| A D | internal.h | 59 int may_linkat(struct mnt_idmap *idmap, const struct path *link); 66 int vfs_tmpfile(struct mnt_idmap *idmap, 203 bool in_group_or_capable(struct mnt_idmap *idmap, 284 ssize_t do_getxattr(struct mnt_idmap *idmap, 289 int do_setxattr(struct mnt_idmap *idmap, struct dentry *dentry, 291 int may_write_xattr(struct mnt_idmap *idmap, struct inode *inode); 294 int do_set_acl(struct mnt_idmap *idmap, struct dentry *dentry, 299 static inline int do_set_acl(struct mnt_idmap *idmap, in do_set_acl() argument 305 static inline ssize_t do_get_acl(struct mnt_idmap *idmap, in do_get_acl() argument 319 struct mnt_idmap *mnt_idmap_get(struct mnt_idmap *idmap); [all …]
|
| A D | namei.c | 1109 struct mnt_idmap *idmap; in may_follow_link() local 1115 idmap = mnt_idmap(nd->path.mnt); in may_follow_link() 2361 struct mnt_idmap *idmap; in link_path_walk() local 2366 err = may_lookup(idmap, nd); in link_path_walk() 3501 struct mnt_idmap *idmap; in lookup_open() local 3552 idmap = mnt_idmap(nd->path.mnt); in lookup_open() 3733 struct mnt_idmap *idmap; in do_open() local 3746 idmap = mnt_idmap(nd->path.mnt); in do_open() 4162 struct mnt_idmap *idmap; in do_mknodat() local 4182 idmap = mnt_idmap(path.mnt); in do_mknodat() [all …]
|
| /linux/fs/nfs/ |
| A D | nfs4idmap.c | 65 struct idmap *idmap; member 78 if (idmap && idmap->user_ns) in idmap_userns() 426 struct idmap *idmap = pdo->pdo_data; in nfs_idmap_pipe_destroy() local 438 struct idmap *idmap = pdo->pdo_data; in nfs_idmap_pipe_create() local 457 struct idmap *idmap; in nfs_idmap_new() local 498 struct idmap *idmap = clp->cl_idmap; in nfs_idmap_delete() local 586 struct idmap *idmap = aux; in nfs_idmap_legacy_upcall() local 601 data->idmap = idmap; in nfs_idmap_legacy_upcall() 669 struct idmap *idmap = (struct idmap *)rpci->private; in idmap_pipe_downcall() local 727 struct idmap *idmap = data->idmap; in idmap_pipe_destroy_msg() local [all …]
|
| /linux/include/linux/ |
| A D | mnt_idmapping.h | 119 struct mnt_idmap *mnt_idmap_get(struct mnt_idmap *idmap); 120 void mnt_idmap_put(struct mnt_idmap *idmap); 122 vfsuid_t make_vfsuid(struct mnt_idmap *idmap, 125 vfsgid_t make_vfsgid(struct mnt_idmap *idmap, 128 kuid_t from_vfsuid(struct mnt_idmap *idmap, 131 kgid_t from_vfsgid(struct mnt_idmap *idmap, 146 static inline bool vfsuid_has_fsmapping(struct mnt_idmap *idmap, in vfsuid_has_fsmapping() argument 150 return uid_valid(from_vfsuid(idmap, fs_userns, vfsuid)); in vfsuid_has_fsmapping() 188 return gid_valid(from_vfsgid(idmap, fs_userns, vfsgid)); in vfsgid_has_fsmapping() 223 static inline kuid_t mapped_fsuid(struct mnt_idmap *idmap, in mapped_fsuid() argument [all …]
|
| A D | posix_acl.h | 103 int vfs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry, 105 struct posix_acl *vfs_get_acl(struct mnt_idmap *idmap, 107 int vfs_remove_acl(struct mnt_idmap *idmap, struct dentry *dentry, 112 static inline int posix_acl_chmod(struct mnt_idmap *idmap, in posix_acl_chmod() argument 139 static inline int vfs_set_acl(struct mnt_idmap *idmap, in vfs_set_acl() argument 146 static inline struct posix_acl *vfs_get_acl(struct mnt_idmap *idmap, in vfs_get_acl() argument 153 static inline int vfs_remove_acl(struct mnt_idmap *idmap, in vfs_remove_acl() argument
|
| A D | security.h | 174 int cap_inode_removexattr(struct mnt_idmap *idmap, 178 int cap_inode_getsecurity(struct mnt_idmap *idmap, 377 int security_inode_setattr(struct mnt_idmap *idmap, 382 int security_inode_setxattr(struct mnt_idmap *idmap, 385 int security_inode_set_acl(struct mnt_idmap *idmap, 390 int security_inode_get_acl(struct mnt_idmap *idmap, 392 int security_inode_remove_acl(struct mnt_idmap *idmap, 401 int security_inode_removexattr(struct mnt_idmap *idmap, 406 int security_inode_getsecurity(struct mnt_idmap *idmap, 987 return cap_inode_removexattr(idmap, dentry, name); in security_inode_removexattr() [all …]
|
| /linux/fs/smb/server/ |
| A D | vfs.h | 75 void ksmbd_vfs_query_maximal_access(struct mnt_idmap *idmap, 103 ssize_t ksmbd_vfs_getxattr(struct mnt_idmap *idmap, 107 ssize_t ksmbd_vfs_casexattr_len(struct mnt_idmap *idmap, 110 int ksmbd_vfs_setxattr(struct mnt_idmap *idmap, 116 int ksmbd_vfs_remove_xattr(struct mnt_idmap *idmap, 138 struct mnt_idmap *idmap, 144 int ksmbd_vfs_remove_acl_xattrs(struct mnt_idmap *idmap, 148 struct mnt_idmap *idmap, 153 struct mnt_idmap *idmap, 163 int ksmbd_vfs_set_init_posix_acl(struct mnt_idmap *idmap, [all …]
|
| A D | vfs.c | 212 struct mnt_idmap *idmap; in ksmbd_vfs_mkdir() local 228 idmap = mnt_idmap(path.mnt); in ksmbd_vfs_mkdir() 274 value_len = ksmbd_vfs_getxattr(idmap, in ksmbd_vfs_getcasexattr() 435 v_len = ksmbd_vfs_getcasexattr(idmap, in ksmbd_vfs_stream_write() 461 err = ksmbd_vfs_setxattr(idmap, in ksmbd_vfs_stream_write() 600 struct mnt_idmap *idmap; in ksmbd_vfs_remove_file() local 612 idmap = mnt_idmap(path->mnt); in ksmbd_vfs_remove_file() 948 err = vfs_setxattr(idmap, in ksmbd_vfs_setxattr() 1461 struct mnt_idmap *idmap, in ksmbd_vfs_set_sd_xattr() argument 1537 struct mnt_idmap *idmap, in ksmbd_vfs_get_sd_xattr() argument [all …]
|
| A D | smbacl.h | 84 int parse_sec_desc(struct mnt_idmap *idmap, struct smb_ntsd *pntsd, 86 int build_sec_desc(struct mnt_idmap *idmap, struct smb_ntsd *pntsd, 105 static inline uid_t posix_acl_uid_translate(struct mnt_idmap *idmap, in posix_acl_uid_translate() argument 111 vfsuid = make_vfsuid(idmap, &init_user_ns, pace->e_uid); in posix_acl_uid_translate() 117 static inline gid_t posix_acl_gid_translate(struct mnt_idmap *idmap, in posix_acl_gid_translate() argument 123 vfsgid = make_vfsgid(idmap, &init_user_ns, pace->e_gid); in posix_acl_gid_translate()
|
| A D | smbacl.c | 257 static int sid_to_id(struct mnt_idmap *idmap, in sid_to_id() argument 365 static void parse_dacl(struct mnt_idmap *idmap, in parse_dacl() argument 606 uid = posix_acl_uid_translate(idmap, pace); in set_posix_acl_entries_dacl() 613 gid = posix_acl_gid_translate(idmap, pace); in set_posix_acl_entries_dacl() 887 parse_dacl(idmap, dacl_ptr, end_of_acl, in parse_sec_desc() 895 int build_sec_desc(struct mnt_idmap *idmap, in build_sec_desc() argument 956 set_mode_dacl(idmap, dacl_ptr, fattr); in build_sec_desc() 1411 ksmbd_vfs_remove_acl_xattrs(idmap, path); in set_info_sec() 1414 rc = set_posix_acl(idmap, path->dentry, in set_info_sec() 1421 rc = set_posix_acl(idmap, path->dentry, in set_info_sec() [all …]
|
| /linux/fs/xfs/ |
| A D | xfs_iops.c | 169 struct mnt_idmap *idmap, in xfs_generic_create() argument 177 .idmap = idmap, in xfs_generic_create() 279 struct mnt_idmap *idmap, in xfs_vn_mknod() argument 290 struct mnt_idmap *idmap, in xfs_vn_create() argument 301 struct mnt_idmap *idmap, in xfs_vn_mkdir() argument 426 struct mnt_idmap *idmap, in xfs_vn_symlink() argument 469 struct mnt_idmap *idmap, in xfs_vn_rename() argument 575 struct mnt_idmap *idmap, in xfs_vn_getattr() argument 658 struct mnt_idmap *idmap, in xfs_vn_change_ok() argument 681 struct mnt_idmap *idmap, in xfs_setattr_nonsize() argument [all …]
|
| /linux/Documentation/admin-guide/nfs/ |
| A D | nfs-idmapper.rst | 9 or by placing a call to the rpc.idmap daemon. 19 legacy rpc.idmap daemon for the id mapping. This result will be stored 20 in a custom NFS idmap cache. 31 ``create id_resolver * * /usr/sbin/nfs.idmap %k %d 600`` 34 This will direct all id_resolver requests to the program /usr/sbin/nfs.idmap. 36 expire. This parameter is optional for /usr/sbin/nfs.idmap. When the timeout 37 is not specified, nfs.idmap will default to 600 seconds. 53 ``create id_resolver * * /usr/sbin/nfs.idmap %k %d 600`` 59 /usr/sbin/nfs.idmap will handle gid, user, and group lookups. 65 nfs.idmap [all …]
|
| /linux/security/integrity/evm/ |
| A D | evm_main.c | 461 static int evm_xattr_change(struct mnt_idmap *idmap, in evm_xattr_change() argument 497 static int evm_protect_xattr(struct mnt_idmap *idmap, in evm_protect_xattr() argument 559 !evm_xattr_change(idmap, dentry, xattr_name, xattr_value, in evm_protect_xattr() 632 static int evm_inode_set_acl_change(struct mnt_idmap *idmap, in evm_inode_set_acl_change() argument 644 rc = posix_acl_update_mode(idmap, inode, &mode, &kacl); in evm_inode_set_acl_change() 728 return evm_inode_set_acl(idmap, dentry, acl_name, NULL); in evm_inode_remove_acl() 885 static int evm_attr_change(struct mnt_idmap *idmap, in evm_attr_change() argument 891 if (!i_uid_needs_update(idmap, attr, inode) && in evm_attr_change() 892 !i_gid_needs_update(idmap, attr, inode) && in evm_attr_change() 939 !evm_attr_change(idmap, dentry, attr)) in evm_inode_setattr() [all …]
|
| /linux/fs/fuse/ |
| A D | dir.c | 579 static int get_create_ext(struct mnt_idmap *idmap, in get_create_ext() argument 591 err = get_create_supp_group(idmap, dir, &ext); in get_create_ext() 737 struct mnt_idmap *idmap = file_mnt_idmap(file); in fuse_atomic_open() local 773 err = fuse_mknod(idmap, dir, entry, mode, 0); in fuse_atomic_open() 879 return fuse_mknod(idmap, dir, entry, mode, 0); in fuse_create() 1247 fuse_fillattr(idmap, inode, &attr, stat); in fuse_do_statx() 1333 err = fuse_do_statx(idmap, inode, file, stat); in fuse_update_get_attr() 1557 err = generic_permission(idmap, inode, mask); in fuse_permission() 1565 err = generic_permission(idmap, in fuse_permission() 1924 err = setattr_prepare(idmap, dentry, attr); in fuse_do_setattr() [all …]
|
| A D | acl.c | 67 struct posix_acl *fuse_get_acl(struct mnt_idmap *idmap, in fuse_get_acl() argument 95 int fuse_set_acl(struct mnt_idmap *idmap, struct dentry *dentry, in fuse_set_acl() argument 147 !in_group_or_capable(idmap, inode, in fuse_set_acl() 148 i_gid_into_vfsgid(idmap, inode))) in fuse_set_acl()
|
| /linux/fs/f2fs/ |
| A D | namei.c | 219 static struct inode *f2fs_new_inode(struct mnt_idmap *idmap, in f2fs_new_inode() argument 243 inode_init_owner(idmap, inode, dir, mode); in f2fs_new_inode() 369 inode = f2fs_new_inode(idmap, dir, mode, dentry->d_name.name); in f2fs_create() 700 inode = f2fs_new_inode(idmap, dir, S_IFDIR | mode, NULL); in f2fs_mkdir() 757 inode = f2fs_new_inode(idmap, dir, mode, NULL); in f2fs_mknod() 796 inode = f2fs_new_inode(idmap, dir, mode, NULL); in __f2fs_tmpfile() 870 static int f2fs_create_whiteout(struct mnt_idmap *idmap, in f2fs_create_whiteout() argument 881 return __f2fs_tmpfile(idmap, dir, NULL, S_IFREG, in f2fs_get_tmpfile() 1246 static int f2fs_rename2(struct mnt_idmap *idmap, in f2fs_rename2() argument 1272 err = f2fs_rename(idmap, old_dir, old_dentry, in f2fs_rename2() [all …]
|
| /linux/fs/fat/ |
| A D | file.c | 398 int fat_getattr(struct mnt_idmap *idmap, const struct path *path, in fat_getattr() argument 404 generic_fillattr(idmap, request_mask, inode, stat); in fat_getattr() 459 static int fat_allow_set_time(struct mnt_idmap *idmap, in fat_allow_set_time() argument 464 if (!vfsuid_eq_kuid(i_uid_into_vfsuid(idmap, inode), in fat_allow_set_time() 466 if (vfsgid_in_group_p(i_gid_into_vfsgid(idmap, inode))) in fat_allow_set_time() 480 int fat_setattr(struct mnt_idmap *idmap, struct dentry *dentry, in fat_setattr() argument 491 if (fat_allow_set_time(idmap, sbi, inode)) in fat_setattr() 495 error = setattr_prepare(idmap, dentry, attr); in fat_setattr() 521 (!uid_eq(from_vfsuid(idmap, i_user_ns(inode), attr->ia_vfsuid), in fat_setattr() 524 (!gid_eq(from_vfsgid(idmap, i_user_ns(inode), attr->ia_vfsgid), in fat_setattr() [all …]
|
| /linux/fs/minix/ |
| A D | namei.c | 36 static int minix_mknod(struct mnt_idmap *idmap, struct inode *dir, in minix_mknod() argument 53 static int minix_tmpfile(struct mnt_idmap *idmap, struct inode *dir, in minix_tmpfile() argument 66 static int minix_create(struct mnt_idmap *idmap, struct inode *dir, in minix_create() argument 72 static int minix_symlink(struct mnt_idmap *idmap, struct inode *dir, in minix_symlink() argument 107 static int minix_mkdir(struct mnt_idmap *idmap, struct inode *dir, in minix_mkdir() argument 176 static int minix_rename(struct mnt_idmap *idmap, in minix_rename() argument
|
| /linux/fs/ntfs3/ |
| A D | namei.c | 107 static int ntfs_create(struct mnt_idmap *idmap, struct inode *dir, in ntfs_create() argument 110 return ntfs_create_inode(idmap, dir, dentry, NULL, S_IFREG | mode, 0, in ntfs_create() 117 static int ntfs_mknod(struct mnt_idmap *idmap, struct inode *dir, in ntfs_mknod() argument 120 return ntfs_create_inode(idmap, dir, dentry, NULL, mode, rdev, NULL, 0, in ntfs_mknod() 189 static int ntfs_symlink(struct mnt_idmap *idmap, struct inode *dir, in ntfs_symlink() argument 197 return ntfs_create_inode(idmap, dir, dentry, NULL, S_IFLNK | 0777, 0, in ntfs_symlink() 204 static int ntfs_mkdir(struct mnt_idmap *idmap, struct inode *dir, in ntfs_mkdir() argument 207 return ntfs_create_inode(idmap, dir, dentry, NULL, S_IFDIR | mode, 0, in ntfs_mkdir() 234 static int ntfs_rename(struct mnt_idmap *idmap, struct inode *dir, in ntfs_rename() argument
|
| /linux/fs/exfat/ |
| A D | file.c | 90 static bool exfat_allow_set_time(struct mnt_idmap *idmap, in exfat_allow_set_time() argument 95 if (!vfsuid_eq_kuid(i_uid_into_vfsuid(idmap, inode), in exfat_allow_set_time() 97 if (vfsgid_in_group_p(i_gid_into_vfsgid(idmap, inode))) in exfat_allow_set_time() 266 int exfat_getattr(struct mnt_idmap *idmap, const struct path *path, in exfat_getattr() argument 273 generic_fillattr(idmap, request_mask, inode, stat); in exfat_getattr() 282 int exfat_setattr(struct mnt_idmap *idmap, struct dentry *dentry, in exfat_setattr() argument 304 exfat_allow_set_time(idmap, sbi, inode)) { in exfat_setattr() 309 error = setattr_prepare(idmap, dentry, attr); in exfat_setattr() 315 (!uid_eq(from_vfsuid(idmap, i_user_ns(inode), attr->ia_vfsuid), in exfat_setattr() 318 (!gid_eq(from_vfsgid(idmap, i_user_ns(inode), attr->ia_vfsgid), in exfat_setattr() [all …]
|