[RFC][PATCH v10 5/7] Implement dlmopen RTLD_SHARED flag (bug 22745)

Vivek Das Mohapatra vivek@collabora.com
Wed Jun 2 15:42:53 GMT 2021


> The 'loader' GL(dl_ns)[nsid].libc_map points to a read-only memory segment,
> I haven't debug it further.

Stared at the code for a while and did some code tweaking and figured it out:
If the library is loaded _without_ RTLD_ISOLATE then some error paths will
not result in a new namespace being initialised at all (since libc will be 
shared with the main namespace), which in turn means that nsid will never be
upgraded from LM_ID_NEWLM (-1).

So in the error path you'll try a negative offset from GL(dl_ns) and Very
Bad Things will happen.

Easy enough to add a guard for. I'll address the comments so far and send a
new patch series.


More information about the Libc-alpha mailing list