xfs: Sanity check flags of Q_XQUOTARM call
PATCH 1/1 xfs: Sanity check flags of Q_XQUOTARM call
Flags passed to Q_XQUOTARM were not sanity checked for invalid values. Fix that.
Fixes 9da93f9b7cdf ("xfs: fix Q_XQUOTARM ioctl")
Reported-by Yang Xu <[email protected]>
Signed-off-by Jan Kara <[email protected]>
--- fs/xfs/xfs_quotaops.c | 3 +++ 1 file changed, 3 insertions(+)
Strictly speaking this may cause user visible regression (invalid flags are no longer getting ignored) but in this particular case I think we could get away with it.
fs/xfs/xfs_quotaops.c +3 -0
@@ -201,6 +201,9 @@ xfs_fs_rm_xquota(if (XFS_IS_QUOTA_ON (mp))return -EINVAL ; +if (uflags & ~(FS_USER_QUOTA |FS_GROUP_QUOTA |FS_PROJ_QUOTA )) +return -EINVAL ; +if (uflags &FS_USER_QUOTA ) flags |=XFS_DQ_USER ;if (uflags &FS_GROUP_QUOTA )
Signature · 1 line
2.16.4
Quoted 6 lines · Jan Kara
Flags passed to
Q_XQUOTARMwere not sanity checked for invalid values. Fix that.Fixes 9da93f9b7cdf ("xfs: fix Q_XQUOTARM ioctl")Reported-by Yang Xu <[email protected]>Signed-off-by Jan Kara <[email protected]>
Whoops, yep good call.
Reviewed-by Eric Sandeen <[email protected]>
Quoted 6 lines · Jan Kara
Flags passed to
Q_XQUOTARMwere not sanity checked for invalid values. Fix that.Fixes 9da93f9b7cdf ("xfs: fix Q_XQUOTARM ioctl")Reported-by Yang Xu <[email protected]>Signed-off-by Jan Kara <[email protected]>
Looks ok,
Reviewed-by Darrick J. Wong <[email protected]>
--D
Quoted 26 lines
--- fs/xfs/xfs_quotaops.c | 3 +++ 1 file changed, 3 insertions(+)Strictly speaking this may cause user visible regression (invalid flags are no longer getting ignored) but in this particular case I think we could get away with it.
fs/xfs/xfs_quotaops.c +3
-0@@ -201,6 +201,9 @@ xfs_fs_rm_xquota(if (XFS_IS_QUOTA_ON (mp))return -EINVAL ; +if (uflags & ~(FS_USER_QUOTA |FS_GROUP_QUOTA |FS_PROJ_QUOTA )) +return -EINVAL ; +if (uflags &FS_USER_QUOTA ) flags |=XFS_DQ_USER ;if (uflags &FS_GROUP_QUOTA )Signature · 1 line
2.16.4