summaryrefslogtreecommitdiff
path: root/test/safestack/overflow.c
AgeCommit message (Collapse)Author
2016-01-07Ensure safestack overflow test doesn't segfaultDimitry Andric
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257106 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-14[compiler-rt] [safestack] Silent overflow.c test on aarch64Adhemerval Zanella
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255491 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-15Protection against stack-based memory corruption errors using SafeStack: ↵Peter Collingbourne
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@239763 91177308-0d34-0410-b5e6-96231b3b80d8