public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chuck Ebbert <cebbert@redhat.com>
To: Chuck Ebbert <cebbert@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
	Ulrich Kunitz <kune@deine-taler.de>,
	linux-kernel@vger.kernel.org, honza@jikos.cz, jkosina@suse.cz
Subject: Re: Is PIE randomization breaking klibc binaries?
Date: Tue, 24 Jul 2007 16:57:33 -0400	[thread overview]
Message-ID: <46A667BD.5080106@redhat.com> (raw)
In-Reply-To: <46A6624E.60003@redhat.com>

On 07/24/2007 04:34 PM, Chuck Ebbert wrote:
> On 07/20/2007 06:05 PM, H. Peter Anvin wrote:
>>> It looks like that the PIE randomization patch breaks klibc
>>> binaries on x86-64.
>>>
>> Interesting.
>>
>> klibc binaries are indeed statically linked, but composed of two
>> different ELF images: the application itself and the shared libary
>> (which is referenced from the application header as the "interpreter").
>>  Neither of these is an ET_DYN file; they are both ET_EXEC, so it
>> *should* be unaffected by the PIE randomization patch.  Obviously, that
>> seems to not be the case.
>>
>> My guess is that this patch mishandles interpreter images which are
>> ET_EXEC.  Jan, any insight?
> 
> Well, they don't run on Fedora 6 either (which has the same code, it's
> part of exec-shield):
> 
> $ strace ./cat
> execve("./cat", ["./cat"], [/* 55 vars */]) = -1 ENOENT (No such file or directory)
> ...
> $ file cat
> cat: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked (uses shared libs), stripped
> 
> Funny nobody noticed that before...
> 

After installing klibc.so and klibc-<ID>.so into /lib everything works:

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz  MemSiz   Flg Align
  PHDR           0x000034 0x08048034 0x08048034 0x0000a0 0x0000a0 R E 0x4
  INTERP         0x0000d4 0x080480d4 0x080480d4 0x00002a 0x00002a R   0x1
        [Requesting program interpreter: /lib/klibc-58kBUyV_qhVvkMnaxy8A7N8rLak.so]

Ulrich, did your initrd contain the correct .so? Did you try rebuilding klibc after
building the new kernel?

  reply	other threads:[~2007-07-24 20:58 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-20 21:13 Is PIE randomization breaking klibc binaries? Ulrich Kunitz
2007-07-20 22:05 ` H. Peter Anvin
2007-07-24 20:34   ` Chuck Ebbert
2007-07-24 20:57     ` Chuck Ebbert [this message]
2007-07-24 22:00       ` Ulrich Kunitz
2007-07-24 22:41         ` Chuck Ebbert
2007-07-24 22:45           ` H. Peter Anvin
2007-07-24 23:13             ` Ulrich Kunitz
2007-07-25  6:32             ` Ulrich Kunitz
2007-07-31 11:30               ` Jiri Kosina
2007-07-31 12:01                 ` H. Peter Anvin
2007-07-31 12:19                   ` Jiri Kosina
2007-07-31 12:15                     ` H. Peter Anvin
2007-08-01 14:07                       ` Jiri Kosina
2007-08-02  4:29                         ` Ulrich Kunitz
2007-08-02 11:21                           ` Jiri Kosina
2007-08-02 17:03                             ` Bret Towe
2007-08-02 19:02               ` Sergey Vlasov
2007-08-02 19:10                 ` H. Peter Anvin
2007-08-02 20:42                   ` Ulrich Kunitz
2007-08-02 21:03                   ` Jiri Kosina
2007-08-02 19:10                 ` Ulrich Kunitz
2007-07-21  6:02 ` Bret Towe
2007-07-21 10:18   ` Andrew Morton

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=46A667BD.5080106@redhat.com \
    --to=cebbert@redhat.com \
    --cc=honza@jikos.cz \
    --cc=hpa@zytor.com \
    --cc=jkosina@suse.cz \
    --cc=kune@deine-taler.de \
    --cc=linux-kernel@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