linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aditya Kali <adityakali@google.com>
To: ebiederm@xmission.com, viro@zeniv.linux.org.uk,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Aditya Kali <adityakali@google.com>
Subject: [PATCH] proc: Fix namespace mountpoint path in /proc/mounts
Date: Fri, 25 Oct 2013 14:51:10 -0700	[thread overview]
Message-ID: <1382737870-12792-1-git-send-email-adityakali@google.com> (raw)

Commit bf056bfa80596a5d14b26b17276a56a0dcb080e5:
"proc: Fix the namespace inode permission checks." converted
the namespace files into symlinks. The same commit changed
the way namespace bind mounts appear in /proc/mounts:
  $ mount --bind /proc/self/ns/ipc /mnt/ipc
Originally:
  $ cat /proc/mounts | grep ipc
  proc /mnt/ipc proc rw,nosuid,nodev,noexec 0 0

After commit bf056bfa80596a5d14b26b17276a56a0dcb080e5:
  $ cat /proc/mounts | grep ipc
  proc ipc:[4026531839] proc rw,nosuid,nodev,noexec 0 0

This breaks userspace which expects the 2nd field in
/proc/mounts to be a valid path. This patch restores the
original format of namespace bind-mount entries in
/proc/mounts.

Signed-off-by: Aditya Kali <adityakali@google.com>
---
 fs/proc/namespaces.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/fs/proc/namespaces.c b/fs/proc/namespaces.c
index 49a7fff..d19989d 100644
--- a/fs/proc/namespaces.c
+++ b/fs/proc/namespaces.c
@@ -48,19 +48,9 @@ static int ns_delete_dentry(const struct dentry *dentry)
 	return 1;
 }
 
-static char *ns_dname(struct dentry *dentry, char *buffer, int buflen)
-{
-	struct inode *inode = dentry->d_inode;
-	const struct proc_ns_operations *ns_ops = PROC_I(inode)->ns.ns_ops;
-
-	return dynamic_dname(dentry, buffer, buflen, "%s:[%lu]",
-		ns_ops->name, inode->i_ino);
-}
-
 const struct dentry_operations ns_dentry_operations =
 {
 	.d_delete	= ns_delete_dentry,
-	.d_dname	= ns_dname,
 };
 
 static struct dentry *proc_ns_get_dentry(struct super_block *sb,
-- 
1.8.4.1


             reply	other threads:[~2013-10-25 21:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-25 21:51 Aditya Kali [this message]
2013-10-29 15:36 ` [PATCH] proc: Fix namespace mountpoint path in /proc/mounts Serge E. Hallyn
2013-11-08 23:54   ` Eric W. Biederman
2013-11-21 21:50     ` Serge E. Hallyn
2013-11-21 22:46       ` Eric W. Biederman
2013-11-21 22:52         ` Serge E. Hallyn

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=1382737870-12792-1-git-send-email-adityakali@google.com \
    --to=adityakali@google.com \
    --cc=ebiederm@xmission.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).