Documentation/dev-tools/ubsan.rst

Source file repositories/reference/linux-study-clean/Documentation/dev-tools/ubsan.rst

File Facts

System
Linux kernel
Corpus path
Documentation/dev-tools/ubsan.rst
Extension
.rst
Size
3035 bytes
Lines
80
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: documentation
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

[<ffffffff830ae053>] start_kernel+0x83/0x49a
	  [<ffffffff830ad120>] ? early_idt_handler_array+0x120/0x120
	  [<ffffffff830ad386>] x86_64_start_reservations+0x2a/0x2c
	  [<ffffffff830ad4f3>] x86_64_start_kernel+0x16b/0x17a
	 ================================================================================

Usage
-----

To enable UBSAN, configure the kernel with::

  CONFIG_UBSAN=y

To exclude files from being instrumented use::

  UBSAN_SANITIZE_main.o := n

and to exclude all targets in one directory use::

  UBSAN_SANITIZE := n

When disabled for all targets, specific files can be enabled using::

  UBSAN_SANITIZE_main.o := y

Detection of unaligned accesses controlled through the separate option -
CONFIG_UBSAN_ALIGNMENT. It's off by default on architectures that support
unaligned accesses (CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y). One could
still enable it in config, just note that it will produce a lot of UBSAN
reports.

References
----------

.. _1: https://gcc.gnu.org/onlinedocs/gcc-4.9.0/gcc/Debugging-Options.html
.. _2: https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html
.. _3: https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html

Annotation

Implementation Notes