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.
_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/containers



[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux