public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Piotr Karbowski <piotr.karbowski@gmail.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [BUG] rename() from outside of the target dir breaks /proc exe symlink.
Date: Tue, 30 Dec 2014 23:40:01 +0100	[thread overview]
Message-ID: <54A329C1.9030704@gmail.com> (raw)
In-Reply-To: <20141227181412.GG22149@ZenIV.linux.org.uk>

Hi Al,

On 12/27/2014 07:14 PM, Al Viro wrote:
> That's because it never _had_ worked.  Note that opening the damn thing
> will give the right file - it does not work by traversing the result of
> readlink(2).  readlink(2) output on those is not promised to be useful
> in all cases; often enough it is, but it won't work on cross-directory
> renames, it can't be used to tell a filename that really ends with " (deleted)"
> from a removed file, etc.  Moreover, it only very recently became usable for
> victim names with the last component longer than 40 characters if you did an
> overwriting rename.
>
> What are you trying to use it for?

I am using it to track the origin of running processes. I am working 
with continuous integration of a Linux embedded software. The tests goes 
in Linux containers, multiple instances of binary with the same name in 
a single container/namespace, all with cwd symlink pointing to / which 
looks from outside virtually the same, the binaries are modified at 
runtime by coping, modifing and replacing for another execution of the 
same binary (using patchelf to add additional NEEDED to header or change 
rpath or dynamic loader and such).

In my very usecase, the exe symlink is essential.

-- Piotr.

  reply	other threads:[~2014-12-30 22:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-27 17:39 [BUG] rename() from outside of the target dir breaks /proc exe symlink Piotr Karbowski
2014-12-27 18:14 ` Al Viro
2014-12-30 22:40   ` Piotr Karbowski [this message]
2015-01-16 18:25     ` Piotr Karbowski
2015-02-09 18:18       ` [BUMP] " Piotr Karbowski

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=54A329C1.9030704@gmail.com \
    --to=piotr.karbowski@gmail.com \
    --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