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]
Message-ID: <CAHk-=wiXqbSgqzv53C98sbaHVqpc+c8NZTpXC7bBMQT3OznE4g@mail.gmail.com>
Date:   Mon, 12 Apr 2021 09:23:38 -0700
From:   Linus Torvalds <torvalds@...ux-foundation.org>
To:     Anton Altaparmakov <anton@...era.com>
Cc:     "christian.brauner@...ntu.com" <christian.brauner@...ntu.com>,
        "James.Bottomley@...senpartnership.com" 
        <James.Bottomley@...senpartnership.com>,
        "adilger.kernel@...ger.ca" <adilger.kernel@...ger.ca>,
        "alban@...volk.io" <alban@...volk.io>,
        "arnd@...db.de" <arnd@...db.de>,
        "casey@...aufler-ca.com" <casey@...aufler-ca.com>,
        "containers@...ts.linux-foundation.org" 
        <containers@...ts.linux-foundation.org>,
        "corbet@....net" <corbet@....net>,
        "cyphar@...har.com" <cyphar@...har.com>,
        "dhowells@...hat.com" <dhowells@...hat.com>,
        "dmitry.kasatkin@...il.com" <dmitry.kasatkin@...il.com>,
        "ebiederm@...ssion.com" <ebiederm@...ssion.com>,
        "geofft@...reload.com" <geofft@...reload.com>,
        "hch@....de" <hch@....de>,
        "hirofumi@...l.parknet.co.jp" <hirofumi@...l.parknet.co.jp>,
        "john.johansen@...onical.com" <john.johansen@...onical.com>,
        "josh@...htriplett.org" <josh@...htriplett.org>,
        "keescook@...omium.org" <keescook@...omium.org>,
        "lennart@...ttering.net" <lennart@...ttering.net>,
        "linux-api@...r.kernel.org" <linux-api@...r.kernel.org>,
        "linux-ext4@...r.kernel.org" <linux-ext4@...r.kernel.org>,
        "linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
        "linux-integrity@...r.kernel.org" <linux-integrity@...r.kernel.org>,
        "linux-security-module@...r.kernel.org" 
        <linux-security-module@...r.kernel.org>,
        "linux-xfs@...r.kernel.org" <linux-xfs@...r.kernel.org>,
        "luto@...nel.org" <luto@...nel.org>,
        "mpatel@...hat.com" <mpatel@...hat.com>,
        "paul@...l-moore.com" <paul@...l-moore.com>,
        "selinux@...r.kernel.org" <selinux@...r.kernel.org>,
        "seth.forshee@...onical.com" <seth.forshee@...onical.com>,
        "smbarber@...omium.org" <smbarber@...omium.org>,
        "stephen.smalley.work@...il.com" <stephen.smalley.work@...il.com>,
        "tkjos@...gle.com" <tkjos@...gle.com>,
        "tycho@...ho.ws" <tycho@...ho.ws>, "tytso@....edu" <tytso@....edu>,
        "viro@...iv.linux.org.uk" <viro@...iv.linux.org.uk>,
        "zohar@...ux.ibm.com" <zohar@...ux.ibm.com>
Subject: Re: [PATCH v6 24/40] fs: make helpers idmap mount aware

On Mon, Apr 12, 2021 at 5:05 AM Anton Altaparmakov <anton@...era.com> wrote:
>
> Shouldn't that be using mnt_userns instead of &init_user_ns both for the setattr_prepare() and setattr_copy() calls?

It doesn't matter for a filesystem that hasn't marked itself as
supporting idmaps.

If the filesystem doesn't set FS_ALLOW_IDMAP, then mnt_userns is
always going to be &init_user_ns.

That said, I don't think you are wrong - it would probably be a good
idea to pass down the 'mnt_userns' argument just to avoid confusion.
But if you look at the history, you'll see that adding the mount
namespace argument to the helper functions (like setattr_copy())
happened before the actual "switch the filesystem setattr() function
over to get the namespace argument".

So the current situation is partly an artifact of how the incremental
filesystem changes were done.

           Linus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ