Re: [PATCH 01/33] xfs: clear kernel only flags in XFS_IOC_ATTRMULTI_BY_HANDLE

Christoph Hellwig
2019-12-24T11:56:20Z

On Wed, Dec 18, 2019 at 01:26:08PM -0800, Darrick J. Wong wrote:
> > for (i = 0; i < am_hreq.opcount; i++) {
> > + ops[i].am_flags &= ATTR_KERNEL_FLAGS;
>
> The only flags we allow from userspace are the internal state flags?
> Is this supposed to be am_flags &= ~ATTR_KERNEL_FLAGS?

Yes. I switched back a few times between enumerating kernel only or
user flags and finally settled on this one. The sad part is that a full
xfstests run didn't catch this. In fact xfsprogs or xfstests seem to
have no direct calls to XFS_IOC_ATTRMULTI_BY_HANDLE and its two wrappers
in libhandle. xfsdump does, but probably not in a way that is exercises.