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: f736d93d76 ("xfs: support idmapped mounts")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
This commit is contained in:
Christoph Hellwig 2021-03-14 10:59:39 -07:00 committed by Darrick J. Wong
parent 08a204387e
commit 8723d5ba8b

View file

@ -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),