mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: ip netns exec namespace ls -l /proc/pid/fd prepends "/root" to the filename.
Date: Thu, 25 Aug 2022 18:38:08 +0000	[thread overview]
Message-ID: <4c5a2ef5827f471cba84a7c74279f53a@AcuMS.aculab.com> (raw)

If a process inside a network namespace calls readlink() on
/proc/pid/fd/n (for any pid) then the returned string is
prefixed by "/root".

So you get "/root/sys/console" or "/root/var/log/fred" etc.

There seems to be an extra call to prepend_name() called
from prepend_path() from d_path().

This seems decidedly wrong, especially since /root usually
exists.

Even it is were reporting a file outside a chroot (opened
before the chroot) prepending "/root" would be wrong.

Kernel is 5.10.132 (LTS before the retbleed breakages!)

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


                 reply	other threads:[~2022-08-25 18:38 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=4c5a2ef5827f471cba84a7c74279f53a@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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®