public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/release/2.31/master] powerpc: Fix incorrect cache line size load in memset (bug 26332)
@ 2020-08-03 21:33 Aurelien Jarno
  0 siblings, 0 replies; only message in thread
From: Aurelien Jarno @ 2020-08-03 21:33 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1c8efe848bf14f62c79f509e756b2d9239b24663

commit 1c8efe848bf14f62c79f509e756b2d9239b24663
Author: Florian Weimer <fweimer@redhat.com>
Date:   Mon Aug 3 18:07:19 2020 +0200

    powerpc: Fix incorrect cache line size load in memset (bug 26332)
    
    __GLRO loaded the word after the requested variable on big-endian
    PowerPC, where LOWORD is 4.  This can cause the memset implement
    go wrong because the masking with the cache line size produces
    wrong results, particularly if the loaded value happens to be 1.
    
    The __GLRO macro is not used in any place where loading the lower
    32-bit word of a 64-bit value is desired, so the +4 offset is always
    wrong.
    
    Fixes commit 18363b4f010da9ba459b13310b113ac0647c2fcc
    ("powerpc: Move cache line size to rtld_global_ro") and bug 26332.
    
    Reviewed-by: Carlos O'Donell <carlos@redhat.com>
    
    (cherry picked from commit 7650321ce037302bfc2f026aa19e0213b8d02fe6)

Diff:
---
 NEWS                               | 1 +
 sysdeps/powerpc/powerpc32/sysdep.h | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 8a857061e1..17cde19e28 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,7 @@ The following bugs are resolved with this release:
   [25966] Incorrect access of __x86_shared_non_temporal_threshold for x32
   [25976] nss_compat: internal_end*ent may clobber errno, hiding ERANGE
   [26248] Incorrect argument types for INLINE_SETXID_SYSCALL
+  [26332] Incorrect cache line size load causes memory corruption in memset
 
 Security related changes:
 
diff --git a/sysdeps/powerpc/powerpc32/sysdep.h b/sysdeps/powerpc/powerpc32/sysdep.h
index 2ba009e919..829eec266a 100644
--- a/sysdeps/powerpc/powerpc32/sysdep.h
+++ b/sysdeps/powerpc/powerpc32/sysdep.h
@@ -179,8 +179,8 @@ GOT_LABEL:			;					      \
 #else
 /* Position-dependent code does not require access to the GOT.  */
 # define __GLRO(rOUT, rGOT, member, offset)				\
-	lis     rOUT,(member+LOWORD)@ha;					\
-	lwz     rOUT,(member+LOWORD)@l(rOUT)
+	lis     rOUT,(member)@ha;					\
+	lwz     rOUT,(member)@l(rOUT)
 #endif	/* PIC */
 
 #endif	/* __ASSEMBLER__ */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-03 21:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-03 21:33 [glibc/release/2.31/master] powerpc: Fix incorrect cache line size load in memset (bug 26332) Aurelien Jarno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).