This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] [BZ #14579] rtld: limit the self loading check to normalmode


On 9/13/2012 10:36 PM, Dmitry V. Levin wrote:
> On Thu, Sep 13, 2012 at 09:50:20PM -0400, Carlos O'Donell wrote:
>> On 9/13/2012 9:26 PM, Dmitry V. Levin wrote:
>>> Run time dynamic linker used to allow processing itself in verify, list
>>> and trace modes until commit glibc-2.14~10 disallowed all kinds of self
>>> loading altogether.  This change limits the check for self loading to
>>> normal mode so that instruments like ldd could handle rtld properly.
>>
>> I like where this patch is going, but you are missing some more information.
>>
>> (a) Why was this disabled? What has changed since then that would make
>>     it meaningful to enable today?
> 
> I suppose the author of commit glibc-2.14~10 had an idea to fix a segfault
> that used to happen when rtld was loading itself in normal mode.
> Unfortunately, he disallowed too much, so his change not only fixed the
> segfault but also introduced the regression reported in #14579.

Did we identify the defect and was it fixed?

Or has the defect simply stopped triggering?

>> (b) What use case does this enable? Is it actually useful to run ldd 
>>     against the loader? Why?
> 
> Our build system uses scripts that process ELF objects (including rtld),
> and these scripts honor ldd exit status (as good scripts must do).
> After all, ld.so --verify is not expected to fail with exit status 127
> (which meant to be a fatal error) when there is no error at all.

Agreed, it's wrong that `./elf/ld.so --verify ./elf/ld-linux-x86-64.so.2`
returns an exit status of 127, it should IMO return 1 indicating that
it is *not* a "dynamically linked object we can handle" (it's a statically
linked object).

Does your patch cause ld.so --verify to return 1 as it does for statically
linked binaries?

>> (c) Testcase?
> 
> My glibc package simply won't build without this fix, but I'm afraid this
> wouldn't count here. :)

No, it doesn't count.

> You mean some elf/tst-rtldload.sh script that would test $(objpfx)ld.so
> self loading in all four modes?
 
Yes, exactly, that way if we break this again the testcase will show
a regression.

Cheers,
Carlos.
-- 
Carlos O'Donell
Mentor Graphics / CodeSourcery
carlos_odonell@mentor.com
carlos@codesourcery.com
+1 (613) 963 1026


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]