[PATCH] D17690: [asan] Check if the memory is readable before using the AsanChunk in free() and realloc()

Kostya Serebryany via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 29 10:49:56 PST 2016


kcc added a comment.

Thanks for doing this! 
One comment for the test.


================
Comment at: test/asan/TestCases/Posix/bad-free-no-segv.cc:15
@@ +14,3 @@
+  size_t shadow_scale, shadow_offset;
+  __asan_get_shadow_mapping(&shadow_scale, &shadow_offset);
+  // We add 0x100 because asan_free subtracts sizeof(AsanChunk) to our ptr.
----------------
I'd prefer the test to use a separate mprotec-ted chunk, not the shadow gap. 


http://reviews.llvm.org/D17690





More information about the llvm-commits mailing list