This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.21-202-gb97eb2b


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  b97eb2bdb1ed72982a7821c3078be591051cef59 (commit)
      from  cb219290492995bb52fba8c21f9f20afe5604721 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b97eb2bdb1ed72982a7821c3078be591051cef59

commit b97eb2bdb1ed72982a7821c3078be591051cef59
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Mar 16 14:58:43 2015 -0700

    Preserve bound registers in _dl_runtime_resolve
    
    We need to add a BND prefix before indirect branch at the end of
    _dl_runtime_resolve to preserve bound registers.
    
    	[BZ #18134]
    	* sysdeps/x86_64/dl-trampoline.S (PRESERVE_BND_REGS_PREFIX): New.
    	(_dl_runtime_resolve): Add a BND prefix before indirect branch.

diff --git a/ChangeLog b/ChangeLog
index c856f79..db321c4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-16  H.J. Lu  <hongjiu.lu@intel.com>
+
+	[BZ #18134]
+	* sysdeps/x86_64/dl-trampoline.S (PRESERVE_BND_REGS_PREFIX): New.
+
 2015-03-15  Paul Eggert  <eggert@cs.ucla.edu>
 
 	* stdlib/setenv.c (__add_to_environ): Revert previous change.
diff --git a/sysdeps/x86_64/dl-trampoline.S b/sysdeps/x86_64/dl-trampoline.S
index 394441d..5f9b35d 100644
--- a/sysdeps/x86_64/dl-trampoline.S
+++ b/sysdeps/x86_64/dl-trampoline.S
@@ -30,6 +30,7 @@
 /* X32 saves RCX, RDX, RSI, RDI, R8 and R9 plus RAX.  */
 # define REGISTER_SAVE_AREA	(8 * 7)
 # define REGISTER_SAVE_RAX	0
+# define PRESERVE_BND_REGS_PREFIX
 #else
 /* X86-64 saves RCX, RDX, RSI, RDI, R8 and R9 plus RAX as well as BND0,
    BND1, BND2, BND3.  */
@@ -40,6 +41,11 @@
 # define REGISTER_SAVE_BND2	(REGISTER_SAVE_BND1 + 16)
 # define REGISTER_SAVE_BND3	(REGISTER_SAVE_BND2 + 16)
 # define REGISTER_SAVE_RAX	(REGISTER_SAVE_BND3 + 16)
+# ifdef HAVE_MPX_SUPPORT
+#  define PRESERVE_BND_REGS_PREFIX bnd
+# else
+#  define PRESERVE_BND_REGS_PREFIX .byte 0xf2
+# endif
 #endif
 #define REGISTER_SAVE_RCX	(REGISTER_SAVE_RAX + 8)
 #define REGISTER_SAVE_RDX	(REGISTER_SAVE_RCX + 8)
@@ -112,6 +118,8 @@ _dl_runtime_resolve:
 	# Adjust stack(PLT did 2 pushes)
 	addq $(REGISTER_SAVE_AREA + 16), %rsp
 	cfi_adjust_cfa_offset(-(REGISTER_SAVE_AREA + 16))
+	# Preserve bound registers.
+	PRESERVE_BND_REGS_PREFIX
 	jmp *%r11		# Jump to function address.
 	cfi_endproc
 	.size _dl_runtime_resolve, .-_dl_runtime_resolve

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                      |    5 +++++
 sysdeps/x86_64/dl-trampoline.S |    8 ++++++++
 2 files changed, 13 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]