Skip to content

Commit baa51ff

Browse files
authored
[sanitizer] Document AddressSanitizer security considerations (#100937)
Follow-up to #92593. Also makes #92611, google/sanitizers#1130 obsolete.
1 parent 70e0a7e commit baa51ff

File tree

7 files changed

+63
-8
lines changed

7 files changed

+63
-8
lines changed

clang/docs/AddressSanitizer.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,14 @@ Limitations
313313
usually expected.
314314
* Static linking of executables is not supported.
315315

316+
Security Considerations
317+
=======================
318+
319+
AddressSanitizer is a bug detection tool and its runtime is not meant to be
320+
linked against production executables. While it may be useful for testing,
321+
AddressSanitizer's runtime was not developed with security-sensitive
322+
constraints in mind and may compromise the security of the resulting executable.
323+
316324
Supported Platforms
317325
===================
318326

clang/docs/HardwareAssistedAddressSanitizerDesign.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,14 @@ than that of AddressSanitizer:
262262
`1/TG` extra memory for the shadow
263263
and some overhead due to `TG`-aligning all objects.
264264

265+
Security Considerations
266+
=======================
267+
268+
HWASAN is a bug detection tool and its runtime is not meant to be
269+
linked against production executables. While it may be useful for testing,
270+
HWASAN's runtime was not developed with security-sensitive
271+
constraints in mind and may compromise the security of the resulting executable.
272+
265273
Supported architectures
266274
=======================
267275
HWASAN relies on `Address Tagging`_ which is only available on AArch64.

clang/docs/LeakSanitizer.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ To use LeakSanitizer in stand-alone mode, link your program with
4343
link step, so that it would link in proper LeakSanitizer run-time library
4444
into the final executable.
4545

46+
Security Considerations
47+
=======================
48+
49+
LeakSanitizer is a bug detection tool and its runtime is not meant to be
50+
linked against production executables. While it may be useful for testing,
51+
LeakSanitizer's runtime was not developed with security-sensitive
52+
constraints in mind and may compromise the security of the resulting executable.
53+
4654
Supported Platforms
4755
===================
4856

clang/docs/MemorySanitizer.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,14 @@ uninstrumented libc. For example, the authors were able to bootstrap
198198
MemorySanitizer-instrumented Clang compiler by linking it with
199199
self-built instrumented libc++ (as a replacement for libstdc++).
200200

201+
Security Considerations
202+
=======================
203+
204+
MemorySanitizer is a bug detection tool and its runtime is not meant to be
205+
linked against production executables. While it may be useful for testing,
206+
MemorySanitizer's runtime was not developed with security-sensitive
207+
constraints in mind and may compromise the security of the resulting executable.
208+
201209
Supported Platforms
202210
===================
203211

clang/docs/ThreadSanitizer.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,14 @@ Limitations
135135
flag had been supplied if compiling without ``-fPIC``, and as though the
136136
``-pie`` flag had been supplied if linking an executable.
137137

138+
Security Considerations
139+
-----------------------
140+
141+
ThreadSanitizer is a bug detection tool and its runtime is not meant to be
142+
linked against production executables. While it may be useful for testing,
143+
ThreadSanitizer's runtime was not developed with security-sensitive
144+
constraints in mind and may compromise the security of the resulting executable.
145+
138146
Current Status
139147
--------------
140148

clang/docs/UndefinedBehaviorSanitizer.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,8 @@ Volatile
256256
The ``null``, ``alignment``, ``object-size``, ``local-bounds``, and ``vptr`` checks do not apply
257257
to pointers to types with the ``volatile`` qualifier.
258258

259+
.. _minimal-runtime:
260+
259261
Minimal Runtime
260262
===============
261263

@@ -416,6 +418,15 @@ There are several limitations:
416418
* Check groups (like ``undefined``) can't be used in suppressions file, only
417419
fine-grained checks are supported.
418420

421+
Security Considerations
422+
=======================
423+
424+
UndefinedBehaviorSanitizer's runtime is meant for testing purposes and its usage
425+
in production environment should be carefully considered from security
426+
perspective as it may compromise the security of the resulting executable.
427+
For security-sensitive applications consider using :ref:`Minimal Runtime
428+
<minimal-runtime>` or trap mode for all checks.
429+
419430
Supported Platforms
420431
===================
421432

llvm/docs/GwpAsan.rst

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,18 @@ GWP-ASan vs. ASan
3030
Unlike `AddressSanitizer <https://clang.llvm.org/docs/AddressSanitizer.html>`_,
3131
GWP-ASan does not induce a significant performance overhead. ASan often requires
3232
the use of dedicated canaries to be viable in production environments, and as
33-
such is often impractical.
34-
35-
GWP-ASan is only capable of finding a subset of the memory issues detected by
36-
ASan. Furthermore, GWP-ASan's bug detection capabilities are only probabilistic.
37-
As such, we recommend using ASan over GWP-ASan in testing, as well as anywhere
38-
else that guaranteed error detection is more valuable than the 2x execution
39-
slowdown/binary size bloat. For the majority of production environments, this
40-
impact is too high, and GWP-ASan proves extremely useful.
33+
such is often impractical. Moreover, ASan's runtime is not developed with
34+
security consideration in mind, making compiled binaries more vulnerable to
35+
exploits.
36+
37+
However, GWP-ASan is only capable of finding a subset of the memory issues
38+
detected by ASan. Furthermore, GWP-ASan's bug detection capabilities are
39+
only probabilistic. As such, we recommend using ASan over GWP-ASan in testing,
40+
as well as anywhere else that guaranteed error detection is more valuable than
41+
the 2x execution slowdown/binary size bloat. For the majority of production
42+
environments, this impact is too high and security is indispensable, so GWP-ASan
43+
proves extremely useful.
44+
4145

4246
Design
4347
======

0 commit comments

Comments
 (0)