diff options
author | Christoph Hellwig <hch@lst.de> | 2021-03-14 20:59:39 +0300 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2021-03-15 18:50:41 +0300 |
commit | 8723d5ba8bdae1c41be7a6fc8469dc9aa551e7d0 (patch) | |
tree | 36a6d36f96d6bced2ea52ef5c8f08239fa0090a8 /fs/xfs | |
parent | 08a204387e8063ba7375481281701137bd553dee (diff) | |
download | linux-8723d5ba8bdae1c41be7a6fc8469dc9aa551e7d0.tar.xz |
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: f736d93d76d3 ("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>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/xfs_itable.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index ca310a125d1e..3498b97fb06d 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c @@ -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), |