aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_ioctl32.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-01-07 15:25:38 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2020-01-09 10:55:18 -0800
commit84fd081f8ae92e05ace47d24e58f26f7af2994c7 (patch)
tree4d8e0e911e49fbaaa2d3db20e4ab4f5337e3d379 /fs/xfs/xfs_ioctl32.c
parentxfs: clear kernel only flags in XFS_IOC_ATTRMULTI_BY_HANDLE (diff)
downloadlinux-dev-84fd081f8ae92e05ace47d24e58f26f7af2994c7.tar.xz
linux-dev-84fd081f8ae92e05ace47d24e58f26f7af2994c7.zip
xfs: reject invalid flags combinations in XFS_IOC_ATTRMULTI_BY_HANDLE
While the flags field in the ABI and the on-disk format allows for multiple namespace flags, that is a logically invalid combination that scrub complains about. Reject it at the ioctl level, as all other interface already get this right at higher levels. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to '')
-rw-r--r--fs/xfs/xfs_ioctl32.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/xfs/xfs_ioctl32.c b/fs/xfs/xfs_ioctl32.c
index 20b3edc10f48..769581a79c58 100644
--- a/fs/xfs/xfs_ioctl32.c
+++ b/fs/xfs/xfs_ioctl32.c
@@ -450,6 +450,11 @@ xfs_compat_attrmulti_by_handle(
error = 0;
for (i = 0; i < am_hreq.opcount; i++) {
+ if ((ops[i].am_flags & ATTR_ROOT) &&
+ (ops[i].am_flags & ATTR_SECURE)) {
+ ops[i].am_error = -EINVAL;
+ continue;
+ }
ops[i].am_flags &= ~ATTR_KERNEL_FLAGS;
ops[i].am_error = strncpy_from_user((char *)attr_name,