[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <46A667BD.5080106@redhat.com>
Date: Tue, 24 Jul 2007 16:57:33 -0400
From: Chuck Ebbert <cebbert@...hat.com>
To: Chuck Ebbert <cebbert@...hat.com>
CC: "H. Peter Anvin" <hpa@...or.com>,
Ulrich Kunitz <kune@...ne-taler.de>,
linux-kernel@...r.kernel.org, honza@...os.cz, jkosina@...e.cz
Subject: Re: Is PIE randomization breaking klibc binaries?
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?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists