summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--sysdeps/unix/sysv/linux/dl-osinfo.h4
2 files changed, 5 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 85993dce6b..29b7c67e9e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2012-03-11  David S. Miller  <davem@davemloft.net>
 
+	* sysdeps/unix/sysv/linux/dl-osinfo.h (_dl_setup_stack_chk_guard):
+	Fix masking out of the most significant byte of random value used.
+
 	* sysdeps/sparc/fpu/libm-test-ulps: Update.
 
 2012-03-10  Andreas Schwab  <schwab@linux-m68k.org>
diff --git a/sysdeps/unix/sysv/linux/dl-osinfo.h b/sysdeps/unix/sysv/linux/dl-osinfo.h
index 780b20ab6a..1ff8a2f6a2 100644
--- a/sysdeps/unix/sysv/linux/dl-osinfo.h
+++ b/sysdeps/unix/sysv/linux/dl-osinfo.h
@@ -95,9 +95,9 @@ _dl_setup_stack_chk_guard (void *dl_random)
 	 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 &= ~0xff;
+      ret.num &= ~(uintptr_t)0xff;
 #elif BYTE_ORDER == BIG_ENDIAN
-      ret.num &= ~(0xff << (8 * (sizeof (ret) - 1)));
+      ret.num &= ~((uintptr_t)0xff << (8 * (sizeof (ret) - 1)));
 #else
 # error "BYTE_ORDER unknown"
 #endif