aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/generic/ldsodefs.h
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2019-10-17 11:20:39 +0200
committerFlorian Weimer <fweimer@redhat.com>2019-10-17 11:20:39 +0200
commit7f1de8894be40772b9240563ea66c702014a1f96 (patch)
treebac7b8602e0443b68ba698eac09ce5fd1133282f /sysdeps/generic/ldsodefs.h
parent7d3db434f910c23591f748a6d0ac3548af1048bb (diff)
downloadglibc-7f1de8894be40772b9240563ea66c702014a1f96.tar
glibc-7f1de8894be40772b9240563ea66c702014a1f96.tar.gz
glibc-7f1de8894be40772b9240563ea66c702014a1f96.tar.bz2
glibc-7f1de8894be40772b9240563ea66c702014a1f96.zip
Lazy binding failures during dlopen/dlclose must be fatal [BZ #24304]
If a lazy binding failure happens during the execution of an ELF constructor or destructor, the dynamic loader catches the error and reports it using the dlerror mechanism. This is undesirable because there could be other constructors and destructors that need processing (which are skipped), and the process is in an inconsistent state at this point. Therefore, we have to issue a fatal dynamic loader error error and terminate the process. To temporarily disable exception handling (turning exceptions into fatal errors), _dl_catch_exception is changed to accept a null exception argument, which indicates that it should call the operate function with exception handling disabled. _dl_fini does not need changes because it does not install an error handler, so errors are already fatal there. Tested on x86_64-linux-gnu and i686-linux-gnu.
Diffstat (limited to 'sysdeps/generic/ldsodefs.h')
-rw-r--r--sysdeps/generic/ldsodefs.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index f3ba13ee68..07789022e0 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -860,7 +860,9 @@ libc_hidden_proto (_dl_catch_error)
/* Call OPERATE (ARGS). If no error occurs, set *EXCEPTION to zero.
Otherwise, store a copy of the raised exception in *EXCEPTION,
- which has to be freed by _dl_exception_free. */
+ which has to be freed by _dl_exception_free. As a special case, if
+ EXCEPTION is null, call OPERATE (ARGS) with exception handling
+ disabled (so that exceptions are fatal). */
int _dl_catch_exception (struct dl_exception *exception,
void (*operate) (void *), void *args);
libc_hidden_proto (_dl_catch_exception)