summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/safestack
Commit message (Collapse)AuthorAgeFilesLines
* compiler-rt: Remove .cc from all lit config filesNico Weber2019-08-051-1/+1
| | | | | | All cc files have been renamed to cpp now. llvm-svn: 367911
* [compiler-rt] Rename lit.*.cfg.* -> lit.*.cfg.py.*Reid Kleckner2019-06-273-3/+3
| | | | | | | | | | | | | These lit configuration files are really Python source code. Using the .py file extension helps editors and tools use the correct language mode. LLVM and Clang already use this convention for lit configuration, this change simply applies it to all of compiler-rt. Reviewers: vitalybuka, dberris Differential Revision: https://reviews.llvm.org/D63658 llvm-svn: 364591
* compiler-rt tests: Unbreak cmake with LLVM_ENABLE_PIC=OFF on macNico Weber2019-01-161-9/+11
| | | | | | | | The LTO target doesn't exist with LLVM_ENABLE_PIC turned off. Differential Revision: https://reviews.llvm.org/D56800 llvm-svn: 351373
* SafeStack: Fix flaky test (PR39001)Vlad Tsyrklevich2018-09-211-8/+16
| | | | | | | | | | | | | | | | | | | | Summary: pthread_join() can return before a thread finishes exit()ing in the kernel and a subsequent tgkill() can report the thread still alive. Update the pthread-cleanup.c test to sleep and retry if it hits this possible flake. Thanks to Jeremy Morse for reporting. Reviewers: jmorse, eugenis, vitalybuka Reviewed By: jmorse, vitalybuka Subscribers: delcypher, jfb, llvm-commits, #sanitizers, kcc Differential Revision: https://reviews.llvm.org/D52330 llvm-svn: 342763
* SafeStack: Use correct unsafe stack sizesVlad Tsyrklevich2018-08-211-0/+53
| | | | | | | | | | | | | | | | | Summary: When deallocating thread stacks, we use one thread's unsafe stack size to deallocate another thread's unsafe stack; however, the two sizes may differ. Record an unsafe stack's size in the thread stack linked list. Reviewers: pcc, eugenis Reviewed By: eugenis Subscribers: delcypher, llvm-commits, #sanitizers, kcc Differential Revision: https://reviews.llvm.org/D51016 llvm-svn: 340308
* Reland "SafeStack: Delay thread stack clean-up""Vlad Tsyrklevich2018-08-141-8/+23
| | | | | | | | | | This relands commit r339405 (reverted in commit r339408.) The original revert was due to tests failing on a darwin buildbot; however, after looking at the affected code more I realized that the Darwin safestack support has always been broken and disabled it in r339719. This relands the original commit. llvm-svn: 339723
* SafeStack: Disable Darwin supportVlad Tsyrklevich2018-08-142-3/+1
| | | | | | | | | | | | | | | | | Summary: Darwin support does not appear to be used as evidenced by the fact that the pthread interceptors have never worked and there is no support for other common threading mechanisms like GCD. Reviewers: pcc, eugenis, kubamracek Reviewed By: pcc, kubamracek Subscribers: kubamracek, mgorny, delcypher, llvm-commits, #sanitizers, kcc Differential Revision: https://reviews.llvm.org/D50718 llvm-svn: 339719
* Revert "SafeStack: Delay thread stack clean-up"Vlad Tsyrklevich2018-08-101-23/+8
| | | | | | | | | This reverts commit r339405, it's failing on Darwin buildbots because it doesn't seem to have a tgkill/thr_kill2 interface. It has a __pthread_kill() syscall, but that relies on having a handle to the thread's port which is not equivalent to it's tid. llvm-svn: 339408
* SafeStack: Delay thread stack clean-upVlad Tsyrklevich2018-08-091-8/+23
| | | | | | | | | | | | | | | | | | Summary: glibc can call SafeStack instrumented code even after the last pthread data destructor has run. Delay cleaning-up unsafe stacks for threads until the thread is dead by having future threads clean-up prior threads stacks. Reviewers: pcc, eugenis Reviewed By: eugenis Subscribers: cryptoad, eugenis, kubamracek, delcypher, llvm-commits, #sanitizers, kcc Differential Revision: https://reviews.llvm.org/D50406 llvm-svn: 339405
* Factor out "stable-runtime" feature and enable it on all android.Evgeniy Stepanov2017-10-101-5/+0
| | | | | | | 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
* Enable SafeStack on NetBSDKamil Rytarowski2017-08-101-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* [Safestack] Fix the canary test to catch the libc's message regarding stack ↵Ivan A. Kosarev2017-05-101-1/+2
| | | | | | | | | | | | | | 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
* [cfi] Run tests with and without lld and thinlto.Evgeniy Stepanov2017-04-211-1/+1
| | | | | | | Run tests in all configurations: (standalone, with devirtualization) * (gold, lld) * (lto, thinlto) llvm-svn: 301016
* [asan] Enable -asan-use-private-alias on Darwin/Mach-O, add test for ODR ↵Kuba Brecka2016-09-141-1/+0
| | | | | | | | | | 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
* [compiler-rt] Fix VisualStudio virtual folders layoutEtienne Bergeron2016-07-111-1/+1
| | | | | | | | | | | | | | | | | | | | 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
* Replace hardcoded comment at 'lit.site.cfg.in'Alex Denisov2016-04-161-2/+1
| | | | | | | | | | | | 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
* [safestack] Fix stack canary test on Mac.Evgeniy Stepanov2016-04-121-2/+2
| | | | | | | Disable FORTIFY_SOURCE and explicitly disable stack protector in the no-stack-protector run. llvm-svn: 266106
* [safestack] A test for stackprotector canaries.Evgeniy Stepanov2016-04-111-0/+37
| | | | llvm-svn: 266006
* Ensure safestack overflow test doesn't segfaultDimitry Andric2016-01-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [compiler-rt] [safestack] Silent overflow.c test on aarch64Adhemerval Zanella2015-12-142-0/+7
| | | | | | | | | | | | 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
* SafeStack: XFAIL the pthread.c test on Darwin.Peter Collingbourne2015-06-161-0/+2
| | | | llvm-svn: 239841
* Protection against stack-based memory corruption errors using SafeStack: ↵Peter Collingbourne2015-06-1511-0/+235
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
OpenPOWER on IntegriCloud