diff options
| author | Carlos O'Donell <carlos@systemhalted.org> | 2015-09-18 00:12:22 -0400 |
|---|---|---|
| committer | Carlos O'Donell <carlos@systemhalted.org> | 2015-09-18 00:12:22 -0400 |
| commit | f3f30c9d5cb98fb90fd6dd2e5362b7fe3ace3720 (patch) | |
| tree | 06b957bbe6f2b85471697b8341733b162fae9da2 /elf/dl-sym.c | |
| parent | 8a44513e9ccb271e368b4aa3c9493b94a45e039d (diff) | |
| download | glibc-carlos/dlmopen.tar.xz glibc-carlos/dlmopen.zip | |
Initial implemenation of full dlmopen support.carlos/dlmopen
Diffstat (limited to 'elf/dl-sym.c')
| -rw-r--r-- | elf/dl-sym.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/elf/dl-sym.c b/elf/dl-sym.c index 56fea86fa8..917b540e55 100644 --- a/elf/dl-sym.c +++ b/elf/dl-sym.c @@ -91,10 +91,17 @@ do_sym (void *handle, const char *name, void *who, lookup_t result; ElfW(Addr) caller = (ElfW(Addr)) who; + struct link_map *match = NULL; struct link_map *l = _dl_find_dso_for_object (caller); - /* If the address is not recognized the call comes from the main - program (we hope). */ - struct link_map *match = l ? l : GL(dl_ns)[LM_ID_BASE]._ns_loaded; + + /* Failure to determinet the caller's namespace is a fatal + error since we need it for handling namespace isolation + correctly. Falling back to LM_ID_BASE will break isolation. */ + if (l == NULL) + GLRO(dl_signal_error) (EINVAL, NULL, NULL, N_("\ +unable to determine caller's namespace during symbol lookup")); + + match = l; if (handle == RTLD_DEFAULT) { |
