Commit 8723d5ba authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Darrick J. Wong

xfs: also reject BULKSTAT_SINGLE in a mount user namespace

BULKSTAT_SINGLE exposed the ondisk uids/gids just like bulkstat, and can
be called on any inode, including ones not visible in the current mount.

Fixes: f736d93d ("xfs: support idmapped mounts")
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
parent 08a20438
......@@ -168,6 +168,12 @@ xfs_bulkstat_one(
};
int error;
if (breq->mnt_userns != &init_user_ns) {
xfs_warn_ratelimited(breq->mp,
"bulkstat not supported inside of idmapped mounts.");
return -EINVAL;
}
ASSERT(breq->icount == 1);
bc.buf = kmem_zalloc(sizeof(struct xfs_bulkstat),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment