c5d972
Downstream-only patch to move the recently added members (from
c5d972
glibc-rh2047981-5.patch and glibc-rh2047981-6.patch) to the end
c5d972
of _rtld_global_ro.  This avoids changing the offset of
c5d972
GLRO (dl_naudit).
c5d972
c5d972
Without this change, the audit invocation loop in the old
c5d972
__libc_start_main function in a not-yet-updated version of libc.so.6
c5d972
reads a non-zero garbage value for GLRO (dl_naudit), assumes that
c5d972
auditing is active, and reads further garbage pointers, leading to
c5d972
to a crash.  Preserving the old offset of GLRO (dl_naudit) avoids
c5d972
that.  This works because RPM updates /lib64/ld-* before
c5d972
/lib64/libc.so.6 because it sorts earlier (except on POWER9 due
c5d972
to the glibc-hwcaps/power9 multilib).
c5d972
c5d972
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
c5d972
index 9dec9e3d3b6d6aa2..5e56550a4d556fa7 100644
c5d972
--- a/sysdeps/generic/ldsodefs.h
c5d972
+++ b/sysdeps/generic/ldsodefs.h
c5d972
@@ -648,6 +648,15 @@ struct rtld_global_ro
c5d972
   void *(*_dl_open) (const char *file, int mode, const void *caller_dlopen,
c5d972
 		     Lmid_t nsid, int argc, char *argv[], char *env[]);
c5d972
   void (*_dl_close) (void *map);
c5d972
+  void *(*_dl_tls_get_addr_soft) (struct link_map *);
c5d972
+#ifdef HAVE_DL_DISCOVER_OSVERSION
c5d972
+  int (*_dl_discover_osversion) (void);
c5d972
+#endif
c5d972
+
c5d972
+  /* List of auditing interfaces.  */
c5d972
+  struct audit_ifaces *_dl_audit;
c5d972
+  unsigned int _dl_naudit;
c5d972
+
c5d972
   /* libdl in a secondary namespace (after dlopen) must use
c5d972
      _dl_catch_error from the main namespace, so it has to be
c5d972
      exported in some way.  */
c5d972
@@ -657,14 +666,6 @@ struct rtld_global_ro
c5d972
   /* libdl in a secondary namespace must use free from the base
c5d972
      namespace.  */
c5d972
   void (*_dl_error_free) (void *);
c5d972
-  void *(*_dl_tls_get_addr_soft) (struct link_map *);
c5d972
-#ifdef HAVE_DL_DISCOVER_OSVERSION
c5d972
-  int (*_dl_discover_osversion) (void);
c5d972
-#endif
c5d972
-
c5d972
-  /* List of auditing interfaces.  */
c5d972
-  struct audit_ifaces *_dl_audit;
c5d972
-  unsigned int _dl_naudit;
c5d972
 };
c5d972
 # define __rtld_global_attribute__
c5d972
 # if IS_IN (rtld)