mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ulrich Kunitz <kune@deine-taler.de>
To: Chuck Ebbert <cebbert@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org, honza@jikos.cz, jkosina@suse.cz
Subject: Re: Is PIE randomization breaking klibc binaries?
Date: Wed, 25 Jul 2007 00:00:53 +0200	[thread overview]
Message-ID: <20070724220053.GA20531@deine-taler.de> (raw)
In-Reply-To: <46A667BD.5080106@redhat.com>

On 07-07-24 16:57 Chuck Ebbert wrote:

> > $ strace ./cat
> > execve("./cat", ["./cat"], [/* 55 vars */]) = -1 ENOENT (No such file or directory)
> > ...

Chuck, my binaries run always into a segmentation violation. So
ENOENT is not the issue. (Notify it was on an x86-64.)

> > $ 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]
> 

Yes, these files were present in the initrd.img file. I checked it
by unpacking the initrd.img file. Notify also that I used
git-bisect to identify the PIE patch. This requires successful
builds. Reverting the patch clearly resolved the issue at the end.

> Ulrich, did your initrd contain the correct .so?

Sure! I have only one klibc-*.so on my box in /lib. I diffed the
file in the unpacked initrd.img with the file in /lib and there
has been no difference.

I always recreate the initial ramdisk after the kernel rebuild
with make install and my own installkernel script, which uses
mkinitramfs. The mkinitramfs script ensures that the klibc so
object from /lib and the klibc binaries from /usr/lib/klibc/bin
are copied into the initrd image. Usually that works without any
issue on x86, x86-64. PPC can't use make install, but I use
mkinitramfs there too, which handles klibc the same way.

> Did you try rebuilding klibc after building the new kernel?

Rebuilding klibc doesn't make sense from my point of view. What
should be the point of it?

-- 
Uli Kunitz

  reply	other threads:[~2007-07-24 22:01 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-20 21:13 Ulrich Kunitz
2007-07-20 22:05 ` H. Peter Anvin
2007-07-24 20:34   ` Chuck Ebbert
2007-07-24 20:57     ` Chuck Ebbert
2007-07-24 22:00       ` Ulrich Kunitz [this message]
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=20070724220053.GA20531@deine-taler.de \
    --to=kune@deine-taler.de \
    --cc=cebbert@redhat.com \
    --cc=honza@jikos.cz \
    --cc=hpa@zytor.com \
    --cc=jkosina@suse.cz \
    --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

all inboxes | Powered by JetHome®