stat: handle idmapped mounts
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 21 Jan 2021 13:19:30 +0000 (14:19 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sun, 24 Jan 2021 13:27:17 +0000 (14:27 +0100)
The generic_fillattr() helper fills in the basic attributes associated
with an inode. Enable it to handle idmapped mounts. If the inode is
accessed through an idmapped mount map it into the mount's user
namespace before we store the uid and gid. If the initial user namespace
is passed nothing changes so non-idmapped mounts will see identical
behavior as before.

Link: https://lore.kernel.org/r/20210121131959.646623-12-christian.brauner@ubuntu.com
Cc: Christoph Hellwig <hch@lst.de>
Cc: David Howells <dhowells@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: James Morris <jamorris@linux.microsoft.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
36 files changed:
fs/9p/vfs_inode.c
fs/9p/vfs_inode_dotl.c
fs/afs/inode.c
fs/btrfs/inode.c
fs/ceph/inode.c
fs/cifs/inode.c
fs/coda/inode.c
fs/ecryptfs/inode.c
fs/erofs/inode.c
fs/exfat/file.c
fs/ext2/inode.c
fs/ext4/inode.c
fs/f2fs/file.c
fs/fat/file.c
fs/fuse/dir.c
fs/gfs2/inode.c
fs/hfsplus/inode.c
fs/kernfs/inode.c
fs/libfs.c
fs/minix/inode.c
fs/nfs/inode.c
fs/nfs/namespace.c
fs/ocfs2/file.c
fs/orangefs/inode.c
fs/proc/base.c
fs/proc/generic.c
fs/proc/proc_net.c
fs/proc/proc_sysctl.c
fs/proc/root.c
fs/stat.c
fs/sysv/itree.c
fs/ubifs/dir.c
fs/udf/symlink.c
fs/vboxsf/utils.c
include/linux/fs.h
mm/shmem.c

index 9c3ff6e9ab82b52623902a6b8d01039b39048bfb..c21b146c8d91ff108559e91f35cc012643350da1 100644 (file)
@@ -1027,7 +1027,7 @@ v9fs_vfs_getattr(const struct path *path, struct kstat *stat,
        p9_debug(P9_DEBUG_VFS, "dentry: %p\n", dentry);
        v9ses = v9fs_dentry2v9ses(dentry);
        if (v9ses->cache == CACHE_LOOSE || v9ses->cache == CACHE_FSCACHE) {
-               generic_fillattr(d_inode(dentry), stat);
+               generic_fillattr(&init_user_ns, d_inode(dentry), stat);
                return 0;
        }
        fid = v9fs_fid_lookup(dentry);
@@ -1040,7 +1040,7 @@ v9fs_vfs_getattr(const struct path *path, struct kstat *stat,
                return PTR_ERR(st);
 
        v9fs_stat2inode(st, d_inode(dentry), dentry->d_sb, 0);
-       generic_fillattr(d_inode(dentry), stat);
+       generic_fillattr(&init_user_ns, d_inode(dentry), stat);
 
        p9stat_free(st);
        kfree(st);
index 302553101fcbf3659b2694b3ddd3185dc4403e54..984f28315d2a0da8f2f4dc94160c4734efeecbd8 100644 (file)
@@ -468,7 +468,7 @@ v9fs_vfs_getattr_dotl(const struct path *path, struct kstat *stat,
        p9_debug(P9_DEBUG_VFS, "dentry: %p\n", dentry);
        v9ses = v9fs_dentry2v9ses(dentry);
        if (v9ses->cache == CACHE_LOOSE || v9ses->cache == CACHE_FSCACHE) {
-               generic_fillattr(d_inode(dentry), stat);
+               generic_fillattr(&init_user_ns, d_inode(dentry), stat);
                return 0;
        }
        fid = v9fs_fid_lookup(dentry);
@@ -485,7 +485,7 @@ v9fs_vfs_getattr_dotl(const struct path *path, struct kstat *stat,
                return PTR_ERR(st);
 
        v9fs_stat2inode_dotl(st, d_inode(dentry), 0);
-       generic_fillattr(d_inode(dentry), stat);
+       generic_fillattr(&init_user_ns, d_inode(dentry), stat);
        /* Change block size to what the server returned */
        stat->blksize = st->st_blksize;
 
index b0d7b892090da8ae5cb771fd57b52b994aa98dc4..795ee5cb38175992b00b5d51ef7cebf2aba4fb37 100644 (file)
@@ -745,7 +745,7 @@ int afs_getattr(const struct path *path, struct kstat *stat,
 
        do {
                read_seqbegin_or_lock(&vnode->cb_lock, &seq);
-               generic_fillattr(inode, stat);
+               generic_fillattr(&init_user_ns, inode, stat);
                if (test_bit(AFS_VNODE_SILLY_DELETED, &vnode->flags) &&
                    stat->nlink > 0)
                        stat->nlink -= 1;
index 6c18fb1a25afc2dd7ee8bcb5d78edfa90b54d128..a63faed171de99c60eb834d25bafd2e593f5c9d2 100644 (file)
@@ -8842,7 +8842,7 @@ static int btrfs_getattr(const struct path *path, struct kstat *stat,
                                  STATX_ATTR_IMMUTABLE |
                                  STATX_ATTR_NODUMP);
 
-       generic_fillattr(inode, stat);
+       generic_fillattr(&init_user_ns, inode, stat);
        stat->dev = BTRFS_I(inode)->root->anon_dev;
 
        spin_lock(&BTRFS_I(inode)->lock);
index 145e26a4ddbb46d97d751158b95b755e92673fd6..179a2bb88538b240b3aa007b4df9347a28c219e0 100644 (file)
@@ -2385,7 +2385,7 @@ int ceph_getattr(const struct path *path, struct kstat *stat,
                        return err;
        }
 
-       generic_fillattr(inode, stat);
+       generic_fillattr(&init_user_ns, inode, stat);
        stat->ino = ceph_present_inode(inode);
 
        /*
index 27554f71f744cb679ba2406cbba6729882649328..374abce7efaf65e1b7a9a8b8989e724b3afa8f8c 100644 (file)
@@ -2408,7 +2408,7 @@ int cifs_getattr(const struct path *path, struct kstat *stat,
                        return rc;
        }
 
-       generic_fillattr(inode, stat);
+       generic_fillattr(&init_user_ns, inode, stat);
        stat->blksize = cifs_sb->ctx->bsize;
        stat->ino = CIFS_I(inode)->uniqueid;
 
index b1c70e2b9b1e6e7bdebd993708931e4ec22ace74..4d113e191cb82d18622085914082e3572a133960 100644 (file)
@@ -256,7 +256,7 @@ int coda_getattr(const struct path *path, struct kstat *stat,
 {
        int err = coda_revalidate_inode(d_inode(path->dentry));
        if (!err)
-               generic_fillattr(d_inode(path->dentry), stat);
+               generic_fillattr(&init_user_ns, d_inode(path->dentry), stat);
        return err;
 }
 
index b9ccc4085d460d843c776a633aa561da9404516c..385b5e8741c0c47a4b9e7d0cef6ec641362518b0 100644 (file)
@@ -977,7 +977,7 @@ static int ecryptfs_getattr_link(const struct path *path, struct kstat *stat,
 
        mount_crypt_stat = &ecryptfs_superblock_to_private(
                                                dentry->d_sb)->mount_crypt_stat;
-       generic_fillattr(d_inode(dentry), stat);
+       generic_fillattr(&init_user_ns, d_inode(dentry), stat);
        if (mount_crypt_stat->flags & ECRYPTFS_GLOBAL_ENCRYPT_FILENAMES) {
                char *target;
                size_t targetsiz;
@@ -1005,7 +1005,7 @@ static int ecryptfs_getattr(const struct path *path, struct kstat *stat,
        if (!rc) {
                fsstack_copy_attr_all(d_inode(dentry),
                                      ecryptfs_inode_to_lower(d_inode(dentry)));
-               generic_fillattr(d_inode(dentry), stat);
+               generic_fillattr(&init_user_ns, d_inode(dentry), stat);
                stat->blocks = lower_stat.blocks;
        }
        return rc;
index 3e21c0e8adae73aa75e02af892ad5b30ecfa0c1e..083818063ac62b0c0abc2a10b9a7dc14cd33bf99 100644 (file)
@@ -343,7 +343,7 @@ int erofs_getattr(const struct path *path, struct kstat *stat,
        stat->attributes_mask |= (STATX_ATTR_COMPRESSED |
                                  STATX_ATTR_IMMUTABLE);
 
-       generic_fillattr(inode, stat);
+       generic_fillattr(&init_user_ns, inode, stat);
        return 0;
 }
 
index ace35aa8e64b7f416f26cfa194253d27389dfc7f..e9705b3295d31def9c56d86955da9ef359fd9567 100644 (file)
@@ -273,7 +273,7 @@ int exfat_getattr(const struct path *path, struct kstat *stat,
        struct inode *inode = d_backing_inode(path->dentry);
        struct exfat_inode_info *ei = EXFAT_I(inode);
 
-       generic_fillattr(inode, stat);
+       generic_fillattr(&init_user_ns, inode, stat);
        exfat_truncate_atime(&stat->atime);
        stat->result_mask |= STATX_BTIME;
        stat->btime.tv_sec = ei->i_crtime.tv_sec;
index 9de813635d8dcb239f97c4a0cf5cb02e5952559a..3d8acafca8cec4bc73922d3b644de36b6d650669 100644 (file)
@@ -1660,7 +1660,7 @@ int ext2_getattr(const struct path *path, struct kstat *stat,
                        STATX_ATTR_IMMUTABLE |
                        STATX_ATTR_NODUMP);
 
-       generic_fillattr(inode, stat);
+       generic_fillattr(&init_user_ns, inode, stat);
        return 0;
 }
 
index 24ea5851e90aed9d68d0f3c1562058551f65009a..3a303d3f8423f6f185e4342bf9862ba35af0ca33 100644 (file)
@@ -5571,7 +5571,7 @@ int ext4_getattr(const struct path *path, struct kstat *stat,
                                  STATX_ATTR_NODUMP |
                                  STATX_ATTR_VERITY);
 
-       generic_fillattr(inode, stat);
+       generic_fillattr(&init_user_ns, inode, stat);
        return 0;
 }
 
index 6ccdfe0606d9e61a57fc04c39989217cbe561b37..44cd0dbdbb5dfbce9d9a4342be8ad4df43b68761 100644 (file)
@@ -820,7 +820,7 @@ int f2fs_getattr(const struct path *path, struct kstat *stat,
                                  STATX_ATTR_NODUMP |
                                  STATX_ATTR_VERITY);
 
-       generic_fillattr(inode, stat);
+       generic_fillattr(&init_user_ns, inode, stat);
 
        /* we need to show initial sectors used for inline_data/dentries */
        if ((S_ISREG(inode->i_mode) && f2fs_has_inline_data(inode)) ||
index 805b501467e9f75e3c5eda70a50af7b9b5f3f53b..f7e04f533d31c8fd7c7809fdfa2886a3634a30c5 100644 (file)
@@ -398,7 +398,7 @@ int fat_getattr(const struct path *path, struct kstat *stat,
                u32 request_mask, unsigned int flags)
 {
        struct inode *inode = d_inode(path->dentry);
-       generic_fillattr(inode, stat);
+       generic_fillattr(&init_user_ns, inode, stat);
        stat->blksize = MSDOS_SB(inode->i_sb)->cluster_size;
 
        if (MSDOS_SB(inode->i_sb)->options.nfs == FAT_NFS_NOSTALE_RO) {
index 74fdb6a7ebb305e252d3d0e5bd1235ee2b109ff5..d2e318ed9b260a78adbf7c84f900f51e7e8896e5 100644 (file)
@@ -1087,7 +1087,7 @@ static int fuse_update_get_attr(struct inode *inode, struct file *file,
                forget_all_cached_acls(inode);
                err = fuse_do_getattr(inode, stat, file);
        } else if (stat) {
-               generic_fillattr(inode, stat);
+               generic_fillattr(&init_user_ns, inode, stat);
                stat->mode = fi->orig_i_mode;
                stat->ino = fi->orig_ino;
        }
index 728405d15a05389982f9d147d3b425a080c8a33a..226b5b1dc1fa6e517c4cc7ab6d04851026b4f08c 100644 (file)
@@ -2050,7 +2050,7 @@ static int gfs2_getattr(const struct path *path, struct kstat *stat,
                                  STATX_ATTR_IMMUTABLE |
                                  STATX_ATTR_NODUMP);
 
-       generic_fillattr(inode, stat);
+       generic_fillattr(&init_user_ns, inode, stat);
 
        if (gfs2_holder_initialized(&gh))
                gfs2_glock_dq_uninit(&gh);
index ffa137f8234eda94f614f7abcf674bd8076e25db..642e067d8fe8a11bbabc4b49b576569e6696557d 100644 (file)
@@ -286,7 +286,7 @@ int hfsplus_getattr(const struct path *path, struct kstat *stat,
        stat->attributes_mask |= STATX_ATTR_APPEND | STATX_ATTR_IMMUTABLE |
                                 STATX_ATTR_NODUMP;
 
-       generic_fillattr(inode, stat);
+       generic_fillattr(&init_user_ns, inode, stat);
        return 0;
 }
 
index 7e44052b42e16fe39a6183cd594740f117dbfe7f..032d3d7546d84c4de9d93ca7f713ffa4d55c0fc2 100644 (file)
@@ -193,7 +193,7 @@ int kernfs_iop_getattr(const struct path *path, struct kstat *stat,
        kernfs_refresh_inode(kn, inode);
        mutex_unlock(&kernfs_mutex);
 
-       generic_fillattr(inode, stat);
+       generic_fillattr(&init_user_ns, inode, stat);
        return 0;
 }
 
index a73fe109403cbc2c979e951a2682eeaa81dc345e..508e9ea8e6f3b98f4b93fc7a714215f90155813b 100644 (file)
@@ -31,7 +31,7 @@ int simple_getattr(const struct path *path, struct kstat *stat,
                   u32 request_mask, unsigned int query_flags)
 {
        struct inode *inode = d_inode(path->dentry);
-       generic_fillattr(inode, stat);
+       generic_fillattr(&init_user_ns, inode, stat);
        stat->blocks = inode->i_mapping->nrpages << (PAGE_SHIFT - 9);
        return 0;
 }
@@ -1304,7 +1304,7 @@ static int empty_dir_getattr(const struct path *path, struct kstat *stat,
                             u32 request_mask, unsigned int query_flags)
 {
        struct inode *inode = d_inode(path->dentry);
-       generic_fillattr(inode, stat);
+       generic_fillattr(&init_user_ns, inode, stat);
        return 0;
 }
 
index 34f546404aa11385388f140c7a7a22d345f5fc31..91c81d2fc90db23723690492529230fdc3fc08a9 100644 (file)
@@ -658,7 +658,7 @@ int minix_getattr(const struct path *path, struct kstat *stat,
        struct super_block *sb = path->dentry->d_sb;
        struct inode *inode = d_inode(path->dentry);
 
-       generic_fillattr(inode, stat);
+       generic_fillattr(&init_user_ns, inode, stat);
        if (INODE_VERSION(inode) == MINIX_V1)
                stat->blocks = (BLOCK_SIZE / 512) * V1_minix_blocks(stat->size, sb);
        else
index 522aa10a1a3e7cfe64f07f79786c55bd6a35d84a..cab123ec1664a1b80079e9f0a213f94a63f43d0c 100644 (file)
@@ -857,7 +857,7 @@ out_no_revalidate:
        /* Only return attributes that were revalidated. */
        stat->result_mask &= request_mask;
 out_no_update:
-       generic_fillattr(inode, stat);
+       generic_fillattr(&init_user_ns, inode, stat);
        stat->ino = nfs_compat_user_ino64(NFS_FILEID(inode));
        if (S_ISDIR(inode->i_mode))
                stat->blksize = NFS_SERVER(inode)->dtsize;
index 2bcbe38afe2e723be4b434b81f4405fa4fdad3ff..55fc711e368b06f2ba6bfbfabe0ceaf5d0265620 100644 (file)
@@ -213,7 +213,7 @@ nfs_namespace_getattr(const struct path *path, struct kstat *stat,
 {
        if (NFS_FH(d_inode(path->dentry))->size != 0)
                return nfs_getattr(path, stat, request_mask, query_flags);
-       generic_fillattr(d_inode(path->dentry), stat);
+       generic_fillattr(&init_user_ns, d_inode(path->dentry), stat);
        return 0;
 }
 
index cabf355b148ff19e893c8afefe25bc2a2f1bb173..a070d4c9b6ed3501fba0441ca958dfc21c5a80df 100644 (file)
@@ -1313,7 +1313,7 @@ int ocfs2_getattr(const struct path *path, struct kstat *stat,
                goto bail;
        }
 
-       generic_fillattr(inode, stat);
+       generic_fillattr(&init_user_ns, inode, stat);
        /*
         * If there is inline data in the inode, the inode will normally not
         * have data blocks allocated (it may have an external xattr block).
index 563fe9ab8eb2186e13a8f864b84c3fba1ccd4319..b94032f77e6146ce52c80af91edf95f803259c16 100644 (file)
@@ -903,7 +903,7 @@ int orangefs_getattr(const struct path *path, struct kstat *stat,
        ret = orangefs_inode_getattr(inode,
            request_mask & STATX_SIZE ? ORANGEFS_GETATTR_SIZE : 0);
        if (ret == 0) {
-               generic_fillattr(inode, stat);
+               generic_fillattr(&init_user_ns, inode, stat);
 
                /* override block size reported to stat */
                if (!(request_mask & STATX_SIZE))
index bb4e63a3684f7fe0c4cbddcc8d6896cd1db332f0..d45aa68c1f17c3e352489656636cea9ec26ce316 100644 (file)
@@ -1934,7 +1934,7 @@ int pid_getattr(const struct path *path, struct kstat *stat,
        struct proc_fs_info *fs_info = proc_sb_info(inode->i_sb);
        struct task_struct *task;
 
-       generic_fillattr(inode, stat);
+       generic_fillattr(&init_user_ns, inode, stat);
 
        stat->uid = GLOBAL_ROOT_UID;
        stat->gid = GLOBAL_ROOT_GID;
@@ -3803,7 +3803,7 @@ static int proc_task_getattr(const struct path *path, struct kstat *stat,
 {
        struct inode *inode = d_inode(path->dentry);
        struct task_struct *p = get_proc_task(inode);
-       generic_fillattr(inode, stat);
+       generic_fillattr(&init_user_ns, inode, stat);
 
        if (p) {
                stat->nlink += get_nr_threads(p);
index 6d4fabab8aa7db9ba909ff6418d68d00c57ffb8c..0db96a7611493f89351aef5b23b43d378968dd1a 100644 (file)
@@ -145,7 +145,7 @@ static int proc_getattr(const struct path *path, struct kstat *stat,
                }
        }
 
-       generic_fillattr(inode, stat);
+       generic_fillattr(&init_user_ns, inode, stat);
        return 0;
 }
 
index 18601042af998882f656ab7968efcd0bd85ed912..4aef49ccf571254d80363a119d4bf82f94847002 100644 (file)
@@ -297,7 +297,7 @@ static int proc_tgid_net_getattr(const struct path *path, struct kstat *stat,
 
        net = get_proc_task_net(inode);
 
-       generic_fillattr(inode, stat);
+       generic_fillattr(&init_user_ns, inode, stat);
 
        if (net != NULL) {
                stat->nlink = net->proc_net->nlink;
index ec67dbc1f7058fac0b47c387d42158d029ed7cb2..87c8283481400ef19441e143d2435a93a2476051 100644 (file)
@@ -840,7 +840,7 @@ static int proc_sys_getattr(const struct path *path, struct kstat *stat,
        if (IS_ERR(head))
                return PTR_ERR(head);
 
-       generic_fillattr(inode, stat);
+       generic_fillattr(&init_user_ns, inode, stat);
        if (table)
                stat->mode = (stat->mode & S_IFMT) | table->mode;
 
index 5e444d4f9717fb32ca43900d7d5824f998ef9b0a..244e4b6f15ef82d8f0f12ada69396f5570b0fed8 100644 (file)
@@ -311,7 +311,7 @@ void __init proc_root_init(void)
 static int proc_root_getattr(const struct path *path, struct kstat *stat,
                             u32 request_mask, unsigned int query_flags)
 {
-       generic_fillattr(d_inode(path->dentry), stat);
+       generic_fillattr(&init_user_ns, d_inode(path->dentry), stat);
        stat->nlink = proc_root.nlink + nr_processes();
        return 0;
 }
index dacecdda2e7967b53160a0008d6a63fc733095d8..2c471c2fd766ac47c8417bd244e7b0c5b69ef1aa 100644 (file)
--- a/fs/stat.c
+++ b/fs/stat.c
 
 /**
  * generic_fillattr - Fill in the basic attributes from the inode struct
- * @inode: Inode to use as the source
- * @stat: Where to fill in the attributes
+ * @mnt_userns:        user namespace of the mount the inode was found from
+ * @inode:     Inode to use as the source
+ * @stat:      Where to fill in the attributes
  *
  * Fill in the basic attributes in the kstat structure from data that's to be
  * found on the VFS inode structure.  This is the default if no getattr inode
  * operation is supplied.
+ *
+ * If the inode has been found through an idmapped mount the user namespace of
+ * the vfsmount must be passed through @mnt_userns. This function will then
+ * take care to map the inode according to @mnt_userns before filling in the
+ * uid and gid filds. On non-idmapped mounts or if permission checking is to be
+ * performed on the raw inode simply passs init_user_ns.
  */
-void generic_fillattr(struct inode *inode, struct kstat *stat)
+void generic_fillattr(struct user_namespace *mnt_userns, struct inode *inode,
+                     struct kstat *stat)
 {
        stat->dev = inode->i_sb->s_dev;
        stat->ino = inode->i_ino;
        stat->mode = inode->i_mode;
        stat->nlink = inode->i_nlink;
-       stat->uid = inode->i_uid;
-       stat->gid = inode->i_gid;
+       stat->uid = i_uid_into_mnt(mnt_userns, inode);
+       stat->gid = i_gid_into_mnt(mnt_userns, inode);
        stat->rdev = inode->i_rdev;
        stat->size = i_size_read(inode);
        stat->atime = inode->i_atime;
@@ -87,7 +95,7 @@ int vfs_getattr_nosec(const struct path *path, struct kstat *stat,
                return inode->i_op->getattr(path, stat, request_mask,
                                            query_flags);
 
-       generic_fillattr(inode, stat);
+       generic_fillattr(mnt_user_ns(path->mnt), inode, stat);
        return 0;
 }
 EXPORT_SYMBOL(vfs_getattr_nosec);
index bcb67b0cabe7e5b99561610106fe383066925d9e..83cffab6955f28e33c799e50a3f9a4583d9d5ad0 100644 (file)
@@ -445,7 +445,7 @@ int sysv_getattr(const struct path *path, struct kstat *stat,
                 u32 request_mask, unsigned int flags)
 {
        struct super_block *s = path->dentry->d_sb;
-       generic_fillattr(d_inode(path->dentry), stat);
+       generic_fillattr(&init_user_ns, d_inode(path->dentry), stat);
        stat->blocks = (s->s_blocksize / 512) * sysv_nblocks(s, stat->size);
        stat->blksize = s->s_blocksize;
        return 0;
index 694e7714545bc7c35417bc06221248b0b26ab658..a8881ed6162012199dbd521e232ae85938c490cf 100644 (file)
@@ -1589,7 +1589,7 @@ int ubifs_getattr(const struct path *path, struct kstat *stat,
                                STATX_ATTR_ENCRYPTED |
                                STATX_ATTR_IMMUTABLE);
 
-       generic_fillattr(inode, stat);
+       generic_fillattr(&init_user_ns, inode, stat);
        stat->blksize = UBIFS_BLOCK_SIZE;
        stat->size = ui->ui_size;
 
index c973db239604fb46b7f8bf8e525c4af93fd836cb..54a44d1f023c667131e401d18c0aa0d34125f296 100644 (file)
@@ -159,7 +159,7 @@ static int udf_symlink_getattr(const struct path *path, struct kstat *stat,
        struct inode *inode = d_backing_inode(dentry);
        struct page *page;
 
-       generic_fillattr(inode, stat);
+       generic_fillattr(&init_user_ns, inode, stat);
        page = read_mapping_page(inode->i_mapping, 0, NULL);
        if (IS_ERR(page))
                return PTR_ERR(page);
index 01805754606711d17c54311f91c11087b03fb4dd..d2cd1c99f48ef537b29f87d8c30b25c423bce53c 100644 (file)
@@ -233,7 +233,7 @@ int vboxsf_getattr(const struct path *path, struct kstat *kstat,
        if (err)
                return err;
 
-       generic_fillattr(d_inode(dentry), kstat);
+       generic_fillattr(&init_user_ns, d_inode(dentry), kstat);
        return 0;
 }
 
index e3ea1d7c336749adf998b66843e6c0c8e140783c..182641d8322f701a9f52f89eeecf4a879abaefc7 100644 (file)
@@ -3154,7 +3154,7 @@ extern int __page_symlink(struct inode *inode, const char *symname, int len,
 extern int page_symlink(struct inode *inode, const char *symname, int len);
 extern const struct inode_operations page_symlink_inode_operations;
 extern void kfree_link(void *);
-extern void generic_fillattr(struct inode *, struct kstat *);
+void generic_fillattr(struct user_namespace *, struct inode *, struct kstat *);
 extern int vfs_getattr_nosec(const struct path *, struct kstat *, u32, unsigned int);
 extern int vfs_getattr(const struct path *, struct kstat *, u32, unsigned int);
 void __inode_add_bytes(struct inode *inode, loff_t bytes);
index 23b8e9c15a4229ca4c0add778945ec708ffda936..339d5530d3a908ee8e21191d6fd2cbe10f2cfe3c 100644 (file)
@@ -1072,7 +1072,7 @@ static int shmem_getattr(const struct path *path, struct kstat *stat,
                shmem_recalc_inode(inode);
                spin_unlock_irq(&info->lock);
        }
-       generic_fillattr(inode, stat);
+       generic_fillattr(&init_user_ns, inode, stat);
 
        if (is_huge_enabled(sb_info))
                stat->blksize = HPAGE_PMD_SIZE;