--- Begin Message ---
- To: Goswin von Brederlow <goswin-v-b@web.de>, 658278-done@bugs.debian.org
- Subject: Re: Bug#658278: ld.so segfaults on wrong input
- From: Aurelien Jarno <aurelien@aurel32.net>
- Date: Wed, 8 Feb 2012 12:52:49 +0100
- Message-id: <20120208115249.GL30378@hall.aurel32.net>
- In-reply-to: <87ty31ej8b.fsf@frosties.localnet>
- References: <20120201184729.7158.97119.reportbug@frosties.localnet> <20120201220041.GD2817@hall.aurel32.net> <87ty31ej8b.fsf@frosties.localnet>
On Wed, Feb 08, 2012 at 11:02:12AM +0100, Goswin von Brederlow wrote:
> reopen 658278
> thanks
>
> Aurelien Jarno <aurelien@aurel32.net> writes:
>
> > On Wed, Feb 01, 2012 at 07:47:29PM +0100, Goswin von Brederlow wrote:
> >> Package: libc6
> >> Version: 2.13-21
> >> Severity: normal
> >> File: /lib64/ld-linux-x86-64.so.2
> >>
> >> Running ld.so with the wrong kind of file segfaults:
> >>
> >> mrvn@frosties:~% /lib64/ld-linux-x86-64.so.2 /usr/lib/klibc/bin/ls
> >> zsh: segmentation fault /lib64/ld-linux-x86-64.so.2 /usr/lib/klibc/bin/ls
> >>
> >
> > It's not the wrong file type:
> >
> > $file /usr/lib/klibc/bin/ls
> > /usr/lib/klibc/bin/ls: ELF 64-bit LSB executable, x86-64, version 1
> > (SYSV), statically linked (uses shared libs), stripped
> >
> > It's an ELF file, but given it has a different ABI just doesn't work
> > with /lib64/ld-linux-x86-64.so.2. It's hardly the fault of the libc.
>
> It has a different interpreter in its elf section. Ld.so could check
> that to determine wether the elf file is one it should care about.
No, if you execute it calling /lib64/ld-linux-x86-64.so.2 $program, it's
actually to override the entry in ld.so. The interpreter in the ELF
entry is there to let the kernel know which interpreter it should
invoke, not to do comparison. Doing so would have prevented fixing the
ELF interpreter on amd64, or doing the transition from one interpreter
to another on armhf, and users would had needed to reinstall there
system instead of doing an upgrade. Definitely not something we need.
> A segfault is never correct behaviour and needs to be fixed in ld.so.
>
It is nothing different than a user replacing a library by another with
the same name but with a different ABI. It segfaults because the ABI is
incompatible, ie different number or type of parameters in functions.
The fact that it happens in ld.so or in another library doesn't matter
here.
So there is no bug, I am therefore closing it.
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
--- End Message ---