Skip to content

Commit

Permalink
xfs: also reject BULKSTAT_SINGLE in a mount user namespace
Browse files Browse the repository at this point in the history
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: f736d93 ("xfs: support idmapped mounts")
Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Darrick J. Wong <[email protected]>
Signed-off-by: Darrick J. Wong <[email protected]>
  • Loading branch information
Christoph Hellwig authored and Darrick J. Wong committed Mar 15, 2021
1 parent 08a2043 commit 8723d5b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fs/xfs/xfs_itable.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 8723d5b

Please sign in to comment.