lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 10 Oct 2017 11:51:07 +0200
From:   Karel Zak <kzak@...hat.com>
To:     Miklos Szeredi <mszeredi@...hat.com>
Cc:     David Howells <dhowells@...hat.com>,
        viro <viro@...iv.linux.org.uk>,
        linux-fsdevel <linux-fsdevel@...r.kernel.org>,
        linux-nfs@...r.kernel.org, lkml <linux-kernel@...r.kernel.org>,
        Jeff Layton <jlayton@...hat.com>
Subject: Re: [PATCH 06/14] VFS: Implement fsmount() to effect a
 pre-configured mount [ver #6]

On Tue, Oct 10, 2017 at 10:00:01AM +0200, Miklos Szeredi wrote:
> > +
> > +       if (flags & MS_RDONLY)
> > +               mnt_flags |= MNT_READONLY;
> > +       if (flags & MS_NOSUID)
> > +               mnt_flags |= MNT_NOSUID;
> > +       if (flags & MS_NODEV)
> > +               mnt_flags |= MNT_NODEV;
> > +       if (flags & MS_NOEXEC)
> > +               mnt_flags |= MNT_NOEXEC;
> > +       if (flags & MS_NODIRATIME)
> > +               mnt_flags |= MNT_NODIRATIME;
> > +
> > +       if (flags & MS_STRICTATIME) {
> > +               if (flags & MS_NOATIME)
> > +                       return -EINVAL;
> > +       } else if (flags & MS_NOATIME) {
> > +               mnt_flags |= MNT_NOATIME;
> > +       } else {
> > +               mnt_flags |= MNT_RELATIME;
> > +       }
> 
> I'm not sure reusing the MS_FLAGS is the right choice.  Why not export
> MNT_* to userspace?  That would get us a clean namespace without
> confusion with sb flags and no need to convert back and forth.

Well, if you think about it as about two separated things -- VFS-flags
and FS-flags (and for example /proc/#/mountinfo already uses two
columns for the flags) than the question is why the API uses one
variable?

Would be better to use two variables everywhere? (mostly for the
syscall). 

It would be nice to keep for example propagation flags only in
vfs_flags, or use MS_RDONLY according to context (for FS or for VFS)
without extra MS_BIND, etc.

    Karel

-- 
 Karel Zak  <kzak@...hat.com>
 http://karelzak.blogspot.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ