[PATCH] D52615: Handle -fsanitize-address-poison-class-member-array-new-cookie in the driver and propagate it to cc1

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 1 11:18:49 PDT 2018


rjmccall added inline comments.


================
Comment at: docs/ClangCommandLineReference.rst:805
 
-Enable poisoning array cookies when using class member operator new\[\] in AddressSanitizer
+Enable poisoning array cookies when using custom operator new\[\] in AddressSanitizer
 
----------------
rjmccall wrote:
> This is user documentation, so it would be good to explain here what exactly this does and why you might enable or disable it.  I know the surrounding documentation is even more barebones, but that's a problem, and it's a problem we won't fix by making it worse.
Thanks.  Grammar/style clean-up:

> Enable "poisoning" array cookies when allocating arrays with a custom `operator new[]` in Address Sanitizer, preventing accesses to the cookies from user code.  An array cookie is a small implementation-defined header added to certain array allocations to record metadata such as the length of the array.  Accesses to array cookies from user code are technically allowed by the standard but are more likely to be the result of an out-of-bounds array access.

> An `operator new[]` is "custom" if it is not one of the allocation functions provided by the C++ standard library.  Array cookies from non-custom allocation functions are always poisoned.


Repository:
  rC Clang

https://reviews.llvm.org/D52615





More information about the cfe-commits mailing list