]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Move _dl_open_check to its original place in dl_open_worker
authorFlorian Weimer <fweimer@redhat.com>
Thu, 31 Oct 2019 17:48:43 +0000 (18:48 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Wed, 27 Nov 2019 19:55:35 +0000 (20:55 +0100)
This reverts the non-test change from commit d0093c5cefb7f7a4143f
("Call _dl_open_check after relocation [BZ #24259]"), given that
the underlying bug has been fixed properly in commit 61b74477fa7f63
("Remove all loaded objects if dlopen fails, ignoring NODELETE
[BZ #20839]").

Tested on x86-64-linux-gnu, with and without --enable-cet.

Change-Id: I995a6cfb89f25d2b0cf5e606428c2a93eb48fc33

elf/dl-open.c

index 1051e22971b1cde25468de66ddda023c2dafbedd..df9f29a5e5683bf296fe220ef8d55bf3a39906cf 100644 (file)
@@ -622,6 +622,8 @@ dl_open_worker (void *a)
   _dl_debug_state ();
   LIBC_PROBE (map_complete, 3, args->nsid, r, new);
 
+  _dl_open_check (new);
+
   /* Print scope information.  */
   if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES))
     _dl_show_scope (new, 0);
@@ -702,12 +704,6 @@ dl_open_worker (void *a)
        _dl_relocate_object (l, l->l_scope, reloc_mode, 0);
     }
 
-  /* NB: Workaround for [BZ #20839] which doesn't remove the NODELETE
-     object when _dl_open_check throws an exception.  Move it after
-     relocation to avoid leaving the NODELETE object mapped without
-     relocation.  */
-  _dl_open_check (new);
-
   /* This only performs the memory allocations.  The actual update of
      the scopes happens below, after failure is impossible.  */
   resize_scopes (new);