From: Chuck Ebbert <cebbert.lkml@gmail.com>
To: Mateusz Guzik <mguzik@redhat.com>
Cc: Piotr Karbowski <piotr.karbowski@gmail.com>,
Al Viro <viro@ZenIV.linux.org.uk>,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
Miklos Szeredi <mszeredi@suse.cz>
Subject: Re: /proc/<pid>/exe symlink behavior change in >=3.15.
Date: Thu, 11 Sep 2014 18:39:58 -0500 [thread overview]
Message-ID: <20140911183958.1e45b99e@as> (raw)
In-Reply-To: <20140907075607.GA11240@mguzik>
On Sun, 7 Sep 2014 09:56:08 +0200
Mateusz Guzik <mguzik@redhat.com> wrote:
> On Sat, Sep 06, 2014 at 11:44:32PM +0200, Piotr Karbowski wrote:
> > Hi,
> >
> > Starting with kernel 3.15 the 'exe' symlink under /proc/<pid>/ acts diffrent
> > than it used to in all the pre-3.15 kernels.
> >
> > The usecase:
> >
> > run /root/testbin (app that just sleeps)
> > cp /root/testbin /root/testbin.new
> > mv /root/testbin.new /root/testbin
> > ls -al /proc/`pidof testbin`/exe
> >
> > <=3.14: /root/testbin (deleted)
> > >=3.15: /root/testbin.new (deleted)
> >
> > Was the change intentional? It does render my system unusable and I failed
> > to find a information about such change in the ChangeLog.
> >
>
> It looks like this was already broken for "long" (> DNAME_INLINE_LEN)
> names.
>
> Short names share the problem since da1ce0670c14d8 "vfs: add
> cross-rename".
>
> The following change to switch_names is the culprit:
>
> - memcpy(dentry->d_iname, target->d_name.name,
> - target->d_name.len + 1);
> - dentry->d_name.len = target->d_name.len;
> - return;
> + unsigned int i;
> + BUILD_BUG_ON(!IS_ALIGNED(DNAME_INLINE_LEN, sizeof(long)));
> + for (i = 0; i < DNAME_INLINE_LEN / sizeof(long); i++) {
> + swap(((long *) &dentry->d_iname)[i],
> + ((long *) &target->d_iname)[i]);
> + }
>
>
> Dentries can have names from embedded structure or from an external buffer.
>
> If you take a look around you will see the code just swaps pointers for
> "both external" case. But this results in the same behavoiur you are seeing.
>
Looks like the real problem here is that __d_materialise_dentry() needs the
old behavior of switch_names() . At least that's how it got fixed in grsecurity.
next prev parent reply other threads:[~2014-09-11 23:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <540B8040.5010206@gmail.com>
2014-09-07 7:56 ` /proc/<pid>/exe symlink behavior change in >=3.15 Mateusz Guzik
2014-09-11 18:37 ` Piotr Karbowski
2014-09-11 23:39 ` Chuck Ebbert [this message]
2014-09-11 23:57 ` Mateusz Guzik
2014-09-15 14:14 ` Miklos Szeredi
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=20140911183958.1e45b99e@as \
--to=cebbert.lkml@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mguzik@redhat.com \
--cc=mszeredi@suse.cz \
--cc=piotr.karbowski@gmail.com \
--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).