]> git.ipfire.org Git - thirdparty/glibc.git/commit - elf/Makefile
dlfcn: Do not use rtld_active () to determine ld.so state (bug 29078)
authorFlorian Weimer <fweimer@redhat.com>
Tue, 26 Apr 2022 12:23:02 +0000 (14:23 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Tue, 26 Apr 2022 12:24:36 +0000 (14:24 +0200)
commit8dcb6d0af07fda3607b541857e4f3970a74ed55b
tree06a15719ac286241c9faf9bfd4a802d57ee08bc8
parentc935789bdf40ba22b5698da869d3a4789797e09f
dlfcn: Do not use rtld_active () to determine ld.so state (bug 29078)

When audit modules are loaded, ld.so initialization is not yet
complete, and rtld_active () returns false even though ld.so is
mostly working.  Instead, the static dlopen hook is used, but that
does not work at all because this is not a static dlopen situation.

Commit 466c1ea15f461edb8e3ffaf5d86d708876343bbf ("dlfcn: Rework
static dlopen hooks") moved the hook pointer into _rtld_global_ro,
which means that separate protection is not needed anymore and the
hook pointer can be checked directly.

The guard for disabling libio vtable hardening in _IO_vtable_check
should stay for now.

Fixes commit 8e1472d2c1e25e6eabc2059170731365f6d5b3d1 ("ld.so:
Examine GLRO to detect inactive loader [BZ #20204]").

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
14 files changed:
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/Makefile
elf/dl-libc.c
elf/tst-audit26.c [new file with mode: 0644]
elf/tst-auditmod26.c [new file with mode: 0644]