mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andries.Brouwer@cwi.nl
To: linux-kernel@vger.kernel.org, viro@math.psu.edu
Subject: CLONE_NEWNS flaw
Date: Mon, 28 Oct 2002 23:10:25 +0100 (MET)	[thread overview]
Message-ID: <UTC200210282210.g9SMAPU10164.aeb@smtp.cwi.nl> (raw)

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

                 reply	other threads:[~2002-10-28 22:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=UTC200210282210.g9SMAPU10164.aeb@smtp.cwi.nl \
    --to=andries.brouwer@cwi.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@math.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®