xfs: also reject BULKSTAT_SINGLE in a mount user namespace
PATCH 1/1 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 <[email protected]>
--- fs/xfs/xfs_itable.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/xfs/xfs_itable.c +6 -0
@@ -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),
Signature · 1 line
2.30.1
Quoted 5 lines · Christoph Hellwig
BULKSTAT_SINGLEexposed 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 <[email protected]>
Looks good to me,
Reviewed-by Darrick J. Wong <[email protected]>
--D
Quoted 24 lines
--- fs/xfs/xfs_itable.c | 6 ++++++ 1 file changed, 6 insertions(+)fs/xfs/xfs_itable.c +6
-0@@ -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),Signature · 1 line
2.30.1