Thread (58 messages) 58 messages, 8 authors, 2020-11-28

Re: [PATCH v2 07/39] mount: attach mappings to mounts

From: Tycho Andersen <tycho@tycho.pizza>
Date: 2020-11-23 15:57:09
Also in: linux-api, linux-ext4, linux-fsdevel, linux-integrity, selinux

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help