Commit Graph

13 Commits

Author SHA1 Message Date
Evgeniy Stepanov 0bf7717a02 Factor out "stable-runtime" feature and enable it on all android.
This is a very poorly named feature. I think originally it meant to cover linux only, but the use of it in msan
seems to be about any aarch64 platform. Anyway, this change should be NFC on everything except Android.

llvm-svn: 315389
2017-10-10 23:37:26 +00:00
Kamil Rytarowski fbd51b954d Enable SafeStack on NetBSD
Summary:
make check-safestack:

-- Testing: 8 tests, 8 threads --
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
Testing Time: 0.44s
  Expected Passes    : 7
  Unsupported Tests  : 1

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, vitalybuka, kcc, fjricci, filcab

Reviewed By: vitalybuka

Subscribers: mgorny, llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 310646
2017-08-10 18:40:09 +00:00
Ivan A. Kosarev e73af512a6 [Safestack] Fix the canary test to catch the libc's message regarding stack smashing
By default glibc writes its diagnostics directly to tty so the `2>&1 |`
redirection in the test doesn't catch the *** stack smashing detected ***
message, which in turn breaks printing the lit's progress bar. By defining
the LIBC_FATAL_STDERR_ environment variable we force glibc to direct
diagnostic messages to stderr.

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

llvm-svn: 302628
2017-05-10 08:06:42 +00:00
Evgeniy Stepanov ca32b682f6 [cfi] Run tests with and without lld and thinlto.
Run tests in all configurations:
(standalone, with devirtualization) * (gold, lld) * (lto, thinlto)

llvm-svn: 301016
2017-04-21 18:11:23 +00:00
Kuba Brecka 410dbbd296 [asan] Enable -asan-use-private-alias on Darwin/Mach-O, add test for ODR false positive with LTO (compiler-rt part)
The '-asan-use-private-alias’ option (disabled by default) option is currently only enabled for Linux and ELF, but it also works on Darwin and Mach-O. This option also fixes a known problem with LTO on Darwin (https://github.com/google/sanitizers/issues/647). This patch enables the support for Darwin (but still keeps it off by default) and adds the LTO test case.

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

llvm-svn: 281472
2016-09-14 14:09:18 +00:00
Etienne Bergeron ab42f4ddba [compiler-rt] Fix VisualStudio virtual folders layout
Summary:
This patch is a refactoring of the way cmake 'targets' are grouped.
It won't affect non-UI cmake-generators.

Clang/LLVM are using a structured way to group targets which ease
navigation through Visual Studio UI. The Compiler-RT projects
differ from the way Clang/LLVM are grouping targets.

This patch doesn't contain behavior changes.

Reviewers: kubabrecka, rnk

Subscribers: wang0109, llvm-commits, kubabrecka, chrisha

Differential Revision: http://reviews.llvm.org/D21952

llvm-svn: 275111
2016-07-11 21:51:56 +00:00
Alex Denisov a3f5c4c047 Replace hardcoded comment at 'lit.site.cfg.in'
At the moment almost every lit.site.cfg.in contains two lines comment:

  ## Autogenerated by LLVM/Clang configuration.
  # Do not edit!

The patch adds variable LIT_SITE_CFG_IN_HEADER, that is replaced from
configure_lit_site_cfg with the note and some useful information.

llvm-svn: 266520
2016-04-16 07:03:45 +00:00
Evgeniy Stepanov 691ef096d0 [safestack] Fix stack canary test on Mac.
Disable FORTIFY_SOURCE and explicitly disable stack protector in the
no-stack-protector run.

llvm-svn: 266106
2016-04-12 18:48:41 +00:00
Evgeniy Stepanov ddb499a453 [safestack] A test for stackprotector canaries.
llvm-svn: 266006
2016-04-11 22:28:13 +00:00
Dimitry Andric 6e8526358f Ensure safestack overflow test doesn't segfault
Summary:
In rL255491, the safestack overflow test was disabled for aarch64, since
it "is currently failing on an AArch64 buildbot with a segfault, but it
is currently passing on other configuration".

While testing on FreeBSD on x86, I also encountered a segfault.  This is
because the `fct()` function actually writes before and after `buffer`,
and on FreeBSD this crashes because `buffer` is usually allocated at the
end of a page.  That this runs correctly on Linux is probably just by
accident.

I propose to fix this by adding a pre and post buffer, to act as a
safety zone.  The pre and post buffers must be accessed in an 'unsafe'
way, otherwise -fsanitize=safestack will allocate them on the safe
stack, and they will not bookend `buffer` itself.  Therefore, I create
them large enough for `fct()`, and call it on both of them.

On FreeBSD, this makes the test run as expected, without segfaulting,
and I suppose this will also fix the segfault on AArch64.  I do not have
AArch64 testing capabilities, so if someone could try that out, I would
be much obliged.

Reviewers: pcc, kcc, zatrazz

Subscribers: llvm-commits, aemerson, emaste

Differential Revision: http://reviews.llvm.org/D15725

llvm-svn: 257106
2016-01-07 22:19:12 +00:00
Adhemerval Zanella c974545cde [compiler-rt] [safestack] Silent overflow.c test on aarch64
The safestack overflow.c test is currently failing on an aarch64
buildbot with a segfault, but it is currently passing on other
configuration.

This patch silent the issue for now on aarch64 by setting to all
supported architectures the 'stable-runtime' configure and set
the test to requires it.

llvm-svn: 255491
2015-12-14 11:58:43 +00:00
Peter Collingbourne 187bfddb12 SafeStack: XFAIL the pthread.c test on Darwin.
llvm-svn: 239841
2015-06-16 18:52:31 +00:00
Peter Collingbourne b64d0b1e6d Protection against stack-based memory corruption errors using SafeStack: compiler-rt runtime support library
This patch adds runtime support for the Safe Stack protection to compiler-rt
(see http://reviews.llvm.org/D6094 for the detailed description of the
Safe Stack).

This patch is our implementation of the safe stack on top of compiler-rt. The
patch adds basic runtime support for the safe stack to compiler-rt that
manages unsafe stack allocation/deallocation for each thread.

Original patch by Volodymyr Kuznetsov and others at the Dependable Systems
Lab at EPFL; updates and upstreaming by myself.

Differential Revision: http://reviews.llvm.org/D6096

llvm-svn: 239763
2015-06-15 21:08:47 +00:00