This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[PATCH, rs6000] Fix address sanitizer for powerpc64.


[PATCH, rs6000] Fix address sanitizer for powerpc64.

This patch fixes problems that asan has on powerpc64 running on some old
kernels and also very new kernels.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85394 and
https://github.com/google/sanitizers/issues/933 for more information.

Bootstrapped and tested on powerpc64le-unknown-linux-gnu and
powerpc64be-unknown-linux-gnu with no regressions.  Is this ok for trunk?


2018-04-17  Bill Seurer  <seurer@linux.vnet.ibm.com>

	PR sanitizer/85389
	* asan/asan_allocator.h: Switch to use dynamic base for the allocator
	region.

Index: libsanitizer/asan/asan_allocator.h
===================================================================
--- libsanitizer/asan/asan_allocator.h	(revision 259447)
+++ libsanitizer/asan/asan_allocator.h	(working copy)
@@ -122,7 +122,7 @@ const uptr kAllocatorSpace = ~(uptr)0;
 const uptr kAllocatorSize  =  0x40000000000ULL;  // 4T.
 typedef DefaultSizeClassMap SizeClassMap;
 # elif defined(__powerpc64__)
-const uptr kAllocatorSpace =  0xa0000000000ULL;
+const uptr kAllocatorSpace = ~(uptr)0;
 const uptr kAllocatorSize  =  0x20000000000ULL;  // 2T.
 typedef DefaultSizeClassMap SizeClassMap;
 # elif defined(__aarch64__) && SANITIZER_ANDROID

-- 

-Bill Seurer


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