/linux-6.1.9/include/linux/ |
D | mnt_idmapping.h | 167 static inline bool no_idmapping(const struct user_namespace *mnt_userns, in no_idmapping() argument 170 return initial_idmapping(mnt_userns) || mnt_userns == fs_userns; in no_idmapping() 194 static inline vfsuid_t make_vfsuid(struct user_namespace *mnt_userns, in make_vfsuid() argument 200 if (no_idmapping(mnt_userns, fs_userns)) in make_vfsuid() 208 return VFSUIDT_INIT(make_kuid(mnt_userns, uid)); in make_vfsuid() 211 static inline kuid_t mapped_kuid_fs(struct user_namespace *mnt_userns, in mapped_kuid_fs() argument 215 return AS_KUIDT(make_vfsuid(mnt_userns, fs_userns, kuid)); in mapped_kuid_fs() 239 static inline vfsgid_t make_vfsgid(struct user_namespace *mnt_userns, in make_vfsgid() argument 245 if (no_idmapping(mnt_userns, fs_userns)) in make_vfsgid() 253 return VFSGIDT_INIT(make_kgid(mnt_userns, gid)); in make_vfsgid() [all …]
|
D | evm.h | 24 extern int evm_inode_setattr(struct user_namespace *mnt_userns, 27 extern int evm_inode_setxattr(struct user_namespace *mnt_userns, 34 extern int evm_inode_removexattr(struct user_namespace *mnt_userns, 72 static inline int evm_inode_setattr(struct user_namespace *mnt_userns, in evm_inode_setattr() argument 83 static inline int evm_inode_setxattr(struct user_namespace *mnt_userns, in evm_inode_setxattr() argument 98 static inline int evm_inode_removexattr(struct user_namespace *mnt_userns, in evm_inode_removexattr() argument
|
D | ima.h | 21 extern void ima_post_create_tmpfile(struct user_namespace *mnt_userns, 33 extern void ima_post_path_mknod(struct user_namespace *mnt_userns, 69 static inline void ima_post_create_tmpfile(struct user_namespace *mnt_userns, in ima_post_create_tmpfile() argument 114 static inline void ima_post_path_mknod(struct user_namespace *mnt_userns, in ima_post_path_mknod() argument 186 extern void ima_inode_post_setattr(struct user_namespace *mnt_userns, 197 static inline void ima_inode_post_setattr(struct user_namespace *mnt_userns, in ima_inode_post_setattr() argument
|
D | posix_acl_xattr.h | 38 void posix_acl_getxattr_idmapped_mnt(struct user_namespace *mnt_userns, 49 posix_acl_getxattr_idmapped_mnt(struct user_namespace *mnt_userns, in posix_acl_getxattr_idmapped_mnt() argument 60 struct posix_acl *vfs_set_acl_prepare(struct user_namespace *mnt_userns,
|
D | fs.h | 1632 static inline kuid_t i_uid_into_mnt(struct user_namespace *mnt_userns, in i_uid_into_mnt() argument 1635 return AS_KUIDT(make_vfsuid(mnt_userns, i_user_ns(inode), inode->i_uid)); in i_uid_into_mnt() 1646 static inline vfsuid_t i_uid_into_vfsuid(struct user_namespace *mnt_userns, in i_uid_into_vfsuid() argument 1649 return make_vfsuid(mnt_userns, i_user_ns(inode), inode->i_uid); in i_uid_into_vfsuid() 1663 static inline bool i_uid_needs_update(struct user_namespace *mnt_userns, in i_uid_needs_update() argument 1669 i_uid_into_vfsuid(mnt_userns, inode))); in i_uid_needs_update() 1681 static inline void i_uid_update(struct user_namespace *mnt_userns, in i_uid_update() argument 1686 inode->i_uid = from_vfsuid(mnt_userns, i_user_ns(inode), in i_uid_update() 1701 static inline kgid_t i_gid_into_mnt(struct user_namespace *mnt_userns, in i_gid_into_mnt() argument 1704 return AS_KGIDT(make_vfsgid(mnt_userns, i_user_ns(inode), inode->i_gid)); in i_gid_into_mnt() [all …]
|
/linux-6.1.9/fs/ |
D | attr.c | 33 static bool chown_ok(struct user_namespace *mnt_userns, in chown_ok() argument 36 vfsuid_t vfsuid = i_uid_into_vfsuid(mnt_userns, inode); in chown_ok() 40 if (capable_wrt_inode_uidgid(mnt_userns, inode, CAP_CHOWN)) in chown_ok() 60 static bool chgrp_ok(struct user_namespace *mnt_userns, in chgrp_ok() argument 63 vfsgid_t vfsgid = i_gid_into_vfsgid(mnt_userns, inode); in chgrp_ok() 64 vfsuid_t vfsuid = i_uid_into_vfsuid(mnt_userns, inode); in chgrp_ok() 71 if (capable_wrt_inode_uidgid(mnt_userns, inode, CAP_CHOWN)) in chgrp_ok() 100 int setattr_prepare(struct user_namespace *mnt_userns, struct dentry *dentry, in setattr_prepare() argument 122 !chown_ok(mnt_userns, inode, attr->ia_vfsuid)) in setattr_prepare() 127 !chgrp_ok(mnt_userns, inode, attr->ia_vfsgid)) in setattr_prepare() [all …]
|
D | xattr.c | 88 xattr_permission(struct user_namespace *mnt_userns, struct inode *inode, in xattr_permission() argument 103 if (HAS_UNMAPPED_ID(mnt_userns, inode)) in xattr_permission() 134 !inode_owner_or_capable(mnt_userns, inode)) in xattr_permission() 138 return inode_permission(mnt_userns, inode, mask); in xattr_permission() 169 __vfs_setxattr(struct user_namespace *mnt_userns, struct dentry *dentry, in __vfs_setxattr() argument 182 return handler->set(handler, mnt_userns, dentry, inode, name, value, in __vfs_setxattr() 204 int __vfs_setxattr_noperm(struct user_namespace *mnt_userns, in __vfs_setxattr_noperm() argument 216 error = __vfs_setxattr(mnt_userns, dentry, inode, name, value, in __vfs_setxattr_noperm() 257 __vfs_setxattr_locked(struct user_namespace *mnt_userns, struct dentry *dentry, in __vfs_setxattr_locked() argument 264 error = xattr_permission(mnt_userns, inode, name, MAY_WRITE); in __vfs_setxattr_locked() [all …]
|
D | bad_inode.c | 30 static int bad_inode_create(struct user_namespace *mnt_userns, in bad_inode_create() argument 54 static int bad_inode_symlink(struct user_namespace *mnt_userns, in bad_inode_symlink() argument 61 static int bad_inode_mkdir(struct user_namespace *mnt_userns, struct inode *dir, in bad_inode_mkdir() argument 72 static int bad_inode_mknod(struct user_namespace *mnt_userns, struct inode *dir, in bad_inode_mknod() argument 78 static int bad_inode_rename2(struct user_namespace *mnt_userns, in bad_inode_rename2() argument 92 static int bad_inode_permission(struct user_namespace *mnt_userns, in bad_inode_permission() argument 98 static int bad_inode_getattr(struct user_namespace *mnt_userns, in bad_inode_getattr() argument 105 static int bad_inode_setattr(struct user_namespace *mnt_userns, in bad_inode_setattr() argument 149 static int bad_inode_tmpfile(struct user_namespace *mnt_userns, in bad_inode_tmpfile() argument 156 static int bad_inode_set_acl(struct user_namespace *mnt_userns, in bad_inode_set_acl() argument
|
D | posix_acl.c | 361 posix_acl_permission(struct user_namespace *mnt_userns, struct inode *inode, in posix_acl_permission() argument 376 vfsuid = i_uid_into_vfsuid(mnt_userns, inode); in posix_acl_permission() 381 vfsuid = make_vfsuid(mnt_userns, fs_userns, in posix_acl_permission() 387 vfsgid = i_gid_into_vfsgid(mnt_userns, inode); in posix_acl_permission() 395 vfsgid = make_vfsgid(mnt_userns, fs_userns, in posix_acl_permission() 591 posix_acl_chmod(struct user_namespace *mnt_userns, struct inode *inode, in posix_acl_chmod() argument 612 ret = inode->i_op->set_acl(mnt_userns, inode, acl, ACL_TYPE_ACCESS); in posix_acl_chmod() 691 int posix_acl_update_mode(struct user_namespace *mnt_userns, in posix_acl_update_mode() argument 703 if (!vfsgid_in_group_p(i_gid_into_vfsgid(mnt_userns, inode)) && in posix_acl_update_mode() 704 !capable_wrt_inode_uidgid(mnt_userns, inode, CAP_FSETID)) in posix_acl_update_mode() [all …]
|
D | namei.c | 290 static int check_acl(struct user_namespace *mnt_userns, in check_acl() argument 303 return posix_acl_permission(mnt_userns, inode, acl, mask); in check_acl() 310 int error = posix_acl_permission(mnt_userns, inode, acl, mask); in check_acl() 335 static int acl_permission_check(struct user_namespace *mnt_userns, in acl_permission_check() argument 342 i_uid = i_uid_into_mnt(mnt_userns, inode); in acl_permission_check() 351 int error = check_acl(mnt_userns, inode, mask); in acl_permission_check() 365 kgid_t kgid = i_gid_into_mnt(mnt_userns, inode); in acl_permission_check() 396 int generic_permission(struct user_namespace *mnt_userns, struct inode *inode, in generic_permission() argument 404 ret = acl_permission_check(mnt_userns, inode, mask); in generic_permission() 411 if (capable_wrt_inode_uidgid(mnt_userns, inode, in generic_permission() [all …]
|
/linux-6.1.9/fs/xfs/ |
D | xfs_iops.c | 165 struct user_namespace *mnt_userns, in xfs_generic_create() argument 199 error = xfs_create(mnt_userns, XFS_I(dir), &name, mode, rdev, in xfs_generic_create() 203 error = xfs_create_tmpfile(mnt_userns, XFS_I(dir), mode, &ip); in xfs_generic_create() 258 struct user_namespace *mnt_userns, in xfs_vn_mknod() argument 264 return xfs_generic_create(mnt_userns, dir, dentry, mode, rdev, NULL); in xfs_vn_mknod() 269 struct user_namespace *mnt_userns, in xfs_vn_create() argument 275 return xfs_generic_create(mnt_userns, dir, dentry, mode, 0, NULL); in xfs_vn_create() 280 struct user_namespace *mnt_userns, in xfs_vn_mkdir() argument 285 return xfs_generic_create(mnt_userns, dir, dentry, mode | S_IFDIR, 0, in xfs_vn_mkdir() 403 struct user_namespace *mnt_userns, in xfs_vn_symlink() argument [all …]
|
D | xfs_itable.c | 58 struct user_namespace *mnt_userns, in xfs_bulkstat_one_int() argument 86 vfsuid = i_uid_into_vfsuid(mnt_userns, inode); in xfs_bulkstat_one_int() 87 vfsgid = i_gid_into_vfsgid(mnt_userns, inode); in xfs_bulkstat_one_int() 181 if (breq->mnt_userns != &init_user_ns) { in xfs_bulkstat_one() 202 error = xfs_bulkstat_one_int(breq->mp, breq->mnt_userns, tp, in xfs_bulkstat_one() 228 error = xfs_bulkstat_one_int(mp, bc->breq->mnt_userns, tp, ino, data); in xfs_bulkstat_iwalk() 273 if (breq->mnt_userns != &init_user_ns) { in xfs_bulkstat()
|
/linux-6.1.9/security/integrity/evm/ |
D | evm_main.c | 449 static int evm_xattr_acl_change(struct user_namespace *mnt_userns, in evm_xattr_acl_change() argument 473 acl = vfs_set_acl_prepare(mnt_userns, i_user_ns(inode), in evm_xattr_acl_change() 484 rc = posix_acl_update_mode(mnt_userns, inode, &mode, &acl_res); in evm_xattr_acl_change() 509 static int evm_xattr_change(struct user_namespace *mnt_userns, in evm_xattr_change() argument 517 return evm_xattr_acl_change(mnt_userns, dentry, xattr_name, in evm_xattr_change() 546 static int evm_protect_xattr(struct user_namespace *mnt_userns, in evm_protect_xattr() argument 602 !evm_xattr_change(mnt_userns, dentry, xattr_name, xattr_value, in evm_protect_xattr() 629 int evm_inode_setxattr(struct user_namespace *mnt_userns, struct dentry *dentry, in evm_inode_setxattr() argument 648 return evm_protect_xattr(mnt_userns, dentry, xattr_name, xattr_value, in evm_inode_setxattr() 661 int evm_inode_removexattr(struct user_namespace *mnt_userns, in evm_inode_removexattr() argument [all …]
|
/linux-6.1.9/fs/ntfs3/ |
D | namei.c | 95 static int ntfs_create(struct user_namespace *mnt_userns, struct inode *dir, in ntfs_create() argument 100 inode = ntfs_create_inode(mnt_userns, dir, dentry, NULL, S_IFREG | mode, in ntfs_create() 111 static int ntfs_mknod(struct user_namespace *mnt_userns, struct inode *dir, in ntfs_mknod() argument 116 inode = ntfs_create_inode(mnt_userns, dir, dentry, NULL, mode, rdev, in ntfs_mknod() 184 static int ntfs_symlink(struct user_namespace *mnt_userns, struct inode *dir, in ntfs_symlink() argument 190 inode = ntfs_create_inode(mnt_userns, dir, dentry, NULL, S_IFLNK | 0777, in ntfs_symlink() 199 static int ntfs_mkdir(struct user_namespace *mnt_userns, struct inode *dir, in ntfs_mkdir() argument 204 inode = ntfs_create_inode(mnt_userns, dir, dentry, NULL, S_IFDIR | mode, in ntfs_mkdir() 230 static int ntfs_rename(struct user_namespace *mnt_userns, struct inode *dir, in ntfs_rename() argument
|
D | xattr.c | 547 static noinline int ntfs_set_acl_ex(struct user_namespace *mnt_userns, in ntfs_set_acl_ex() argument 566 err = posix_acl_update_mode(mnt_userns, inode, &mode, in ntfs_set_acl_ex() 622 int ntfs_set_acl(struct user_namespace *mnt_userns, struct inode *inode, in ntfs_set_acl() argument 625 return ntfs_set_acl_ex(mnt_userns, inode, acl, type, false); in ntfs_set_acl() 633 int ntfs_init_acl(struct user_namespace *mnt_userns, struct inode *inode, in ntfs_init_acl() argument 644 err = ntfs_set_acl_ex(mnt_userns, inode, default_acl, in ntfs_init_acl() 653 err = ntfs_set_acl_ex(mnt_userns, inode, acl, in ntfs_init_acl() 667 int ntfs_acl_chmod(struct user_namespace *mnt_userns, struct inode *inode) in ntfs_acl_chmod() argument 677 return posix_acl_chmod(mnt_userns, inode, inode->i_mode); in ntfs_acl_chmod() 683 int ntfs_permission(struct user_namespace *mnt_userns, struct inode *inode, in ntfs_permission() argument [all …]
|
/linux-6.1.9/fs/minix/ |
D | namei.c | 36 static int minix_mknod(struct user_namespace *mnt_userns, struct inode *dir, in minix_mknod() argument 55 static int minix_tmpfile(struct user_namespace *mnt_userns, struct inode *dir, in minix_tmpfile() argument 68 static int minix_create(struct user_namespace *mnt_userns, struct inode *dir, in minix_create() argument 71 return minix_mknod(mnt_userns, dir, dentry, mode, 0); in minix_create() 74 static int minix_symlink(struct user_namespace *mnt_userns, struct inode *dir, in minix_symlink() argument 114 static int minix_mkdir(struct user_namespace *mnt_userns, struct inode *dir, in minix_mkdir() argument 187 static int minix_rename(struct user_namespace *mnt_userns, in minix_rename() argument
|
/linux-6.1.9/fs/f2fs/ |
D | namei.c | 179 static struct inode *f2fs_new_inode(struct user_namespace *mnt_userns, in f2fs_new_inode() argument 202 inode_init_owner(mnt_userns, inode, dir, mode); in f2fs_new_inode() 223 F2FS_I(inode)->i_projid = make_kprojid(mnt_userns, in f2fs_new_inode() 337 static int f2fs_create(struct user_namespace *mnt_userns, struct inode *dir, in f2fs_create() argument 354 inode = f2fs_new_inode(mnt_userns, dir, mode, dentry->d_name.name); in f2fs_create() 666 static int f2fs_symlink(struct user_namespace *mnt_userns, struct inode *dir, in f2fs_symlink() argument 689 inode = f2fs_new_inode(mnt_userns, dir, S_IFLNK | S_IRWXUGO, NULL); in f2fs_symlink() 746 static int f2fs_mkdir(struct user_namespace *mnt_userns, struct inode *dir, in f2fs_mkdir() argument 760 inode = f2fs_new_inode(mnt_userns, dir, S_IFDIR | mode, NULL); in f2fs_mkdir() 801 static int f2fs_mknod(struct user_namespace *mnt_userns, struct inode *dir, in f2fs_mknod() argument [all …]
|
D | acl.c | 207 static int f2fs_acl_update_mode(struct user_namespace *mnt_userns, in f2fs_acl_update_mode() argument 222 if (!vfsgid_in_group_p(i_gid_into_vfsgid(mnt_userns, inode)) && in f2fs_acl_update_mode() 223 !capable_wrt_inode_uidgid(mnt_userns, inode, CAP_FSETID)) in f2fs_acl_update_mode() 229 static int __f2fs_set_acl(struct user_namespace *mnt_userns, in __f2fs_set_acl() argument 243 error = f2fs_acl_update_mode(mnt_userns, inode, in __f2fs_set_acl() 279 int f2fs_set_acl(struct user_namespace *mnt_userns, struct inode *inode, in f2fs_set_acl() argument 285 return __f2fs_set_acl(mnt_userns, inode, type, acl, NULL); in f2fs_set_acl()
|
/linux-6.1.9/fs/fat/ |
D | file.c | 398 int fat_getattr(struct user_namespace *mnt_userns, const struct path *path, in fat_getattr() argument 404 generic_fillattr(mnt_userns, inode, stat); in fat_getattr() 459 static int fat_allow_set_time(struct user_namespace *mnt_userns, in fat_allow_set_time() argument 464 if (!vfsuid_eq_kuid(i_uid_into_vfsuid(mnt_userns, inode), in fat_allow_set_time() 466 if (vfsgid_in_group_p(i_gid_into_vfsgid(mnt_userns, inode))) in fat_allow_set_time() 480 int fat_setattr(struct user_namespace *mnt_userns, struct dentry *dentry, in fat_setattr() argument 491 if (fat_allow_set_time(mnt_userns, sbi, inode)) in fat_setattr() 495 error = setattr_prepare(mnt_userns, dentry, attr); in fat_setattr() 521 (!uid_eq(from_vfsuid(mnt_userns, i_user_ns(inode), attr->ia_vfsuid), in fat_setattr() 524 (!gid_eq(from_vfsgid(mnt_userns, i_user_ns(inode), attr->ia_vfsgid), in fat_setattr() [all …]
|
/linux-6.1.9/security/ |
D | commoncap.c | 321 int cap_inode_killpriv(struct user_namespace *mnt_userns, struct dentry *dentry) in cap_inode_killpriv() argument 325 error = __vfs_removexattr(mnt_userns, dentry, XATTR_NAME_CAPS); in cap_inode_killpriv() 378 int cap_inode_getsecurity(struct user_namespace *mnt_userns, in cap_inode_getsecurity() argument 400 ret = (int)vfs_getxattr_alloc(mnt_userns, dentry, XATTR_NAME_CAPS, in cap_inode_getsecurity() 424 kroot = mapped_kuid_fs(mnt_userns, fs_ns, kroot); in cap_inode_getsecurity() 504 struct user_namespace *mnt_userns, in rootid_from_xattr() argument 515 return mapped_kuid_user(mnt_userns, fs_userns, rootkid); in rootid_from_xattr() 542 int cap_convert_nscap(struct user_namespace *mnt_userns, struct dentry *dentry, in cap_convert_nscap() argument 559 if (!capable_wrt_inode_uidgid(mnt_userns, inode, CAP_SETFCAP)) in cap_convert_nscap() 561 if (size == XATTR_CAPS_SZ_2 && (mnt_userns == fs_ns)) in cap_convert_nscap() [all …]
|
/linux-6.1.9/fs/ocfs2/ |
D | file.h | 52 int ocfs2_setattr(struct user_namespace *mnt_userns, struct dentry *dentry, 54 int ocfs2_getattr(struct user_namespace *mnt_userns, const struct path *path, 56 int ocfs2_permission(struct user_namespace *mnt_userns,
|
/linux-6.1.9/fs/ksmbd/ |
D | smbacl.h | 214 static inline uid_t posix_acl_uid_translate(struct user_namespace *mnt_userns, in posix_acl_uid_translate() argument 220 vfsuid = make_vfsuid(mnt_userns, &init_user_ns, pace->e_uid); in posix_acl_uid_translate() 226 static inline gid_t posix_acl_gid_translate(struct user_namespace *mnt_userns, in posix_acl_gid_translate() argument 232 vfsgid = make_vfsgid(mnt_userns, &init_user_ns, pace->e_gid); in posix_acl_gid_translate()
|
/linux-6.1.9/fs/ramfs/ |
D | inode.c | 98 ramfs_mknod(struct user_namespace *mnt_userns, struct inode *dir, in ramfs_mknod() argument 113 static int ramfs_mkdir(struct user_namespace *mnt_userns, struct inode *dir, in ramfs_mkdir() argument 122 static int ramfs_create(struct user_namespace *mnt_userns, struct inode *dir, in ramfs_create() argument 128 static int ramfs_symlink(struct user_namespace *mnt_userns, struct inode *dir, in ramfs_symlink() argument 148 static int ramfs_tmpfile(struct user_namespace *mnt_userns, in ramfs_tmpfile() argument
|
/linux-6.1.9/fs/sysv/ |
D | namei.c | 44 static int sysv_mknod(struct user_namespace *mnt_userns, struct inode *dir, in sysv_mknod() argument 64 static int sysv_create(struct user_namespace *mnt_userns, struct inode *dir, in sysv_create() argument 70 static int sysv_symlink(struct user_namespace *mnt_userns, struct inode *dir, in sysv_symlink() argument 113 static int sysv_mkdir(struct user_namespace *mnt_userns, struct inode *dir, in sysv_mkdir() argument 192 static int sysv_rename(struct user_namespace *mnt_userns, struct inode *old_dir, in sysv_rename() argument
|
/linux-6.1.9/fs/kernfs/ |
D | kernfs-internal.h | 130 int kernfs_iop_permission(struct user_namespace *mnt_userns, 132 int kernfs_iop_setattr(struct user_namespace *mnt_userns, struct dentry *dentry, 134 int kernfs_iop_getattr(struct user_namespace *mnt_userns,
|