diff options
author | Florian Weimer <fweimer@redhat.com> | 2017-12-18 20:04:13 +0100 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2017-12-18 20:04:13 +0100 |
commit | 8e1472d2c1e25e6eabc2059170731365f6d5b3d1 (patch) | |
tree | 5b29308e6b00178a34422b6f7bb7b4f9252801dc /dlfcn/dlvsym.c | |
parent | 49b036bce9f021ae994a85aee8b410d20b29c8b7 (diff) | |
download | glibc-8e1472d2c1e25e6eabc2059170731365f6d5b3d1.zip glibc-8e1472d2c1e25e6eabc2059170731365f6d5b3d1.tar.gz glibc-8e1472d2c1e25e6eabc2059170731365f6d5b3d1.tar.bz2 |
ld.so: Examine GLRO to detect inactive loader [BZ #20204]
GLRO (_rtld_global_ro) is read-only after initialization and can
therefore not be patched at run time, unlike the hook table addresses
and their contents, so this is a desirable hardening feature.
The hooks are only needed if ld.so has not been initialized, and this
happens only after static dlopen (dlmopen uses a single ld.so object
across all namespaces).
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'dlfcn/dlvsym.c')
-rw-r--r-- | dlfcn/dlvsym.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/dlfcn/dlvsym.c b/dlfcn/dlvsym.c index 5ed220b..ad46b65 100644 --- a/dlfcn/dlvsym.c +++ b/dlfcn/dlvsym.c @@ -58,7 +58,7 @@ __dlvsym (void *handle, const char *name, const char *version_str DL_CALLER_DECL) { # ifdef SHARED - if (__glibc_unlikely (_dlfcn_hook != NULL)) + if (!rtld_active ()) return _dlfcn_hook->dlvsym (handle, name, version_str, DL_CALLER); # endif |