| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@368242 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
|
| |
HWASan+globals build fix in rL368111 unfortunately didn't fix the
problem when clang_cflags specified -fuse-ld=ld.gold. Change the order
to force lld in an attempt to fix the Android sanitizer bot.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@368218 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
|
| |
We're using relocations that are unsupported by the version of gold on the
bot, so force the use of lld. One of the tests is already using lld,
so this should be safe.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@368111 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@368103 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Globals are instrumented by adding a pointer tag to their symbol values
and emitting metadata into a special section that allows the runtime to tag
their memory when the library is loaded.
Due to order of initialization issues explained in more detail in the comments,
shadow initialization cannot happen during regular global initialization.
Instead, the location of the global section is marked using an ELF note,
and we require libc support for calling a function provided by the HWASAN
runtime when libraries are loaded and unloaded.
Based on ideas discussed with @evgeny777 in D56672.
Differential Revision: https://reviews.llvm.org/D65770
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@368102 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Straightforward implementation of `getrandom` syscall and libc
hooks.
Test Plan: Local MSAN failures caused by uninstrumented `getrandom`
calls stop failing.
Patch by Andrew Krieger.
Reviewers: eugenis, vitalybuka
Reviewed By: vitalybuka
Subscribers: srhines, kubamracek, dberris, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D65551
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367999 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
|
|
|
|
|
| |
Once we start instrumenting globals, all addresses including those of string literals
that we pass to the operating system will start being tagged. Since we can't rely
on the operating system to be able to cope with these addresses, we need to untag
them before passing them to the operating system. This change introduces a macro
that does so and uses it everywhere it is needed.
Differential Revision: https://reviews.llvm.org/D65768
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367938 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
| |
All cc files have been renamed to cpp now.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367911 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
| |
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367888 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
| |
See r367803 and similar other changes.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367887 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
| |
See r367803 and similar other changes.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367863 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
| |
See r367803 and similar other changes.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367858 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
| |
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367856 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
| |
See r367803 and similar other changes.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367855 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
| |
See r367849 et al.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367854 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
| |
Should've been part of r367849.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367851 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
| |
Like r367463, but for test/hwasan.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367849 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
| |
Like r367463, but for test/lsan.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367803 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
| |
Like r367463, but for test/tsan.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367656 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
| |
Like r367463, but for test/msan.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367653 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
|
|
| |
Like r367463, but for test/xray.
Update test/xray/lit.cfg.py config.suffixes to remove .cc (we actually
don't have .c tests now)
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367652 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
| |
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367587 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
| |
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367586 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
| |
Like r367463, but for tsan/rtl.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367564 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
| |
Like r367463, but for msan.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367562 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
| |
Like r367463, but for asan.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367558 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
|
|
|
|
|
| |
See https://reviews.llvm.org/D58620 for discussion, and for the commands
I ran. In addition I also ran
for f in $(svn diff | diffstat | grep .cc | cut -f 2 -d ' '); do rg $f . ; done
and manually updated (many) references to renamed files found by that.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367463 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
|
|
|
|
|
| |
See https://reviews.llvm.org/D58620 for discussion, and for the commands
I ran. In addition I also ran
for f in $(svn diff | diffstat | grep .cc | cut -f 2 -d ' '); do rg $f . ; done
and manually updated references to renamed files found by that.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367452 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
MSAN was broken on FreeBSD by https://reviews.llvm.org/D55703: after this
change accesses to the key variable call __tls_get_addr, which is
intercepted. The interceptor then calls GetCurrentThread which calls
MsanTSDGet which again calls __tls_get_addr, etc...
Using the default implementation in the SANITIZER_FREEBSD case fixes MSAN
for me.
I then applied the same change to ASAN (introduced in https://reviews.llvm.org/D55596)
but that did not work yet. In the ASAN case, we get infinite recursion
again during initialization, this time because calling pthread_key_create() early on
results in infinite recursion. pthread_key_create() calls sysctlbyname()
which is intercepted but COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED returns
true, so the interceptor calls internal_sysctlbyname() which then ends up
calling the interceptor again. I fixed this issue by using dlsym() to get
the libc version of sysctlbyname() instead.
This fixes https://llvm.org/PR40761
Reviewers: vitalybuka, krytarowski, devnexen, dim, bsdjhb, #sanitizers, MaskRay
Reviewed By: MaskRay
Subscribers: MaskRay, emaste, kubamracek, jfb, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D65221
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367442 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Two SPARC builtins tests are currently FAILing due to codegen bugs:
Builtins-sparc-sunos :: divtc3_test.c
Builtins-sparcv9-sunos :: compiler_rt_logbl_test.c
Builtins-sparcv9-sunos :: divtc3_test.c
I'd like to XFAIL them to reduce testsuite noise.
Done as follows, tested on sparcv9-sun-solaris2.11 and x86_64-pc-solaris2.11.
Differential Revision: https://reviews.llvm.org/D64796
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367295 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TestCases/intercept-rethrow-exception.cc on Solaris
AddressSanitizer-*-sunos :: TestCases/intercept-rethrow-exception.cc currently FAILs
on Solaris. This happens because std::rethrow_exception cannot be intercepted, as
detailed in Bug 42703.
To account for this and reduce testsuite noise, this patch XFAILs the test.
Tested on x86_64-pc-solaris2.11.
Differential Revision: https://reviews.llvm.org/D65056
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@367293 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
|
|
| |
Under certain execution conditions, the `not` command binds to the command the
output is piped to rather than the command piping the output. In this case, that
flips the return code of the FileCheck invocation, causing a failure when
FileCheck succeeds.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366805 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
|
|
| |
These tests *do not* work on device, but they *do* work in the
simulator.
rdar://53403778
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366738 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix llvm#39641
Recommit of r366413
Differential Revision: https://reviews.llvm.org/D63877
llvm-svn: 366632
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366638 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
|
| |
This reverts commit cbd28cd05bb11e9d76d71c6cc2d38d89dbb1fe1a.
Buildbot fail: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/22434/steps/64-bit%20check-asan-dynamic/
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366634 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
|
|
|
| |
Fix llvm#39641
Recommit of r366413
Differential Revision: https://reviews.llvm.org/D63877
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366632 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
|
| |
This reverts commit 8e46275488ca453a24964cb26be0736172ad1db8.
This was failing on sanitizer-x86_64-linux and our internal CI.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366618 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
|
|
|
| |
Fix llvm#39641
Recommit of r366413
Differential Revision: https://reviews.llvm.org/D63877
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366588 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
| |
Incomplete revert. Mea culpa. This test is failing on sanitizer-x86_64-linux
and our internal CI.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366482 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
| |
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366436 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
| |
This should fix failed detection on aarch64/ppc64/thumbv8...
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366432 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
|
| |
Fix llvm#39641
Differential Revision: https://reviews.llvm.org/D63877
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366413 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It turns out that this test was only passing by accident. It was relying on
the optimizer to remove the only reference to A's vtable by realizing that
the CFI check will always fail. The vtable contains a reference to RTTI in
libc++, which will be unresolved because the C driver won't link against it.
This was found by my prototype implementation of HWASAN for globals, which
happens to end up preserving the reference.
Differential Revision: https://reviews.llvm.org/D64890
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366389 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Darwin, the man page states that "both fputs() and puts() print
`(null)' if str is NULL."
rdar://48227136
Reviewed By: Lekensteyn
Differential Revision: https://reviews.llvm.org/D64773
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366342 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
i.e., recent 5745eccef54ddd3caca278d1d292a88b2281528b:
* Bump the function_type_mismatch handler version, as its signature has changed.
* The function_type_mismatch handler can return successfully now, so
SanitizerKind::Function must be AlwaysRecoverable (like for
SanitizerKind::Vptr).
* But the minimal runtime would still unconditionally treat a call to the
function_type_mismatch handler as failure, so disallow -fsanitize=function in
combination with -fsanitize-minimal-runtime (like it was already done for
-fsanitize=vptr).
* Add tests.
Differential Revision: https://reviews.llvm.org/D61479
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366186 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
| |
This crashes sporadically on our AArch64 buildbots. Disable for now.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366055 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch enables compiler-rt on SPARC targets. Most of the changes are straightforward:
- Add 32 and 64-bit sparc to compiler-rt
- lib/builtins/fp_lib.h needed to check if the int128_t and uint128_t types exist (which they don't on sparc)
There's one issue of note: many asan tests fail to compile on Solaris/SPARC:
fatal error: error in backend: Function "_ZN7testing8internal16BoolFromGTestEnvEPKcb": over-aligned dynamic alloca not supported.
Therefore, while asan is still built, both asan and ubsan-with-asan testing is disabled. The
goal is to check if asan keeps compiling on Solaris/SPARC. This serves asan in gcc,
which doesn't have the problem above and works just fine.
With this patch, sparcv9-sun-solaris2.11 test results are pretty good:
Failing Tests (9):
Builtins-sparc-sunos :: divtc3_test.c
Builtins-sparcv9-sunos :: compiler_rt_logbl_test.c
Builtins-sparcv9-sunos :: divtc3_test.c
[...]
UBSan-Standalone-sparc :: TestCases/TypeCheck/misaligned.cpp
UBSan-Standalone-sparcv9 :: TestCases/TypeCheck/misaligned.cpp
The builtin failures are due to Bugs 42493 and 42496. The tree contained a few additonal
patches either currently in review or about to be submitted.
Tested on sparcv9-sun-solaris2.11.
Differential Revision: https://reviews.llvm.org/D40943
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365880 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D64526
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365863 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
There's no real reason to use clang-cl on Windows, the clang driver
works just as well. This fixes a test which uses the -O0 flag, which was
recently removed from clang-cl to match MSVC, which lacks this flag.
While I'm here, remove the explicit -std=c++11 flag. Previously, this
flag was necessary when the default C++ standard was C++98. Now that the
default is C++14, this is no longer necessary. It's problematic on
Windows, because the Visual C++ standard library relies on C++14
features, and attempting to compile it with C++11 results in errors.
Rather than adding logic to conditionally set the standard to C++11 only
on non-Win, this flag can be removed.
See http://lab.llvm.org:8011/builders/clang-x64-windows-msvc and
https://reviews.llvm.org/D64506.
Reviewers: morehouse, thakis
Subscribers: #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D64587
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365841 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While working on https://reviews.llvm.org/D40900 (which effectively is about enabling compiler-rt on sparc these days), I came across two failing profile testcases:
Profile-sparc :: instrprof-merge-match.test
Profile-sparc :: instrprof-merge.c
Profile-sparcv9 :: instrprof-merge-match.test
Profile-sparcv9 :: instrprof-merge.c
All of them crashed with a SIGBUS in __llvm_profile_merge_from_buffer:
Thread 2 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1 (LWP 1)]
0x00012368 in __llvm_profile_merge_from_buffer (
ProfileData=0x2384c <main.Buffer> "\377lprofR\201", ProfileSize=360)
at /vol/llvm/src/llvm/local/projects/compiler-rt/lib/profile/InstrProfilingMerge.c:95
95 SrcDataEnd = SrcDataStart + Header->DataSize;
where Header is insufficiently aligned for a strict-alignment target like SPARC.
Fixed by forcing the alignment to uint64_t, the members of struct __llvm_profile_header,
in the callers.
Tested on sparcv9-sun-solaris2.11.
https://reviews.llvm.org/D64498
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@365805 91177308-0d34-0410-b5e6-96231b3b80d8
|