Commit Graph

9766 Commits

Author SHA1 Message Date
Kamil Rytarowski 0699f57bc7 Support the localtime interceptor for NetBSD
Summary:
The localtime symbol is mangled to __locatime50
on NetBSD.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, vitalybuka

Reviewed By: vitalybuka

Subscribers: kubamracek, llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 323019
2018-01-20 00:40:29 +00:00
Kamil Rytarowski ada9d47cba Intercept accept4() on NetBSD
Summary:
The accept4() function first appeared in NetBSD 8.0.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, vitalybuka

Reviewed By: vitalybuka

Subscribers: llvm-commits, srhines, kubamracek, #sanitizers

Tags: #sanitizers

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

llvm-svn: 323018
2018-01-20 00:37:27 +00:00
Petar Jovanovic 6f10bd21f0 [TSan][MIPS] Expand sanitizer memory space to lower addresses
MemToShadowImpl() maps lower addresses to a memory space out of sanitizers
range. The simplest example is address 0 which is mapped to 0x2000000000

static const uptr kShadowBeg     = 0x2400000000ull;

but accessing the address during tsan execution will lead to a segmentation
fault.

This patch expands the range used by the sanitizer and ensures that 1/8 of
the maximum valid address in the virtual address spaces is used for shadow
memory.

Patch by Milos Stojanovic.

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

llvm-svn: 323013
2018-01-20 00:06:07 +00:00
Kostya Kortchinsky 0fb904325a [sanitizer] Allow Fuchsia to use getauxval
Summary:
Fuchsia has `getauxval` (https://fuchsia.googlesource.com/zircon/+/master/third_party/ulib/musl/include/sys/auxv.h,
https://fuchsia.googlesource.com/zircon/+/master/third_party/ulib/musl/src/misc/getauxval.c)
so set SANITIZER_USE_GETAUXVAL to 1 for this platform.

Reviewers: alekseyshl, flowerhack

Reviewed By: flowerhack

Subscribers: srhines, kubamracek, #sanitizers, llvm-commits

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

llvm-svn: 323002
2018-01-19 22:33:30 +00:00
Kostya Kortchinsky 5435b68a11 [scudo] Pass SANITIZER_COMMON_LINK_FLAGS to the shared library LINK_FLAGS
Summary:
We somehow never did it, and it raised no issue until now, when trying to
enable Fuchsia as a supported Scudo platform in the cmake config.

So propagate SANITIZER_COMMON_LINK_FLAGS for now.

Reviewers: alekseyshl, flowerhack

Reviewed By: flowerhack

Subscribers: mgorny, #sanitizers, llvm-commits

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

llvm-svn: 322999
2018-01-19 22:17:39 +00:00
Petr Hosek 76657a9c44 Reland "Make TracePcGuardController linker-initialized"
It was always intended to be.

Patch By: mcgrathr

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

llvm-svn: 322991
2018-01-19 21:14:53 +00:00
Kamil Rytarowski 2038405616 Correct typo after r322829
llvm-svn: 322947
2018-01-19 14:47:49 +00:00
Martin Pelikan 4834bca106 [XRay] [compiler-rt] fix heap overflow by computing record pointers correctly
Summary:
While there, unify InMemoryRawLog and InMemoryRawLogWithArg's coding style:
- swap libc's memcpy(3) for sanitizer's internal memcpy
- use basic pointer arithmetics to compute offsets from the first record
  entry in the pre-allocated buffer, which is always the appropriate type
  for the given function
- lose the local variable references as the TLD.* names fit just as well

Reviewers: eizan, kpw, dberris, dblaikie

Subscribers: #sanitizers, llvm-commits

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

llvm-svn: 322941
2018-01-19 13:18:40 +00:00
Martin Storsjo fe011a6ed9 [builtins] Use FlushInstructionCache on windows on aarch64 as well
Generalize this handling to a separate toplevel ifdef (since any
windows case should use the same function), instead of indenting
the aarch64 case one step further.

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

llvm-svn: 322928
2018-01-19 07:34:46 +00:00
Kostya Kortchinsky ab0d88746a [scudo] Use -fsanitize=scudo rather than --whole-archive in tests
Summary:
Tests were being run by whole-linking the static library with our test binaries.
But since `-fsanitize=scudo` landed with rL317337, we might as well change how
the tests are compiled to use it.

The only difference will be on Android, where the clang flag links in the
dynamic library instead, but the bots are already pushing
`libclang_rt.*-android.so` to the device there is no additional change needed.

Tested locally, including with a standalone build, and an Android one on a O
device, and it all passes.

Reviewers: alekseyshl

Reviewed By: alekseyshl

Subscribers: #sanitizers, llvm-commits

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

llvm-svn: 322882
2018-01-18 20:02:56 +00:00
Kamil Rytarowski ba91a689a1 Enable sanitizer_common tests on NetBSD
Summary:
NetBSD can handle asan, ubsan, msan, tsan tests
on 64-bit and when applicable 32-bit X86 OS.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, vitalybuka

Subscribers: srhines, llvm-commits, kubamracek, mgorny, #sanitizers

Tags: #sanitizers

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

llvm-svn: 322842
2018-01-18 11:49:45 +00:00
Kamil Rytarowski 124d5eb96e Break a line into two lines
This should restore the rule of <=80 characters per line.

llvm-svn: 322841
2018-01-18 11:38:10 +00:00
Kamil Rytarowski 878469cd82 Add new NetBSD interceptors: getgrouplist(3) & getgroupmembership(3)
Summary:
getgrouplist, getgroupmembership -- calculate group access list

Sponsored by <The NetBSD Foundation>

Reviewers: vitalybuka, joerg

Reviewed By: vitalybuka

Subscribers: llvm-commits, kubamracek, #sanitizers

Tags: #sanitizers

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

llvm-svn: 322836
2018-01-18 11:17:35 +00:00
Kamil Rytarowski 26370ddcd7 Add new interceptors: access(2), faccessat(2)
Summary:
access, faccessat - check access permissions of a file or pathname

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, vitalybuka

Reviewed By: vitalybuka

Subscribers: llvm-commits, kubamracek, #sanitizers

Tags: #sanitizers

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

llvm-svn: 322831
2018-01-18 11:04:25 +00:00
Kamil Rytarowski c815ed5792 Add new interceptors for pwcache(3)-style functions
Summary:
From <pwd.h>: user_from_uid, uid_from_user

From <grp.h>: group_from_gid, gid_from_group

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, vitalybuka

Reviewed By: vitalybuka

Subscribers: kubamracek, llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 322829
2018-01-18 10:53:27 +00:00
Alex Shlyapnikov dd77ed51e7 [Sanitizers] Changes in Hwasan allocator missed in D42198.
Converting a few failure handler calls missed in D42198.

llvm-svn: 322793
2018-01-18 00:23:46 +00:00
Alex Shlyapnikov fd2833992a [Sanitizers] Make common allocator agnostic to failure handling modes.
Summary:
Make common allocator agnostic to failure handling modes and move the
decision up to the particular sanitizer's allocator, where the context
is available (call stack, parameters, return nullptr/crash mode etc.)

It simplifies the common allocator and allows the particular sanitizer's
allocator to generate more specific and detailed error reports (which
will be implemented later).

The behavior is largely the same, except one case, the violation of the
common allocator's check for "size + alignment" overflow is now reportied
as OOM instead of "bad request". It feels like a worthy tradeoff and
"size + alignment" is huge in this case anyway (thus, can be interpreted
as not enough memory to satisfy the request). There's also a Report()
statement added there.

Reviewers: eugenis

Subscribers: kubamracek, llvm-commits, #sanitizers

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

llvm-svn: 322784
2018-01-17 23:20:36 +00:00
Kostya Kortchinsky 33802be579 [scudo] Fix for the Scudo interface function scope
Summary:
A forgotten include in `scudo_allocator.cpp` made the symbol only local :/

Before:
```
nm ./lib/clang/7.0.0/lib/linux/libclang_rt.scudo-i686-android.so | grep rss
00024730 t __scudo_set_rss_limit
```
After:
```
nm ./lib/clang/7.0.0/lib/linux/libclang_rt.scudo-i686-android.so | grep rs
00024760 T __scudo_set_rss_limit
```
And we want `T`!

This include also means that we can get rid of the `extern "C"` in the C++
file, the compiler does fine without it (note that this was already the case
for all the `__sanitizer_*` interface functions.

Reviewers: alekseyshl, eugenis

Reviewed By: eugenis

Subscribers: #sanitizers, llvm-commits

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

llvm-svn: 322782
2018-01-17 23:10:02 +00:00
Kostya Kortchinsky 255913b3a0 [scudo] Limit by default the TSD pool to 2 on Android
Summary:
jemalloc on Android currently uses 2 arenas
(https://android.googlesource.com/platform/external/jemalloc/+/master/Android.bp#64).
Since the Android toolchain absorbs compiler-rt and compiles it as is, we have
to enforce the same limit to somehow stay competitive in terms of memory usage.

The changes could either go in:
- `scudo_platform.h` with a default for Android of 2 (this is the solution
  implemented here);
- in `CMakeLists.txt` adding -DSCUDO_SHARED_TSD_POOL_SIZE=2 for Android.
- something else?

I don't have a strong opinion on how to do it, but it has to be done upstream
anyway.

Reviewers: alekseyshl, eugenis

Reviewed By: alekseyshl, eugenis

Subscribers: srhines, #sanitizers, llvm-commits

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

llvm-svn: 322764
2018-01-17 21:54:48 +00:00
Petr Hosek eac2b47b9f Reland "[libFuzzer] Support using libc++"
This is needed in case the users of libFuzzer use libc++ in their
code, which the fuzz target (libFuzzer) will be linked against.
When libc++ source is available, we build a private version of it
and link it against libFuzzer which allows using the same static
library against codebases which use both libc++ and libstdc++.

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

llvm-svn: 322755
2018-01-17 20:39:14 +00:00
Petr Hosek 68bc4bd6e5 Revert "[libFuzzer] Support using libc++"
This reverts commit r322604: test is failing for standalone compiler-rt.

llvm-svn: 322689
2018-01-17 17:24:56 +00:00
Kamil Rytarowski b87c8fa456 Add new interceptor: acct(2)
Summary:
acct - enable or disable process accounting

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, vitalybuka

Reviewed By: vitalybuka

Subscribers: kubamracek, llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 322646
2018-01-17 13:05:14 +00:00
Kamil Rytarowski 1628943978 Hotfix for test/asan/TestCases/alloca_constant_size.cc
Add missing endif.

llvm-svn: 322638
2018-01-17 12:32:17 +00:00
Kamil Rytarowski 3efd1c516c [Sanitizers, test] Fix sanitizer tests on Solaris (PR 33274)
Summary:
This patch (on top of the previous two (https://reviews.llvm.org/D40898 and
https://reviews.llvm.org/D40899) complete the compiler-rt side of the the Solaris
sanitizer port.

It contains the following sets of changes:

* For the time being, the port is for 32-bit x86 only, so reject the various tests on
  x86_64.

* When compiling as C++, <setjmp.h> resp. <iso/setjmp_iso.h> only declares
  _setjmp and _longjmp inside namespace std.

* MAP_FILE is a Windows feature.  While e.g. Linux <sys/mman.h> provides a
  no-op compat define, Solaris does not.

* test/asan/TestCases/Posix/coverage.cc was initially failing like this:

/vol/gcc/src/llvm/llvm/local/projects/compiler-rt/lib/sanitizer_common/scripts/sancov.py: 4 files merged; 2 PCs total
rm: cannot remove '/var/gcc/llvm/local/projects/compiler-rt/test/asan/I386SunOSConfig/TestCases/Posix/Output/coverage': Invalid argument

  Further digging revealed that the rm was trying to remove the running test's working
  directory which failed as observed.  cd'ing out of the dir before let the test pass.

* Two tests needed a declaration of alloca. I've now copied the existing code from
  test/asan/TestCases/alloca_constant_size.cc, but it may be more profitable and
  maintainable to have a common testsuite header where such code is collected.

* Similarly, Solaris' printf %p format doesn't include the leading 0x.

* In test/asan/TestCases/malloc-no-intercept.c, I had to undef __EXTENSIONS__
  (predefined by clang for no apparent reason) to avoid conflicting declarations
  for memalign.

* test/ubsan/TestCases/Float/cast-overflow.cpp has different platform dependent
  ways to define BYTE_ORDER and friends.  Why not just use __BYTE_ORDER__ and
  friends as predefined by clang and gcc?

Patch by Rainer Orth.

Reviewers: kcc, alekseyshl

Reviewed By: alekseyshl

Subscribers: srhines, kubamracek, mgorny, krytarowski, fedor.sergeev, JDevlieghere, llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 322635
2018-01-17 12:26:04 +00:00
Peter Collingbourne 7351a22b7d cfi: Add a blacklist entry for MSVC's std::get_temporary_buffer function.
Differential Revision: https://reviews.llvm.org/D42150

llvm-svn: 322607
2018-01-17 01:15:33 +00:00
Petr Hosek a1b57e694e [libFuzzer] Support using libc++
This is needed in case the users of libFuzzer use libc++ in their
code, which the fuzz target (libFuzzer) will be linked against.
When libc++ source is available, we build a private version of it
and link it against libFuzzer which allows using the same static
library against codebases which use both libc++ and libstdc++.

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

llvm-svn: 322604
2018-01-17 00:42:48 +00:00
Evgeniy Stepanov d96b06f2c2 [hwasan] Build runtime library with -fPIC, not -fPIE.
Summary: -fPIE can not be used when building a shared library.

Reviewers: alekseyshl, peter.smith

Subscribers: kubamracek, llvm-commits, mgorny

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

llvm-svn: 322588
2018-01-16 19:21:45 +00:00
Petr Hosek 77cfaca5f6 Reland "Install resource files into a share/ directory"
Currently these files are being installed into a root installation
directory, but this triggers an error when the installation directory
is set to an empty string which is often the case when DESTDIR is
used to control the installation destination.

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

llvm-svn: 322451
2018-01-14 03:43:14 +00:00
Francis Ricci 0a80f8924b [Sanitizers, LSan, Darwin] Allow for lack of VM_MEMORY_OS_ALLOC_ONCE
Summary:
Some time ago, the sanitizers as of r315899 were imported into gcc mainline.  This broke
bootstrap on Darwin 10 and 11, as reported in GCC PR sanitizer/82824
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82824) due to the unconditional use
of VM_MEMORY_OS_ALLOC_ONCE.  This was only introduced in Darwin 13/Mac OS X 10.9.

The use of the macro was introduced in r300450.

I couldn't find any statement which Darwin versions are supposed to be supported by
LLVM, but the trivial patch to use the macro only if present allowed the gcc bootstrap
to finish.

So far, I haven't tried building llvm/compiler-rt  on Darwin 11.  Maybe the patch is
simple enough to go in nonetheless.

Committing on behalf of ro.

Reviewers: glider, fjricci, kcc, kuba, kubamracek, george.karpenkov

Reviewed By: fjricci

Subscribers: #sanitizers, zaks.anna, srhines, dberris, kubamracek, llvm-commits

Tags: #sanitizers

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

llvm-svn: 322437
2018-01-13 14:43:49 +00:00
Evgeniy Stepanov 080e0d40b9 [hwasan] An LLVM flag to disable stack tag randomization.
Summary: Necessary to achieve consistent test results.

Reviewers: kcc, alekseyshl

Subscribers: kubamracek, llvm-commits, hiraditya

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

llvm-svn: 322429
2018-01-13 01:32:15 +00:00
Petr Hosek c2b340a5c6 Revert "[SanitizerCoverage][Fuchsia] Make TracePcGuardController linker-initialized"
This reverts commit r322424: this broke the tsan lint check.

llvm-svn: 322428
2018-01-13 00:56:28 +00:00
Petr Hosek 5bbba48752 [SanitizerCoverage][Fuchsia] Make TracePcGuardController linker-initialized
It was always intended to be.

Patch By: mcgrathr

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

llvm-svn: 322424
2018-01-13 00:29:49 +00:00
Kamil Rytarowski 4463ae4f6d Switch from Bourne shell to simply base shell to build libfuzzer
Summary: It is not necessary launching the build script with bash.

Reviewers: krytarowski

Reviewed By: krytarowski

Subscribers: llvm-commits, #sanitizers

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

llvm-svn: 322422
2018-01-12 23:45:24 +00:00
Matt Morehouse 59e4e400c3 [libFuzzer] Fix bug introduced in r322380 that always links -lc++.
llvm-svn: 322409
2018-01-12 22:10:47 +00:00
Kamil Rytarowski d6b30fffda Correct the setitimer interceptor on NetBSD
Summary:
itimerval can contain padding that may be legitimately uninitialized.

On NetBSD there are four integers of type "long, int, long, int", the
int argument stands for __sanitizer_suseconds_t. Compiler adds extra
padding in this layout.

Check every field of struct itimerval separately.

Define __sanitizer_suseconds_t as long on FreeBSD, Linux and SmartOS,
and int on NetBSD. Define __sanitizer_timeval and __sanitizer_itimerval.

Sponsored by <The NetBSD Foundation>

Reviewers: eugenis, joerg, vitalybuka

Reviewed By: vitalybuka

Subscribers: emaste, kubamracek, llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 322399
2018-01-12 20:45:56 +00:00
Kostya Kortchinsky 0bf9c5eee5 [scudo] Add SANITIZER_CXX_ABI_LIBRARY to SCUDO_DYNAMIC_LIBS
Summary:
This is needed for the shared runtime since we are pulling RTUbsan in.

Otherwise some builds might fail with errors such as:
`error: undefined reference to '__dynamic_cast'`

Reviewers: alekseyshl, srhines

Reviewed By: srhines

Subscribers: kongyi, pirama, chh, mgorny, llvm-commits, #sanitizers

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

llvm-svn: 322389
2018-01-12 18:45:30 +00:00
Kamil Rytarowski e81e944199 lib Fuzzer FreeBSD support
Summary: Patch by David CARLIER

Reviewers: vitalybuka, kcc, dim, emaste, davide, morehouse, george.karpenkov

Reviewed By: morehouse

Subscribers: george.karpenkov, kubamracek, srhines, mgorny, emaste, krytarowski

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

llvm-svn: 322380
2018-01-12 17:15:05 +00:00
Evgeniy Stepanov 99fa3e774d [hwasan] Stack instrumentation.
Summary:
Very basic stack instrumentation using tagged pointers.
Tag for N'th alloca in a function is built as XOR of:
 * base tag for the function, which is just some bits of SP (poor
   man's random)
 * small constant which is a function of N.

Allocas are aligned to 16 bytes. On every ReturnInst allocas are
re-tagged to catch use-after-return.

This implementation has a bunch of issues that will be taken care of
later:
1. lifetime intrinsics referring to tagged pointers are not
   recognized in SDAG. This effectively disables stack coloring.
2. Generated code is quite inefficient. There is one extra
   instruction at each memory access that adds the base tag to the
   untagged alloca address. It would be better to keep tagged SP in a
   callee-saved register and address allocas as an offset of that XOR
   retag, but that needs better coordination between hwasan
   instrumentation pass and prologue/epilogue insertion.
3. Lifetime instrinsics are ignored and use-after-scope is not
   implemented. This would be harder to do than in ASan, because we
   need to use a differently tagged pointer depending on which
   lifetime.start / lifetime.end the current instruction is dominated
   / post-dominated.

Reviewers: kcc, alekseyshl

Subscribers: srhines, kubamracek, javed.absar, hiraditya, llvm-commits

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

llvm-svn: 322324
2018-01-11 22:53:30 +00:00
Petr Hosek bf8751dc48 Revert "Install resource files into a share/ directory"
This reverts commit r322256: broke the dfsan build.

llvm-svn: 322261
2018-01-11 07:05:41 +00:00
Petr Hosek 17850f67ff Reland "Install resource files into a share/ directory"
Currently these files are being installed into a root installation
directory, but this triggers an error when the installation directory
is set to an empty string which is often the case when DESTDIR is
used to control the installation destination.

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

llvm-svn: 322256
2018-01-11 06:42:10 +00:00
Petr Hosek b00060137e Revert "Install resource files into a share/ directory"
This reverts commit r322234: this is breaking dfsan tests.

llvm-svn: 322243
2018-01-11 00:12:03 +00:00
Petr Hosek 5e9e86a538 Reland "Install resource files into a share/ directory"
Currently these files are being installed into a root installation
directory, but this triggers an error when the installation directory
is set to an empty string which is often the case when DESTDIR is
used to control the installation destination.

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

llvm-svn: 322234
2018-01-10 22:59:00 +00:00
Matt Morehouse f113deaa3c [MSan] Enable use-after-dtor instrumentation by default.
Summary:
Enable the compile-time flag -fsanitize-memory-use-after-dtor by
default. Note that the run-time option MSAN_OPTIONS=poison_in_dtor=1
still needs to be enabled for destructors to be poisoned.

Reviewers: eugenis, vitalybuka, kcc

Reviewed By: eugenis, vitalybuka

Subscribers: cfe-commits, llvm-commits

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

llvm-svn: 322221
2018-01-10 20:27:48 +00:00
Evgeniy Stepanov 29e3f5b722 [hwasan] An option to disable tag randomization.
Summary:
Avoid flaky test failures by by using a monotonic number sequence of
heap tags.

Does not affect stack tags: the way we generate those guarantees
uniqueness for at least 30-something first allocas in any function,
as well as the UAR tag.

Reviewers: alekseyshl, kcc

Subscribers: llvm-commits, kubamracek

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

llvm-svn: 322214
2018-01-10 19:36:10 +00:00
Petr Hosek 772aea2b91 Revert "[CMake] Install resource files into a share/ directory"
This reverts commit r322153 because it broke the sanitizer bots.

llvm-svn: 322156
2018-01-10 02:24:12 +00:00
Petr Hosek de4ed26b28 [CMake] Install resource files into a share/ directory
Currently these files are being installed into a root installation
directory, but this triggers an error when the installation directory
is set to an empty string which is often the case when DESTDIR is
used to control the installation destination.

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

llvm-svn: 322153
2018-01-10 02:12:22 +00:00
Stephan Bergmann 188fd220a7 o -fsanitize=function warning when calling noexcept function through non-noexcept pointer in C++17
As discussed in the mail thread <https://groups.google.com/a/isocpp.org/forum/
#!topic/std-discussion/T64_dW3WKUk> "Calling noexcept function throug non-
noexcept pointer is undefined behavior?", such a call should not be UB.
However, Clang currently warns about it.

This change removes exception specifications from the function types recorded
for -fsanitize=function, both in the functions themselves and at the call sites.
That means that calling a non-noexcept function through a noexcept pointer will
also not be flagged as UB.  In the review of this change, that was deemed
acceptable, at least for now.  (See the "TODO" in compiler-rt
test/ubsan/TestCases/TypeCheck/Function/function.cpp.)

This is the compiler-rt part of a patch covering both cfe and compiler-rt.

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

llvm-svn: 321860
2018-01-05 07:57:24 +00:00
Evgeniy Stepanov 8a86d017bb [asan] Fix build with Android NDK < 14.
NDK < 13 & API_LEVEL < 21 do not define struct mmsghdr.
Newer NDK use unified headers and provide this definition for all api
levels.

Since we can not check for the NDK version, check the api level. This
is more strict than absolutely necessary, but it does not really
matter: it is only a sanity check.

llvm-svn: 321817
2018-01-04 19:47:55 +00:00
Kostya Kortchinsky d30bea4559 [scudo] Attempt to re-enable the valloc test on armhf
Summary:
It used to fail on the bots, but I could not repro it locally. So turn it back
on to try and see if it still fails and maybe get to the heart of it.

Reviewers: alekseyshl, flowerhack

Reviewed By: alekseyshl

Subscribers: aemerson, srhines, kristof.beyls, llvm-commits, #sanitizers

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

llvm-svn: 321812
2018-01-04 18:35:28 +00:00
Kostya Kortchinsky 541c5a0797 [scudo] s/unsigned long/size_t/ for __scudo_set_rss_limit
Summary:
`__scudo_set_rss_limit`'s `LimitMb` should really be a `size_t`. Update
accordingly the prototype. To avoid the `NOLINT` and conform with the other
Sanitizers, use the sanitizers types for the internal definition. This should
have no functional change.

Additionally, capitalize a variable name to follow the LLVM coding standards.

Reviewers: alekseyshl, flowerhack

Reviewed By: alekseyshl

Subscribers: #sanitizers, llvm-commits

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

llvm-svn: 321803
2018-01-04 17:05:04 +00:00