r324163 - [hwasan] Add a paragraph on stack instrumentation.
Evgeniy Stepanov via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 2 17:06:21 PST 2018
Author: eugenis
Date: Fri Feb 2 17:06:21 2018
New Revision: 324163
URL: http://llvm.org/viewvc/llvm-project?rev=324163&view=rev
Log:
[hwasan] Add a paragraph on stack instrumentation.
Reviewers: kcc
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D42874
Modified:
cfe/trunk/docs/HardwareAssistedAddressSanitizerDesign.rst
Modified: cfe/trunk/docs/HardwareAssistedAddressSanitizerDesign.rst
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/HardwareAssistedAddressSanitizerDesign.rst?rev=324163&r1=324162&r2=324163&view=diff
==============================================================================
--- cfe/trunk/docs/HardwareAssistedAddressSanitizerDesign.rst (original)
+++ cfe/trunk/docs/HardwareAssistedAddressSanitizerDesign.rst Fri Feb 2 17:06:21 2018
@@ -77,11 +77,18 @@ This can be based on any malloc that for
Stack
-----
-Special compiler instrumentation is required to align the local variables
-by N, tag the memory and the pointers.
+Stack frames are instrumented by aligning all non-promotable allocas
+by `N` and tagging stack memory in function prologue and epilogue.
+
+Tags for different allocas in one function are **not** generated
+independently; doing that in a function with `M` allocas would require
+maintaining `M` live stack pointers, significantly increasing register
+pressure. Instead we generate a single base tag value in the prologue,
+and build the tag for alloca number `M` as `ReTag(BaseTag, M)`, where
+ReTag can be as simple as exclusive-or with constant `M`.
+
Stack instrumentation is expected to be a major source of overhead,
but could be optional.
-TODO: details.
Globals
-------
More information about the cfe-commits
mailing list