[PATCH] D106908: Improve UBSan documentation

Mitch Phillips via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 2 15:10:59 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG65e9d7efb090: Improve UBSan documentation (authored by hctim).
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Changed prior to commit:
  https://reviews.llvm.org/D106908?vs=362138&id=363587#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106908/new/

https://reviews.llvm.org/D106908

Files:
  clang/docs/UndefinedBehaviorSanitizer.rst


Index: clang/docs/UndefinedBehaviorSanitizer.rst
===================================================================
--- clang/docs/UndefinedBehaviorSanitizer.rst
+++ clang/docs/UndefinedBehaviorSanitizer.rst
@@ -12,7 +12,9 @@
 UBSan modifies the program at compile-time to catch various kinds of undefined
 behavior during program execution, for example:
 
-* Using misaligned or null pointer
+* Array subscript out of bounds, where the bounds can be statically determined
+* Bitwise shifts that are out of bounds for their data type
+* Dereferencing misaligned or null pointers
 * Signed integer overflow
 * Conversion to, from, or between floating-point types which would
   overflow the destination
@@ -53,6 +55,7 @@
 * ``-fsanitize=...``: print a verbose error report and continue execution (default);
 * ``-fno-sanitize-recover=...``: print a verbose error report and exit the program;
 * ``-fsanitize-trap=...``: execute a trap instruction (doesn't require UBSan run-time support).
+* ``-fno-sanitize=...``: disable any check, e.g., -fno-sanitize=alignment.
 
 Note that the ``trap`` / ``recover`` options do not enable the corresponding
 sanitizer, and in general need to be accompanied by a suitable ``-fsanitize=``
@@ -357,6 +360,9 @@
 More Information
 ================
 
+* From Oracle blog, including a discussion of error messages:
+  `Improving Application Security with UndefinedBehaviorSanitizer (UBSan) and GCC
+  <https://blogs.oracle.com/linux/improving-application-security-with-undefinedbehaviorsanitizer-ubsan-and-gcc>`_
 * From LLVM project blog:
   `What Every C Programmer Should Know About Undefined Behavior
   <http://blog.llvm.org/2011/05/what-every-c-programmer-should-know.html>`_


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106908.363587.patch
Type: text/x-patch
Size: 1713 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210802/e81bb80e/attachment.bin>


More information about the cfe-commits mailing list