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] Fix BZ #16634 -- assert in ld.so when dlopen("a.out"...) is called repeatedly.


On Fri, Mar 21, 2014 at 10:47 PM, Siddhesh Poyarekar
<siddhesh.poyarekar@gmail.com> wrote:

>> 2014-03-21  Paul Pluzhnikov  <ppluzhnikov@google.com>
>>
>>         [BZ #16634]
>>         * elf/dl-load.c (open_verify): Add mode parameter.
>>         Error early when ET_EXEC and mode does not have __RTLD_OPENEXEC.
>>         (open_path): Change from boolean 'secure' to complete flag 'mode'
>>         (_dl_map_object): Adjust.
>
> The patch looks OK to me, but (I'm sorry it didn't occur to me in my
> initial review) shouldn't there be a test case for this?  I think you
> could adapt the reproducer in the bz into a test case.

As mentioned in bugzilla, the bug doesn't show up when invoked via

  ./elf/ld.so --library-path ... pr16634

and only shows up if the binary is linked with

  gcc -pthread -ldl -Wl,-rpath=.:nptl/l:dlfcn,--dynamic-linker=elf/ld.so

I've spent some time tracing through ld.so to understand why that is.
In the former case, _dl_map_object_from_fd (which is where the assert
fires) does not get invoked.

It looks like there is some way to link the test with
--dynamic-linker; I'll look some more into creating a reproducer.

> Also, please try to always post the patch inline like you did
> originally

That is unfortunately impossible with GMail :-(


-- 
Paul Pluzhnikov


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