Re: [PATCH v3 04/38] fs: add mount_setattr()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 02, 2020 at 10:42:18AM +0100, Christian Brauner wrote:
> > > +	if (upper_32_bits(attr->attr_set))
> > > +		return -EINVAL;
> > > +	if (build_attr_flags(lower_32_bits(attr->attr_set), &kattr->attr_set))
> > > +		return -EINVAL;
> > > +
> > > +	if (upper_32_bits(attr->attr_clr))
> > > +		return -EINVAL;
> > > +	if (build_attr_flags(lower_32_bits(attr->attr_clr), &kattr->attr_clr))
> > > +		return -EINVAL;
> > 
> > What is so magic about the upper and lower 32 bits?
> 
> Nothing apart from the fact that they arent't currently valid. I can
> think about reworking these lines. Or do you already have a preferred
> way of doing this in mind?

Just turn the attr_flags argument to build_attr_flags into a u64 and
the first sanity check there will catch all invalid flags, no matter
where they are places.  That should also generate more efficient code.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux Kernel Hardening]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux