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.19-616-g4a10397


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  4a103975c4c4929455d60224101013888640cd2f (commit)
      from  a2a76afe9127dc7b3e7c526bdf0088c1cc17c33d (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=4a103975c4c4929455d60224101013888640cd2f

commit 4a103975c4c4929455d60224101013888640cd2f
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Fri Jun 20 20:02:34 2014 +0000

    Remove __ASSUME_AT_RANDOM.
    
    This patch removes __ASSUME_AT_RANDOM now it can be assumed to be true
    unconditionally.
    
    Tested x86_64 that the disassembly of installed shared libraries is
    unchanged by this patch.
    
    	* sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_AT_RANDOM):
    	Remove macro.
    	* sysdeps/unix/sysv/linux/dl-osinfo.h (_dl_setup_stack_chk_guard)
    	[!__ASSUME_AT_RANDOM]: Remove conditional code.
    	(_dl_setup_pointer_guard) [!__ASSUME_AT_RANDOM]: Likewise.

diff --git a/ChangeLog b/ChangeLog
index a87a2d0..beea12c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2014-06-20  Joseph Myers  <joseph@codesourcery.com>
 
+	* sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_AT_RANDOM):
+	Remove macro.
+	* sysdeps/unix/sysv/linux/dl-osinfo.h (_dl_setup_stack_chk_guard)
+	[!__ASSUME_AT_RANDOM]: Remove conditional code.
+	(_dl_setup_pointer_guard) [!__ASSUME_AT_RANDOM]: Likewise.
+
 	* sysdeps/unix/sysv/linux/kernel-features.h
 	(__ASSUME_ADJ_OFFSET_SS_READ): Remove macro.
 	* sysdeps/unix/sysv/linux/adjtime.c (ADJTIME)
diff --git a/sysdeps/unix/sysv/linux/dl-osinfo.h b/sysdeps/unix/sysv/linux/dl-osinfo.h
index af13438..fd82287 100644
--- a/sysdeps/unix/sysv/linux/dl-osinfo.h
+++ b/sysdeps/unix/sysv/linux/dl-osinfo.h
@@ -57,39 +57,17 @@ _dl_setup_stack_chk_guard (void *dl_random)
     unsigned char bytes[sizeof (uintptr_t)];
   } ret;
 
-#ifndef __ASSUME_AT_RANDOM
-  if (__glibc_unlikely (dl_random == NULL))
-    {
-      const size_t filllen = sizeof (ret.bytes) - 1;
-      ret.num = 0;
-# ifdef ENABLE_STACKGUARD_RANDOMIZE
-      int fd = open_not_cancel_2 ("/dev/urandom", O_RDONLY);
-      if (fd >= 0)
-	{
-	  ssize_t reslen = read_not_cancel (fd, ret.bytes + 1, filllen);
-	  close_not_cancel_no_status (fd);
-	  if (reslen == (ssize_t) filllen)
-	    return ret.num;
-	}
-# endif
-      ret.bytes[filllen] = 255;
-      ret.bytes[filllen - 1] = '\n';
-    }
-  else
-#endif
-    {
-      /* We need in the moment only 8 bytes on 32-bit platforms and 16
-	 bytes on 64-bit platforms.  Therefore we can use the data
-	 directly and not use the kernel-provided data to seed a PRNG.  */
-      memcpy (ret.bytes, dl_random, sizeof (ret));
+  /* We need in the moment only 8 bytes on 32-bit platforms and 16
+     bytes on 64-bit platforms.  Therefore we can use the data
+     directly and not use the kernel-provided data to seed a PRNG.  */
+  memcpy (ret.bytes, dl_random, sizeof (ret));
 #if BYTE_ORDER == LITTLE_ENDIAN
-      ret.num &= ~(uintptr_t) 0xff;
+  ret.num &= ~(uintptr_t) 0xff;
 #elif BYTE_ORDER == BIG_ENDIAN
-      ret.num &= ~((uintptr_t) 0xff << (8 * (sizeof (ret) - 1)));
+  ret.num &= ~((uintptr_t) 0xff << (8 * (sizeof (ret) - 1)));
 #else
 # error "BYTE_ORDER unknown"
 #endif
-    }
   return ret.num;
 }
 
@@ -97,18 +75,6 @@ static inline uintptr_t __attribute__ ((always_inline))
 _dl_setup_pointer_guard (void *dl_random, uintptr_t stack_chk_guard)
 {
   uintptr_t ret;
-#ifndef __ASSUME_AT_RANDOM
-  if (dl_random == NULL)
-    {
-      ret = stack_chk_guard;
-# ifndef HP_TIMING_NONAVAIL
-      hp_timing_t now;
-      HP_TIMING_NOW (now);
-      ret ^= now;
-# endif
-    }
-  else
-#endif
-    memcpy (&ret, (char *) dl_random + sizeof (ret), sizeof (ret));
+  memcpy (&ret, (char *) dl_random + sizeof (ret), sizeof (ret));
   return ret;
 }
diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index d067321..80655e0 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -162,9 +162,6 @@
 /* Support for the FUTEX_CLOCK_REALTIME flag was added in 2.6.29.  */
 #define __ASSUME_FUTEX_CLOCK_REALTIME	1
 
-/* Support for the AT_RANDOM auxiliary vector entry was added in 2.6.29.  */
-#define __ASSUME_AT_RANDOM	1
-
 /* Support for preadv and pwritev was added in 2.6.30.  */
 #define __ASSUME_PREADV	1
 #define __ASSUME_PWRITEV	1

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

Summary of changes:
 ChangeLog                                 |    6 +++
 sysdeps/unix/sysv/linux/dl-osinfo.h       |   48 ++++------------------------
 sysdeps/unix/sysv/linux/kernel-features.h |    3 --
 3 files changed, 13 insertions(+), 44 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]