Commit 84fd081f authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Darrick J. Wong
Browse files

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent 953aa9d1
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -462,6 +462,11 @@ xfs_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,
+5 −0
Original line number Diff line number Diff line
@@ -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,