[compiler-rt] r279983 - [scudo] use 32 bits of ASLR entropy instead of just 24 when shuffling allocated chunks

Kostya Serebryany via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 29 10:45:43 PDT 2016


Author: kcc
Date: Mon Aug 29 12:45:43 2016
New Revision: 279983

URL: http://llvm.org/viewvc/llvm-project?rev=279983&view=rev
Log:
[scudo] use 32 bits of ASLR entropy instead of just 24 when shuffling allocated chunks

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator_primary64.h

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator_primary64.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator_primary64.h?rev=279983&r1=279982&r2=279983&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator_primary64.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator_primary64.h Mon Aug 29 12:45:43 2016
@@ -403,7 +403,7 @@ class SizeClassAllocator64 {
     uptr region_beg = GetRegionBeginBySizeClass(class_id);
     if (end_idx + size > region->mapped_user) {
       if (!kUsingConstantSpaceBeg && region->mapped_user == 0)
-        region->rand_state = region_beg;  // Comes from ASLR.
+        region->rand_state = static_cast<u32>(region_beg >> 12);  // From ASLR.
       // Do the mmap for the user memory.
       uptr map_size = kUserMapSize;
       while (end_idx + size > region->mapped_user + map_size)




More information about the llvm-commits mailing list