| /linux-6.15/fs/ |
| H A D | mnt_idmapping.c | 284 kfree(idmap); in free_mnt_idmap() 293 if (!idmap) in alloc_mnt_idmap() 301 free_mnt_idmap(idmap); in alloc_mnt_idmap() 302 idmap = ERR_PTR(ret); in alloc_mnt_idmap() 304 return idmap; in alloc_mnt_idmap() 317 if (idmap != &nop_mnt_idmap && idmap != &invalid_mnt_idmap) in mnt_idmap_get() 320 return idmap; in mnt_idmap_get() 333 if (idmap != &nop_mnt_idmap && idmap != &invalid_mnt_idmap && in mnt_idmap_put() 335 free_mnt_idmap(idmap); in mnt_idmap_put() 352 map = &idmap->uid_map; in statmount_mnt_idmap() [all …]
|
| H 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() 345 i_uid_update(idmap, attr, inode); in setattr_copy() 346 i_gid_update(idmap, attr, inode); in setattr_copy() 349 if (!in_group_or_capable(idmap, inode, in setattr_copy() [all …]
|
| H A D | posix_acl.c | 389 vfsuid = i_uid_into_vfsuid(idmap, inode); in posix_acl_permission() 394 vfsuid = make_vfsuid(idmap, fs_userns, in posix_acl_permission() 400 vfsgid = i_gid_into_vfsgid(idmap, inode); in posix_acl_permission() 408 vfsgid = make_vfsgid(idmap, fs_userns, in posix_acl_permission() 717 if (!in_group_or_capable(idmap, inode, in posix_acl_update_mode() 718 i_gid_into_vfsgid(idmap, inode))) in posix_acl_update_mode() 946 if (!inode_owner_or_capable(idmap, inode)) in set_posix_acl() 1022 error = posix_acl_update_mode(idmap, inode, in simple_set_acl() 1120 error = may_write_xattr(idmap, inode); in vfs_set_acl() 1228 error = may_write_xattr(idmap, inode); in vfs_remove_acl() [all …]
|
| H 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 struct dentry *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
|
| H 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() 633 return do_set_acl(idmap, dentry, ctx->kname->name, in do_setxattr() 1022 return vfs_remove_acl(idmap, d, name); in removexattr() [all …]
|
| H A D | internal.h | 59 int may_linkat(struct mnt_idmap *idmap, const struct path *link); 66 int vfs_tmpfile(struct mnt_idmap *idmap, 206 bool in_group_or_capable(struct mnt_idmap *idmap, 293 int may_write_xattr(struct mnt_idmap *idmap, struct inode *inode); 296 int do_set_acl(struct mnt_idmap *idmap, struct dentry *dentry, 298 ssize_t do_get_acl(struct mnt_idmap *idmap, struct dentry *dentry, 301 static inline int do_set_acl(struct mnt_idmap *idmap, in do_set_acl() argument 307 static inline ssize_t do_get_acl(struct mnt_idmap *idmap, in do_get_acl() argument 321 struct mnt_idmap *mnt_idmap_get(struct mnt_idmap *idmap); 322 void mnt_idmap_put(struct mnt_idmap *idmap); [all …]
|
| H A D | namei.c | 1170 struct mnt_idmap *idmap; in may_follow_link() local 1176 idmap = mnt_idmap(nd->path.mnt); in may_follow_link() 2446 struct mnt_idmap *idmap; in link_path_walk() local 2451 err = may_lookup(idmap, nd); in link_path_walk() 3607 struct mnt_idmap *idmap; in lookup_open() local 3658 idmap = mnt_idmap(nd->path.mnt); in lookup_open() 3839 struct mnt_idmap *idmap; in do_open() local 3852 idmap = mnt_idmap(nd->path.mnt); in do_open() 4255 struct mnt_idmap *idmap; in do_mknodat() local 4275 idmap = mnt_idmap(path.mnt); in do_mknodat() [all …]
|
| /linux-6.15/fs/nfs/ |
| H 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-6.15/include/linux/ |
| H A D | mnt_idmapping.h | 30 return idmap != &nop_mnt_idmap && idmap != &invalid_mnt_idmap; in is_valid_mnt_idmap() 124 struct mnt_idmap *mnt_idmap_get(struct mnt_idmap *idmap); 125 void mnt_idmap_put(struct mnt_idmap *idmap); 127 vfsuid_t make_vfsuid(struct mnt_idmap *idmap, 130 vfsgid_t make_vfsgid(struct mnt_idmap *idmap, 133 kuid_t from_vfsuid(struct mnt_idmap *idmap, 136 kgid_t from_vfsgid(struct mnt_idmap *idmap, 155 return uid_valid(from_vfsuid(idmap, fs_userns, vfsuid)); in vfsuid_has_fsmapping() 193 return gid_valid(from_vfsgid(idmap, fs_userns, vfsgid)); in vfsgid_has_fsmapping() 228 static inline kuid_t mapped_fsuid(struct mnt_idmap *idmap, in mapped_fsuid() argument [all …]
|
| H A D | posix_acl.h | 108 int vfs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry, 110 struct posix_acl *vfs_get_acl(struct mnt_idmap *idmap, 112 int vfs_remove_acl(struct mnt_idmap *idmap, struct dentry *dentry, 117 static inline int posix_acl_chmod(struct mnt_idmap *idmap, in posix_acl_chmod() argument 144 static inline int vfs_set_acl(struct mnt_idmap *idmap, in vfs_set_acl() argument 151 static inline struct posix_acl *vfs_get_acl(struct mnt_idmap *idmap, in vfs_get_acl() argument 158 static inline int vfs_remove_acl(struct mnt_idmap *idmap, in vfs_remove_acl() argument
|
| H A D | security.h | 188 int cap_inode_removexattr(struct mnt_idmap *idmap, 192 int cap_inode_getsecurity(struct mnt_idmap *idmap, 427 int security_inode_setattr(struct mnt_idmap *idmap, 432 int security_inode_setxattr(struct mnt_idmap *idmap, 435 int security_inode_set_acl(struct mnt_idmap *idmap, 440 int security_inode_get_acl(struct mnt_idmap *idmap, 442 int security_inode_remove_acl(struct mnt_idmap *idmap, 451 int security_inode_removexattr(struct mnt_idmap *idmap, 456 int security_inode_getsecurity(struct mnt_idmap *idmap, 1049 return cap_inode_removexattr(idmap, dentry, name); in security_inode_removexattr() [all …]
|
| /linux-6.15/fs/smb/server/ |
| H A D | vfs.h | 76 void ksmbd_vfs_query_maximal_access(struct mnt_idmap *idmap, 104 ssize_t ksmbd_vfs_getxattr(struct mnt_idmap *idmap, 108 ssize_t ksmbd_vfs_casexattr_len(struct mnt_idmap *idmap, 111 int ksmbd_vfs_setxattr(struct mnt_idmap *idmap, 117 int ksmbd_vfs_remove_xattr(struct mnt_idmap *idmap, 139 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 …]
|
| H A D | vfs.c | 207 struct mnt_idmap *idmap; in ksmbd_vfs_mkdir() local 223 idmap = mnt_idmap(path.mnt); in ksmbd_vfs_mkdir() 257 value_len = ksmbd_vfs_getxattr(idmap, in ksmbd_vfs_getcasexattr() 423 v_len = ksmbd_vfs_getcasexattr(idmap, in ksmbd_vfs_stream_write() 449 err = ksmbd_vfs_setxattr(idmap, in ksmbd_vfs_stream_write() 589 struct mnt_idmap *idmap; in ksmbd_vfs_remove_file() local 601 idmap = mnt_idmap(path->mnt); in ksmbd_vfs_remove_file() 936 err = vfs_setxattr(idmap, in ksmbd_vfs_setxattr() 1450 struct mnt_idmap *idmap, in ksmbd_vfs_set_sd_xattr() argument 1526 struct mnt_idmap *idmap, in ksmbd_vfs_get_sd_xattr() argument [all …]
|
| H 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()
|
| H A D | smbacl.c | 257 static int sid_to_id(struct mnt_idmap *idmap, in sid_to_id() argument 370 static void parse_dacl(struct mnt_idmap *idmap, in parse_dacl() argument 614 uid = posix_acl_uid_translate(idmap, pace); in set_posix_acl_entries_dacl() 621 gid = posix_acl_gid_translate(idmap, pace); in set_posix_acl_entries_dacl() 911 parse_dacl(idmap, dacl_ptr, end_of_acl, in parse_sec_desc() 919 int build_sec_desc(struct mnt_idmap *idmap, in build_sec_desc() argument 980 set_mode_dacl(idmap, dacl_ptr, fattr); in build_sec_desc() 1445 ksmbd_vfs_remove_acl_xattrs(idmap, path); in set_info_sec() 1448 rc = set_posix_acl(idmap, path->dentry, in set_info_sec() 1455 rc = set_posix_acl(idmap, path->dentry, in set_info_sec() [all …]
|
| /linux-6.15/fs/xfs/ |
| H A D | xfs_iops.c | 172 struct mnt_idmap *idmap, in xfs_generic_create() argument 180 .idmap = idmap, in xfs_generic_create() 282 struct mnt_idmap *idmap, in xfs_vn_mknod() argument 293 struct mnt_idmap *idmap, in xfs_vn_create() argument 304 struct mnt_idmap *idmap, in xfs_vn_mkdir() argument 429 struct mnt_idmap *idmap, in xfs_vn_symlink() argument 472 struct mnt_idmap *idmap, in xfs_vn_rename() argument 618 struct mnt_idmap *idmap, in xfs_vn_getattr() argument 693 struct mnt_idmap *idmap, in xfs_vn_change_ok() argument 716 struct mnt_idmap *idmap, in xfs_setattr_nonsize() argument [all …]
|
| /linux-6.15/Documentation/admin-guide/nfs/ |
| H 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-6.15/samples/vfs/ |
| H A D | test-list-all-mounts.c | 149 const char *idmap = stmnt->str + stmnt->mnt_uidmap; in main() local 152 printf("mnt_uidmap[%zu]:\t%s\n", idx, idmap); in main() 153 idmap += strlen(idmap) + 1; in main() 158 const char *idmap = stmnt->str + stmnt->mnt_gidmap; in main() local 161 printf("mnt_gidmap[%zu]:\t%s\n", idx, idmap); in main() 162 idmap += strlen(idmap) + 1; in main()
|
| /linux-6.15/security/integrity/evm/ |
| H 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-6.15/fs/fuse/ |
| H A D | dir.c | 580 static int get_create_ext(struct mnt_idmap *idmap, in get_create_ext() argument 592 err = get_create_supp_group(idmap, dir, &ext); in get_create_ext() 738 struct mnt_idmap *idmap = file_mnt_idmap(file); in fuse_atomic_open() local 774 err = fuse_mknod(idmap, dir, entry, mode, 0); in fuse_atomic_open() 894 return fuse_mknod(idmap, dir, entry, mode, 0); in fuse_create() 1274 fuse_fillattr(idmap, inode, &attr, stat); in fuse_do_statx() 1360 err = fuse_do_statx(idmap, inode, file, stat); in fuse_update_get_attr() 1584 err = generic_permission(idmap, inode, mask); in fuse_permission() 1592 err = generic_permission(idmap, in fuse_permission() 1953 err = setattr_prepare(idmap, dentry, attr); in fuse_do_setattr() [all …]
|
| H 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-6.15/fs/f2fs/ |
| H 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() 370 inode = f2fs_new_inode(idmap, dir, mode, dentry->d_name.name); in f2fs_create() 709 inode = f2fs_new_inode(idmap, dir, S_IFDIR | mode, NULL); in f2fs_mkdir() 766 inode = f2fs_new_inode(idmap, dir, mode, NULL); in f2fs_mknod() 805 inode = f2fs_new_inode(idmap, dir, mode, NULL); in __f2fs_tmpfile() 879 static int f2fs_create_whiteout(struct mnt_idmap *idmap, in f2fs_create_whiteout() argument 890 return __f2fs_tmpfile(idmap, dir, NULL, S_IFREG, in f2fs_get_tmpfile() 1255 static int f2fs_rename2(struct mnt_idmap *idmap, in f2fs_rename2() argument 1281 err = f2fs_rename(idmap, old_dir, old_dentry, in f2fs_rename2() [all …]
|
| /linux-6.15/fs/efivarfs/ |
| H A D | inode.c | 77 static int efivarfs_create(struct mnt_idmap *idmap, struct inode *dir, in efivarfs_create() argument 156 efivarfs_fileattr_set(struct mnt_idmap *idmap, in efivarfs_fileattr_set() argument 176 static int efivarfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, in efivarfs_setattr() argument 182 error = setattr_prepare(idmap, dentry, iattr); in efivarfs_setattr() 186 setattr_copy(idmap, inode, iattr); in efivarfs_setattr()
|
| /linux-6.15/fs/fat/ |
| H 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-6.15/fs/minix/ |
| H 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 struct dentry *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
|