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  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:   Mon, 23 Nov 2020 10:47:19 -0500
From:   Tycho Andersen <tycho@...ho.pizza>
To:     Christian Brauner <christian.brauner@...ntu.com>
Cc:     Alexander Viro <viro@...iv.linux.org.uk>,
        Christoph Hellwig <hch@...radead.org>,
        linux-fsdevel@...r.kernel.org,
        Lennart Poettering <lennart@...ttering.net>,
        Mimi Zohar <zohar@...ux.ibm.com>,
        James Bottomley <James.Bottomley@...senpartnership.com>,
        Andreas Dilger <adilger.kernel@...ger.ca>,
        containers@...ts.linux-foundation.org,
        Christoph Hellwig <hch@....de>,
        Jonathan Corbet <corbet@....net>, smbarber@...omium.org,
        linux-ext4@...r.kernel.org, Mrunal Patel <mpatel@...hat.com>,
        Kees Cook <keescook@...omium.org>,
        Arnd Bergmann <arnd@...db.de>, Jann Horn <jannh@...gle.com>,
        selinux@...r.kernel.org, Josh Triplett <josh@...htriplett.org>,
        Seth Forshee <seth.forshee@...onical.com>,
        Aleksa Sarai <cyphar@...har.com>,
        Andy Lutomirski <luto@...nel.org>,
        OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>,
        Geoffrey Thomas <geofft@...reload.com>,
        David Howells <dhowells@...hat.com>,
        John Johansen <john.johansen@...onical.com>,
        Theodore Tso <tytso@....edu>,
        Dmitry Kasatkin <dmitry.kasatkin@...il.com>,
        Stephen Smalley <stephen.smalley.work@...il.com>,
        linux-security-module@...r.kernel.org, linux-audit@...hat.com,
        "Eric W. Biederman" <ebiederm@...ssion.com>,
        linux-api@...r.kernel.org,
        Casey Schaufler <casey@...aufler-ca.com>,
        Alban Crequy <alban@...volk.io>,
        linux-integrity@...r.kernel.org, Todd Kjos <tkjos@...gle.com>
Subject: Re: [PATCH v2 07/39] mount: attach mappings to mounts

On Sun, Nov 15, 2020 at 11:36:46AM +0100, Christian Brauner wrote:
> +static inline struct user_namespace *mnt_user_ns(const struct vfsmount *mnt)
> +{
> +	return mnt->mnt_user_ns;
> +}

I think you might want a READ_ONCE() here. Right now it seems ok, since the
mnt_user_ns can't change, but if we ever allow it to change (and I see you have
a idmapped_mounts_wip_v2_allow_to_change_idmapping branch on your public tree
:D), the pattern of,

        user_ns = mnt_user_ns(path->mnt);
        if (mnt_idmapped(path->mnt)) {
                uid = kuid_from_mnt(user_ns, uid);
                gid = kgid_from_mnt(user_ns, gid);
        }

could race.

Tycho

Powered by blists - more mailing lists