summaryrefslogtreecommitdiff
path: root/lib/ubsan/ubsan_platform.h
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@351636 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Trivial portion of the port to Myriad RTEMSWalter Lee2018-05-181-1/+1
| | | | | | | | | | | | | | | | | | | | | This commit contains the trivial portion of the port of ASan to Myriad RTEMS. - Whitelist platform in sanitizer_platform.h, ubsan_platform.h - Turn off general interception - Use memset for FastPoisonShadow - Define interception wrappers - Set errno symbol correctly - Enable ASAN_LOW_MEMORY - Enable preinit array - Disable slow unwinding - Use fuchsia offline symbolizer - Disable common code for: InitializeShadowMemory, CreateMainThread, AsanThread::ThreadStart, StartReportDeadlySignal, MaybeReportNonExecRegion. Differential Revision: https://reviews.llvm.org/D46454 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@332681 91177308-0d34-0410-b5e6-96231b3b80d8
* OpenBSD UBsan support / ubsan partKamil Rytarowski2018-03-021-1/+2
| | | | | | | | | | | | | | | | | Summary: UBsan, enable OpenBSD platform Patch by: David CARLIER Reviewers: krytarowski, kettenis, visa, vitalybuka Reviewed By: vitalybuka Subscribers: kubamracek, fedor.sergeev, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D43894 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326543 91177308-0d34-0410-b5e6-96231b3b80d8
* Recognize all NetBSD architectures in UBSanKamil Rytarowski2018-02-171-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Use uniform accessors for Program Pointer, Stack Pointer and Frame Pointer. Remove CPU check in UBSan supported platforms and rely only on the OS type. This adds NetBSD support in GetPcSpBp() for: - ARM - ARM64 - HPPA - PowerPC/PowerPC64 - SPARC/SPARC64 - MIPS - DEC Alpha AXP - DEC VAX - M68K and M68010 - SH3 - IA64 - OR1K - RISCV Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, ro Reviewed By: vitalybuka Subscribers: aemerson, jyknight, sdardis, kubamracek, arichardson, llvm-commits, kristof.beyls, fedor.sergeev, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D43021 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325431 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizers] Basic sanitizer Solaris support (PR 33274)Kamil Rytarowski2017-12-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is the first mostly working version of the Sanitizer port to 32-bit Solaris/x86. It is currently based on Solaris 11.4 Beta. This part was initially developed inside libsanitizer in the GCC tree and should apply to both. Subsequent parts will address changes to clang, the compiler-rt build system and testsuite. I'm not yet sure what the right patch granularity is: if it's profitable to split the patch up, I'd like to get guidance on how to do so. Most of the changes are probably straightforward with a few exceptions: * The Solaris syscall interface isn't stable, undocumented and can change within an OS release. The stable interface is the libc interface, which I'm using here, if possible using the internal _-prefixed names. * While the patch primarily target 32-bit x86, I've left a few sparc changes in. They cannot currently be used with clang due to a backend limitation, but have worked fine inside the gcc tree. * Some functions (e.g. largefile versions of functions like open64) only exist in 32-bit Solaris, so I've introduced a separate SANITIZER_SOLARIS32 to check for that. The patch (with the subsequent ones to be submitted shortly) was tested on i386-pc-solaris2.11. Only a few failures remain, some of them analyzed, some still TBD: AddressSanitizer-i386-sunos :: TestCases/Posix/concurrent_overflow.cc AddressSanitizer-i386-sunos :: TestCases/init-order-atexit.cc AddressSanitizer-i386-sunos :: TestCases/log-path_test.cc AddressSanitizer-i386-sunos :: TestCases/malloc-no-intercept.c AddressSanitizer-i386-sunos-dynamic :: TestCases/Posix/concurrent_overflow.cc AddressSanitizer-i386-sunos-dynamic :: TestCases/Posix/start-deactivated.cc AddressSanitizer-i386-sunos-dynamic :: TestCases/default_options.cc AddressSanitizer-i386-sunos-dynamic :: TestCases/init-order-atexit.cc AddressSanitizer-i386-sunos-dynamic :: TestCases/log-path_test.cc AddressSanitizer-i386-sunos-dynamic :: TestCases/malloc-no-intercept.c SanitizerCommon-Unit :: ./Sanitizer-i386-Test/MemoryMappingLayout.DumpListOfModules SanitizerCommon-Unit :: ./Sanitizer-i386-Test/SanitizerCommon.PthreadDestructorIterations Maybe this is good enough the get the ball rolling. Reviewers: kcc, alekseyshl Reviewed By: alekseyshl Subscribers: srhines, jyknight, kubamracek, krytarowski, fedor.sergeev, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40898 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320740 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable ubsan on NetBSDKamil Rytarowski2017-08-081-3/+4
| | | | | | | | | | | | | | | | | | | Summary: Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, kcc, filcab, fjricci Reviewed By: fjricci Subscribers: srhines, kubamracek, mgorny, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36483 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@310412 91177308-0d34-0410-b5e6-96231b3b80d8
* [ubsan] Enable UBSan build for FuchsiaVitaly Buka2017-08-011-1/+1
| | | | | | | | | | | | | | | | Submitted on behalf of Roland McGrath. Reviewers: vitalybuka, alekseyshl, kcc Reviewed By: vitalybuka Subscribers: srhines, kubamracek, mgorny, phosek, filcab, llvm-commits Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36033 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309742 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] [SystemZ] Enable UBSan.Marcin Koscielnicki2016-04-151-1/+2
| | | | | | | | | sanitizer_common is now in good enough shape on s390x to support UBSan - all tests passing. Let's enable it. Differential Revision: http://reviews.llvm.org/D19157 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266483 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-apply r241217 with build fixes:Peter Collingbourne2015-07-021-0/+2
| | | | | | | - Disable building of the interceptor library on 64-bit Windows. - Mangle names in /alternatename directive for 32-bit Windows. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@241224 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r241217, it breaks the build on Windows.Nico Weber2015-07-021-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@241219 91177308-0d34-0410-b5e6-96231b3b80d8
* ubsan: Port runtime library to (32- and 64-bit) Windows.Peter Collingbourne2015-07-021-0/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D10856 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@241217 91177308-0d34-0410-b5e6-96231b3b80d8
* [UBSan] Embed UBSan into ASan runtime (compiler-rt part).Alexey Samsonov2015-04-011-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Change the way we use ASan and UBSan together. Instead of keeping two separate runtimes (libclang_rt.asan and libclang_rt.ubsan), embed UBSan into ASan and get rid of libclang_rt.ubsan. If UBSan is not supported on a platform, all UBSan sources are just compiled into dummy empty object files. UBSan initialization code (e.g. flag parsing) is directly called from ASan initialization, so we are able to enforce correct initialization order. This mirrors the approach we already use for ASan+LSan. This change doesn't modify the way we use standalone UBSan. Test Plan: regression test suite Reviewers: kubabrecka, zaks.anna, rsmith, kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D8646 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@233861 91177308-0d34-0410-b5e6-96231b3b80d8
* [PPC64]This activates UBSan for the power architecture.Bill Seurer2015-04-011-1/+1
| | | | | | | | | | One test case is updated to allow for differences between power and other architectures in behavior when returning from main in certain instances http://reviews.llvm.org/D8743 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@233813 91177308-0d34-0410-b5e6-96231b3b80d8
* [UBSan] Explicitly list all supported OS/arch pairs supported by UBSan.Alexey Samsonov2015-03-261-0/+26
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@233295 91177308-0d34-0410-b5e6-96231b3b80d8