ld.so: Examine GLRO to detect inactive loader [BZ #20204]
authorFlorian Weimer <fweimer@redhat.com>
Mon, 18 Dec 2017 19:04:13 +0000 (20:04 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Mon, 18 Dec 2017 19:04:13 +0000 (20:04 +0100)
commit8e1472d2c1e25e6eabc2059170731365f6d5b3d1
tree5b29308e6b00178a34422b6f7bb7b4f9252801dc
parent49b036bce9f021ae994a85aee8b410d20b29c8b7
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>
15 files changed:
ChangeLog
dlfcn/dladdr.c
dlfcn/dladdr1.c
dlfcn/dlclose.c
dlfcn/dlerror.c
dlfcn/dlinfo.c
dlfcn/dlmopen.c
dlfcn/dlopen.c
dlfcn/dlopenold.c
dlfcn/dlsym.c
dlfcn/dlvsym.c
elf/dl-libc.c
elf/rtld.c
libio/vtables.c
sysdeps/generic/ldsodefs.h