This is the mail archive of the libc-alpha@sources.redhat.com 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]

segv if loading first shobj fails


In a patch I have to mlock() executables into memory, I noticed that if loading the first shobj fails, the code will segv. In the lose() function in dl-load.c, there is:

#ifndef SHARED
if (l->l_prev == NULL)
/* No other module loaded. */
_dl_loaded = NULL;
else
#endif
l->l_prev->l_next = NULL;

If the first shobj fails, the l->l_prev will be NULL. I'm not sure if it would be better to remove the #ifndef, or add another check. This is in glibc-2.2.5.

And unfortunately, I don't know a good way to build a testcase without changing the code or using a bogus shobj.

-Corey


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