llvm-project/compiler-rt/lib/msan
Kamil Rytarowski 4a282024db Correct atexit(3) support in MSan/NetBSD
Summary:
The NetBSD specific implementation of cxa_atexit() does not
preserve the 2nd argument if dso is equal to NULL.

Changes:

 - Split paths of handling intercepted __cxa_atexit() and atexit(3).
   This affects all supported Operating Systems.
 - Add a local stack-like structure to hold the __cxa_atexit() context.
   atexit(3) is documented in the C standard as calling callback from the
   earliest to the oldest entry. This path also fixes potential ABI
   problem of passing an argument to a function from the atexit(3)
   callback mechanism.
 - Allow usage of global vars with ctors in interceptors.
   This allows to use Vector without automatic cleaning up the structures.

This code has been modeled after TSan implementation for the same functions.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, dvyukov, eugenis, vitalybuka, kcc

Reviewed By: vitalybuka

Subscribers: delcypher, devnexen, llvm-commits, #sanitizers

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D40714

llvm-svn: 346579
2018-11-10 02:17:32 +00:00
..
tests Skip unsupported MSan tests on NetBSD 2018-10-09 12:58:35 +00:00
.clang-format [sanitizer] Remove unneeded blank lines 2018-05-09 00:44:26 +00:00
CMakeLists.txt [CMake] Add compiler-rt header files to the list of sources for targets 2018-07-10 13:00:17 +00:00
msan.cc [MSan] store origins for variadic function parameters in __msan_va_arg_origin_tls 2018-09-06 15:14:36 +00:00
msan.h [MSan] Report proper error on allocator failures instead of CHECK(0)-ing 2018-06-08 23:31:42 +00:00
msan.syms.extra Export __ubsan_* symbols from MSan and TSan runtimes. 2015-04-28 01:20:34 +00:00
msan_allocator.cc [MSan] Linker-initialize static fallback_mutex in msan_allocator.cc 2018-06-14 18:30:51 +00:00
msan_allocator.h Revert r304285, r304297. 2017-06-05 21:20:55 +00:00
msan_blacklist.txt
msan_chained_origin_depot.cc [compiler-rt] Apply modernize-use-nullptr fixes in sanitizers 2015-10-01 00:22:21 +00:00
msan_chained_origin_depot.h
msan_flags.h
msan_flags.inc [Sanitizers] Unify the semantics and usage of "exitcode" runtime flag across all sanitizers. 2015-08-21 20:49:37 +00:00
msan_interceptors.cc Correct atexit(3) support in MSan/NetBSD 2018-11-10 02:17:32 +00:00
msan_interface_internal.h [MSan] Add functions to enable/disable interceptor checks. 2018-07-06 17:10:51 +00:00
msan_linux.cc sanitizers: consistently check result of MmapFixedNoReserve 2018-07-20 08:33:41 +00:00
msan_new_delete.cc [MSan] Report proper error on allocator failures instead of CHECK(0)-ing 2018-06-08 23:31:42 +00:00
msan_origin.h [msan] Fix MsanTest to pass in track_origins=2 mode. 2015-02-26 15:19:33 +00:00
msan_poisoning.cc sanitizers: consistently check result of MmapFixedNoReserve 2018-07-20 08:33:41 +00:00
msan_poisoning.h
msan_report.cc [MSan] Report proper error on allocator failures instead of CHECK(0)-ing 2018-06-08 23:31:42 +00:00
msan_report.h [MSan] Report proper error on allocator failures instead of CHECK(0)-ing 2018-06-08 23:31:42 +00:00
msan_thread.cc [asan] Fix SanitizerCommon.PthreadDestructorIterations test on Android L. 2015-06-29 20:28:55 +00:00
msan_thread.h [compiler-rt] Apply modernize-use-nullptr fixes in sanitizers 2015-10-01 00:22:21 +00:00