mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* CLONE_NEWNS flaw
@ 2002-10-28 22:10 Andries.Brouwer
  0 siblings, 0 replies; only message in thread
From: Andries.Brouwer @ 2002-10-28 22:10 UTC (permalink / raw)
  To: linux-kernel, viro

Hi Al,

Now that hch mentioned CLONE_NEWNS I looked at the code
to see how things are today. But in 2.5.44 it is still
broken. One thing that is wrong is that when you copy
namespaces, the order is reversed, but you depend on
the order for assigning root, altroot and cwd.
Thus, after using CLONE_NEWNS these, and in particular
cwd, will be random and probably incorrect.

Maybe something like

--- namespace.c~        Mon Oct 28 21:25:08 2002
+++ namespace.c Mon Oct 28 22:50:10 2002
@@ -110,7 +110,7 @@
        mnt->mnt_parent = mntget(nd->mnt);
        mnt->mnt_mountpoint = dget(nd->dentry);
        list_add(&mnt->mnt_hash, mount_hashtable+hash(nd->mnt, nd->dentry));
-       list_add(&mnt->mnt_child, &nd->mnt->mnt_mounts);
+       list_add_tail(&mnt->mnt_child, &nd->mnt->mnt_mounts);
        nd->dentry->d_mounted++;
 }
 

is good enough to repair, but I have not checked all callers
of attach_mnt().

Andries

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-10-28 22:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-28 22:10 CLONE_NEWNS flaw Andries.Brouwer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®