[PATCH] D89344: Introduce convenience macro ASAN_NO_INSTR_PTR.

Dan Liew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 13 14:32:54 PDT 2020


delcypher created this revision.
delcypher added reviewers: kubamracek, yln, kcc, vitalybuka, eugenis.
Herald added subscribers: Sanitizers, hiraditya.
Herald added projects: Sanitizers, LLVM.
delcypher requested review of this revision.

This macro makes it convenient to annotate pointer types in source code
to avoid ASan instrumentation.

Previously `__attribute__((address_space(1)))` had to be applied to
pointer types to avoid instrumentation. However, this leaks
implementation details and is cumbersome to write.

The intended use case here is to annotate accesses to regions of memory
on Darwin that are outside of normal user memory. These regions do not
have a corresponding shadow memory and so when instrumentation tries to
look to access the shadow bytes it causes non-deterministic behaviour.

A test case is included to test various aspects of the macro.

rdar://problem/70234898


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D89344

Files:
  compiler-rt/include/sanitizer/asan_interface.h
  compiler-rt/test/asan/TestCases/no_instrument_pointer.cpp
  llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89344.297962.patch
Type: text/x-patch
Size: 3592 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201013/3d6b17c6/attachment.bin>


More information about the llvm-commits mailing list