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