Linux XFS filesystem development
 help / color / mirror / Atom feed
* [PATCH] xfs: Sanity check flags of Q_XQUOTARM call
@ 2019-10-23 10:37 Jan Kara
  2019-10-23 13:09 ` Eric Sandeen
  2019-10-28 16:33 ` Darrick J. Wong
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Kara @ 2019-10-23 10:37 UTC (permalink / raw)
  To: linux-xfs; +Cc: Darrick J. Wong, Yang Xu, Eric Sandeen, Jan Kara

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>
---
 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.


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)
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-28 16:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-23 10:37 [PATCH] xfs: Sanity check flags of Q_XQUOTARM call Jan Kara
2019-10-23 13:09 ` Eric Sandeen
2019-10-28 16:33 ` Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox