9bb5d6
From 3322ecbfe29a16e74c4f584d661b0b8018bb4031 Mon Sep 17 00:00:00 2001
9bb5d6
From: Raphael Moreira Zinsly <rzinsly@linux.ibm.com>
9bb5d6
Date: Mon, 14 Sep 2020 11:59:24 -0300
9bb5d6
Subject: [PATCH] powerpc: Protect dl_powerpc_cpu_features on INIT_ARCH() [BZ
9bb5d6
 #26615]
9bb5d6
9bb5d6
dl_powerpc_cpu_features also needs to be protected by __GLRO to check
9bb5d6
for the _rtld_global_ro realocation before accessing it.
9bb5d6
9bb5d6
Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
9bb5d6
---
9bb5d6
 sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h | 2 +-
9bb5d6
 1 file changed, 1 insertion(+), 1 deletion(-)
9bb5d6
9bb5d6
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h b/sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h
9bb5d6
index 17ddfcf528..c8fa07fadc 100644
9bb5d6
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h
9bb5d6
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h
9bb5d6
@@ -38,7 +38,7 @@
9bb5d6
   unsigned long int hwcap = __GLRO(dl_hwcap); 			\
9bb5d6
   unsigned long int __attribute__((unused)) hwcap2 = __GLRO(dl_hwcap2); \
9bb5d6
   bool __attribute__((unused)) use_cached_memopt =		\
9bb5d6
-    GLRO(dl_powerpc_cpu_features).use_cached_memopt;		\
9bb5d6
+    __GLRO(dl_powerpc_cpu_features.use_cached_memopt);		\
9bb5d6
   if (hwcap & PPC_FEATURE_ARCH_2_06)				\
9bb5d6
     hwcap |= PPC_FEATURE_ARCH_2_05 |				\
9bb5d6
 	     PPC_FEATURE_POWER5_PLUS |				\
9bb5d6
-- 
9bb5d6
2.27.0
9bb5d6