| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
One of my changes [1] included in this release silently bumped the
minimal macOS SDK required for building the TSan runtime to SDK 10.12.
Let's ensure release 10 does not unexpectedly break builders with old
SDKs and add proper minimal SDK checking in CMake for subsequent
releases.
This fix `#ifdef`s out interceptors for newer APIs. Note that the
resulting TSan runtime is less complete: when these newer APIs are used
TSan will report false positives.
Fixes llvm 10 release blocker: #44682
https://bugs.llvm.org/show_bug.cgi?id=44682
[1] 894abb46f891cba2e0ef581650f27f512a7824b4
Reviewed By: dmajor
Differential Revision: https://reviews.llvm.org/D74059
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This skips calling `pthread_self` when `main_thread_identity` hasn't
been initialized yet. `main_thread_identity` is only ever assigned in
`__tsan::InitializePlatform`. This change should be relatively safe; we
are not changing behavior other than skipping the call to `pthread_self`
when `main_thread_identity == 0`.
rdar://57822138
Reviewed By: kubamracek
Differential Revision: https://reviews.llvm.org/D71559
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The flag allows the user to specify a maximum allocation size that the
sanitizers will honor. Any larger allocations will return nullptr or
crash depending on allocator_may_return_null.
Reviewers: kcc, eugenis
Reviewed By: kcc, eugenis
Subscribers: #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D69576
|
|
|
|
|
|
|
|
| |
This #define is in the non-Go ppc64le build but not in the Go build.
Reviewed-in: https://reviews.llvm.org/D68046
Author: randall77 (Keith Randall)
llvm-svn: 374868
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: eugenis, jfb
Subscribers: #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D68604
llvm-svn: 373978
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
All other stack trace callers assume that PC contains return address.
HWAsan already use GetNextInstructionPc in similar code.
PR43339
Reviewers: eugenis, kcc, jfb
Subscribers: dexonsmith, dberris, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D68313
llvm-svn: 373529
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
It's needed to use __GLIBC_PREREQ from <features.h>
tsan didn't let us to include <features.h> by using --sysroot=. to disable system includes on
anything that is not named as "tsan*posix*", "tsan*mac*", "tsan*linux*".
See compiler-rt/lib/tsan/CMakeLists.txt
Reviewers: eugenis, dvyukov, kcc
Reviewed By: kcc
Subscribers: mgorny, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D68176
llvm-svn: 373282
|
|
|
|
|
|
|
|
|
|
| |
Adding annotation function variants __tsan_write_range_pc and
__tsan_read_range_pc to annotate ranged access to memory while providing a
program counter for the access.
Differential Revision: https://reviews.llvm.org/D66885
llvm-svn: 372730
|
|
|
|
| |
llvm-svn: 371687
|
|
|
|
|
|
| |
https://github.com/cpplint/cpplint/commit/adb3500107f409ac5491188ae652ac3f4d03d9d3
llvm-svn: 371675
|
|
|
|
|
|
|
|
|
|
|
|
| |
I verified that the test is red without the interceptors.
rdar://40334350
Reviewed By: kubamracek, vitalybuka
Differential Revision: https://reviews.llvm.org/D66616
llvm-svn: 371439
|
|
|
|
| |
llvm-svn: 369601
|
|
|
|
| |
llvm-svn: 369314
|
|
|
|
|
|
|
| |
Rename file `tsan_libdispatch.cpp -> tsan_libdispatch_interceptors.cpp`
to make it clear that it's main purpose is defining interceptors.
llvm-svn: 369289
|
|
|
|
|
|
| |
This reverts commit 8191585b36eb4963002cce43fb2e79e7fb05c3d6.
llvm-svn: 369165
|
|
|
|
| |
llvm-svn: 369164
|
|
|
|
|
|
|
|
| |
The xpc_connection_* APIs that we are intercepting are available
starting at macOS 10.7. This is old enough so that we don't need to
guard them.
llvm-svn: 369150
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
It appears that since https://reviews.llvm.org/D54889, BackgroundThread()
crashes immediately because cur_thread()-> will return a null pointer
which is then dereferenced. I'm not sure why I only see this issue on
FreeBSD and not Linux since it should also be unintialized on other platforms.
Reviewers: yuri, dvyukov, dim, emaste
Subscribers: kubamracek, krytarowski, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D65705
llvm-svn: 368103
|
|
|
|
|
|
|
|
|
|
|
|
| |
in madvise mode, the shadow pages will be migrated only via madvise explicit calls.
Reviewers: vitalybuka
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D65775
llvm-svn: 368090
|
|
|
|
|
|
|
|
|
|
|
|
| |
Disabling Transparent huge page mode refactored in one function.
Reviewers: vitalybuka
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D65771
llvm-svn: 367925
|
|
|
|
| |
llvm-svn: 367888
|
|
|
|
| |
llvm-svn: 367589
|
|
|
|
|
|
| |
Like r367463, but for tsan/tests/{rtl,unit}.
llvm-svn: 367566
|
|
|
|
|
|
| |
Like r367463, but for tsan/rtl.
llvm-svn: 367564
|
|
|
|
|
|
|
| |
Cleanup ARM64 assembly after removing unnecessary computation of mangled
stack pointer in previous commit.
llvm-svn: 366258
|
|
|
|
|
|
|
| |
Remove now-unused assembly code for determining xor key on
Linux/AArch64. This is the final commit of this refactoring.
llvm-svn: 366225
|
|
|
|
| |
llvm-svn: 366150
|
|
|
|
| |
llvm-svn: 366131
|
|
|
|
|
|
|
| |
Switch over to computing the xor key in C, instead of assembly for
Linux/AArch64.
llvm-svn: 366126
|
|
|
|
|
|
| |
NFC.
llvm-svn: 365982
|
|
|
|
|
|
|
| |
This should fix the "undefined reference to
tsan::interception::real_setjmp" linker errors.
llvm-svn: 365806
|
|
|
|
| |
llvm-svn: 365707
|
|
|
|
| |
llvm-svn: 365693
|
|
|
|
| |
llvm-svn: 365681
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
pt.8"
Fix compilation errors related to `SANITIZER_GO` `#ifdef`s.
Refine longjmp key management. For Linux, re-implement key retrieval in
C (instead of assembly). Removal of `InitializeGuardPtr` and a final
round of cleanups will be done in the next commit.
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D64092
> llvm-svn: 365513
llvm-svn: 365560
|
|
|
|
|
|
| |
NFC.
llvm-svn: 365554
|
|
|
|
|
|
|
|
| |
pt.8"
This reverts commit 521f77e6351fd921f5a81027c7c72addca378989.
llvm-svn: 365534
|
|
|
|
|
|
|
|
|
|
|
|
| |
Refine longjmp key management. For Linux, re-implement key retrieval in
C (instead of assembly). Removal of `InitializeGuardPtr` and a final
round of cleanups will be done in the next commit.
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D64092
llvm-svn: 365513
|
|
|
|
| |
llvm-svn: 365415
|
|
|
|
|
|
| |
This reverts commit be4148062b155f3be52e0f6ebcb228f2dc137dcf.
llvm-svn: 365367
|
|
|
|
|
|
|
|
| |
pt.4"
This reverts commit 6bb13da7c16f2a677cc285bb6ffeb79dfb0cfe64.
llvm-svn: 365244
|
|
|
|
|
|
|
|
|
|
| |
Remove unnecessary computation of mangled SP for ARM64 architecture.
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D64022
llvm-svn: 365230
|
|
|
|
|
|
|
|
|
|
|
| |
For x86_64, since we don't clobber %rsi (2nd argument) anymore, we don't
have to save/restore it.
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D63946
llvm-svn: 365229
|
|
|
|
|
|
|
|
|
|
|
| |
Factor out `ExtractLongJmpSp` helper function and move platform-specific
code to tsan_platform_{linux,mac}.cc.
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D64050
llvm-svn: 364947
|
|
|
|
|
|
|
|
|
|
| |
Remove unnecessary computation of mangled SP for x86_64 architecture.
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D63944
llvm-svn: 364874
|
|
|
|
|
|
|
|
|
|
|
|
| |
Avoid the following warning which fails a bot (via -Werror).
```
/tmp/gotsan.JfrpVPu7pG/gotsan.cc:10456:25: error: ‘_tsan_pointer_chk_guard’ initialized and declared ‘extern’ [-Werror]
extern "C" __tsan::uptr _tsan_pointer_chk_guard = 0;
^~~~~~~~~~~~~~~~~~~~~~~
```
llvm-svn: 364823
|
|
|
|
|
|
|
|
|
|
|
|
| |
Switch `LongJmp` over to lookup JmpBuf via plain old (unmangled) SP.
This makes the computation of mangled SPs in the TSan assembly files
unnecessary, which will be cleaned up in follow-up revisions.
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D63942
llvm-svn: 364818
|
|
|
|
|
|
| |
Introduced in 5be69ebe121d5b6ea284c3dc6d1cd5098c94f353.
llvm-svn: 364700
|
|
|
|
|
|
| |
Introduced in 5be69ebe121d5b6ea284c3dc6d1cd5098c94f353.
llvm-svn: 364676
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TSan needs to infer which calls to setjmp/longjmp are corresponding
pairs. My understanding is, that we can't simply use the jmp_buf
address, since this buffer is just a plain data structure storing the
environment (registers) with no additional semantics, i.e., it can be
copied around and is still expected to work. So we use the stack pointer
(SP) instead.
The setjmp interceptor stores some metadata, which is then consumed in
the corresponding call to longjmp. We use the SP as an "index" (stable
identifier) into the metadata table. So far so good.
However, when mangling is used, the setjmp interceptor observes the
UNmangled SP, but the longjmp interceptor only knows the mangled value
for SP. To still correlate corresponding pairs of calls, TSan currently
derives the mangled representation in setjmp and uses it as the stable
identifer, so that longjmp can do it's lookup.
Currently, this works since "mangling" simply means XOR with a secret
value. However, in the future we want to use operations that do not
allow us to easily go from unmangled -> mangled (pointer
authentication). Going from mangled -> unmangled should still be
possible (for pointer authentication it means zeroing a few bits).
This patch is part 1 of changing set/longjmp interceptors to use the
unmangled SP for metadata lookup. Instead of deriving the mangled SP in
setjmp, we will derive the unmangled SP in longjmp. Since this change
involves difficult-to-test code, it will be done in (at least) 2 parts:
This patch only replicates the existing behavior and checks that the
newly computed value for SP matches with what we have been doing so far.
This should help me to fix issues on architectures I cannot test
directly. I tested this patch on x86-64 (Linux/Darwin) and arm64
(Darwin).
This patch will also address an orthogonal issue: there is a lot of code
duplication in the assembly files, because the
`void __tsan_setjmp(uptr sp, uptr mangled_sp)` already demands the
mangled SP. This means that the code for computing the mangled SP is
duplicated at every call site (in assembly).
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D60981
llvm-svn: 364662
|