[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201202094751.GA6129@lst.de>
Date: Wed, 2 Dec 2020 10:47:51 +0100
From: Christoph Hellwig <hch@....de>
To: Christian Brauner <christian.brauner@...ntu.com>
Cc: Christoph Hellwig <hch@....de>,
Alexander Viro <viro@...iv.linux.org.uk>,
Christoph Hellwig <hch@...radead.org>,
linux-fsdevel@...r.kernel.org,
John Johansen <john.johansen@...onical.com>,
James Morris <jmorris@...ei.org>,
Mimi Zohar <zohar@...ux.ibm.com>,
Dmitry Kasatkin <dmitry.kasatkin@...il.com>,
Stephen Smalley <stephen.smalley.work@...il.com>,
Casey Schaufler <casey@...aufler-ca.com>,
Arnd Bergmann <arnd@...db.de>,
Andreas Dilger <adilger.kernel@...ger.ca>,
OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>,
Geoffrey Thomas <geofft@...reload.com>,
Mrunal Patel <mpatel@...hat.com>,
Josh Triplett <josh@...htriplett.org>,
Andy Lutomirski <luto@...nel.org>,
Theodore Tso <tytso@....edu>, Alban Crequy <alban@...volk.io>,
Tycho Andersen <tycho@...ho.ws>,
David Howells <dhowells@...hat.com>,
James Bottomley <James.Bottomley@...senpartnership.com>,
Seth Forshee <seth.forshee@...onical.com>,
Stéphane Graber <stgraber@...ntu.com>,
Aleksa Sarai <cyphar@...har.com>,
Lennart Poettering <lennart@...ttering.net>,
"Eric W. Biederman" <ebiederm@...ssion.com>, smbarber@...omium.org,
Phil Estes <estesp@...il.com>, Serge Hallyn <serge@...lyn.com>,
Kees Cook <keescook@...omium.org>,
Todd Kjos <tkjos@...gle.com>, Paul Moore <paul@...l-moore.com>,
Jonathan Corbet <corbet@....net>,
containers@...ts.linux-foundation.org, fstests@...r.kernel.org,
linux-security-module@...r.kernel.org, linux-api@...r.kernel.org,
linux-ext4@...r.kernel.org, linux-integrity@...r.kernel.org,
selinux@...r.kernel.org
Subject: Re: [PATCH v3 04/38] fs: add mount_setattr()
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.
Powered by blists - more mailing lists