diff options
author | Jan Kara <jack@suse.cz> | 2019-10-23 17:00:45 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-27 14:49:51 +0100 |
commit | 2708c4cd3af776ae52dcbf51e6eb59634b01d137 (patch) | |
tree | 261604aaa291417c89433d3f04653f6157541315 /fs/xfs | |
parent | 0a19f053484ec66454f39ead0e77235541343a01 (diff) | |
download | linux-stable-2708c4cd3af776ae52dcbf51e6eb59634b01d137.tar.gz linux-stable-2708c4cd3af776ae52dcbf51e6eb59634b01d137.tar.bz2 linux-stable-2708c4cd3af776ae52dcbf51e6eb59634b01d137.zip |
xfs: Sanity check flags of Q_XQUOTARM call
commit 3dd4d40b420846dd35869ccc8f8627feef2cff32 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/xfs_quotaops.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/xfs/xfs_quotaops.c b/fs/xfs/xfs_quotaops.c index a7c0c657dfaf..13ca7c16bfc7 100644 --- a/fs/xfs/xfs_quotaops.c +++ b/fs/xfs/xfs_quotaops.c @@ -202,6 +202,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) |