summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_quotaops.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2019-10-24 03:00:45 +0300
committerDarrick J. Wong <darrick.wong@oracle.com>2019-10-24 18:05:24 +0300
commit3dd4d40b420846dd35869ccc8f8627feef2cff32 (patch)
tree2b21c851747494281c0f6c3100678d54992f58f7 /fs/xfs/xfs_quotaops.c
parent1aa6300638e74c15bca3e1f94e04c64eafe81f27 (diff)
downloadlinux-3dd4d40b420846dd35869ccc8f8627feef2cff32.tar.xz
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 <xuyang2018.jy@cn.fujitsu.com> Signed-off-by: Jan Kara <jack@suse.cz> Reviewed-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/xfs_quotaops.c')
-rw-r--r--fs/xfs/xfs_quotaops.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/xfs/xfs_quotaops.c b/fs/xfs/xfs_quotaops.c
index cd6c7210a373..c7de17deeae6 100644
--- a/fs/xfs/xfs_quotaops.c
+++ b/fs/xfs/xfs_quotaops.c
@@ -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)