summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/hwasan/hwasan_thread.h
Commit message (Collapse)AuthorAgeFilesLines
* [HWASAN] Remove unused codeEugene Leviant2019-05-291-5/+0
| | | | | | Differential revision: https://reviews.llvm.org/D62489 llvm-svn: 361942
* [hwasan, asan] Intercept vfork.Evgeniy Stepanov2019-02-271-0/+3
| | | | | | | | | | | | | | | Summary: Intercept vfork on arm, aarch64, i386 and x86_64. Reviewers: pcc, vitalybuka Subscribers: kubamracek, mgorny, javed.absar, krytarowski, kristof.beyls, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58533 llvm-svn: 355030
* Revert "[asan] Fix vfork handling.", +1Evgeniy Stepanov2019-02-211-3/+0
| | | | | | Revert r354625, r354627 - multiple build failures. llvm-svn: 354629
* [hwasan,asan] Intercept vfork.Evgeniy Stepanov2019-02-211-0/+3
| | | | | | | | | | | | | | Summary: AArch64 only for now. Reviewers: vitalybuka, pcc Subscribers: srhines, kubamracek, mgorny, javed.absar, krytarowski, kristof.beyls, jdoerfert, #sanitizers, llvm-commits, kcc Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58313 llvm-svn: 354625
* hwasan: Add __hwasan_init_static() function.Peter Collingbourne2019-01-311-0/+1
| | | | | | | | | | | This function initializes enough of the runtime to be able to run instrumented code in a statically linked executable. It replaces __hwasan_shadow_init() which wasn't doing enough initialization for instrumented code that uses either TLS or IFUNC to work. Differential Revision: https://reviews.llvm.org/D57490 llvm-svn: 352816
* 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. llvm-svn: 351636
* [hwasan] Record and display stack history in stack-based reports.Evgeniy Stepanov2018-09-241-32/+10
| | | | | | | | | | | | | | | | | | | | | Summary: Display a list of recent stack frames (not a stack trace!) when tag-mismatch is detected on a stack address. The implementation uses alignment tricks to get both the address of the history buffer, and the base address of the shadow with a single 8-byte load. See the comment in hwasan_thread_list.h for more details. Developed in collaboration with Kostya Serebryany. Reviewers: kcc Subscribers: srhines, kubamracek, mgorny, hiraditya, jfb, llvm-commits Differential Revision: https://reviews.llvm.org/D52249 llvm-svn: 342923
* Revert "[hwasan] Record and display stack history in stack-based reports."Evgeniy Stepanov2018-09-241-10/+32
| | | | | | This reverts commit r342921: test failures on clang-cmake-arm* bots. llvm-svn: 342922
* [hwasan] Record and display stack history in stack-based reports.Evgeniy Stepanov2018-09-241-32/+10
| | | | | | | | | | | | | | | | | | | | | Summary: Display a list of recent stack frames (not a stack trace!) when tag-mismatch is detected on a stack address. The implementation uses alignment tricks to get both the address of the history buffer, and the base address of the shadow with a single 8-byte load. See the comment in hwasan_thread_list.h for more details. Developed in collaboration with Kostya Serebryany. Reviewers: kcc Subscribers: srhines, kubamracek, mgorny, hiraditya, jfb, llvm-commits Differential Revision: https://reviews.llvm.org/D52249 llvm-svn: 342921
* [hwasan] change the thread list so that main_thread can also be removedKostya Serebryany2018-09-071-2/+2
| | | | llvm-svn: 341610
* [hwasan] introduce __hwasan_print_memory_usageKostya Serebryany2018-09-061-0/+14
| | | | llvm-svn: 341592
* [hwasan] simplify the code, NFCKostya Serebryany2018-09-051-2/+2
| | | | llvm-svn: 341501
* [hwasan] print thread IDs when reporting a bug (also had to fix ↵Kostya Serebryany2018-09-051-9/+7
| | | | | | pthread_create on Linux) llvm-svn: 341438
* [hwasan] simplify the code, NFCKostya Serebryany2018-09-051-4/+2
| | | | llvm-svn: 341432
* [hwasan] remove stale Thread:: data members. While doing so noticed that ↵Kostya Serebryany2018-09-041-4/+2
| | | | | | GetThreadStackAndTls was always called with 'at_initialization=true', fixed that. llvm-svn: 341431
* [hwasan] add a unique id to a thread and add debug prints for thread ↵Kostya Serebryany2018-09-041-0/+3
| | | | | | creation/destruction llvm-svn: 341428
* [hwasan] fix the linux-only pthread_create interceptor and reinstate the two ↵Kostya Serebryany2018-08-301-0/+11
| | | | | | threaded tests llvm-svn: 341143
* [hwasan] use thread-local ring buffers to properly report heap-use-after-freeKostya Serebryany2018-08-301-0/+12
| | | | llvm-svn: 341133
* [hwasan] simplify the thread hangling: instead of the ThreadRegistry (too ↵Kostya Serebryany2018-08-301-32/+3
| | | | | | heavy) simply maintain a linked list of Threads llvm-svn: 341111
* [hwasan] add a simple threaded UAF test, make it work on x86 (need to ↵Kostya Serebryany2018-08-301-0/+10
| | | | | | disable tagging in malloc with inside pthread_create) llvm-svn: 341007
* [hwasan] add basic ThreadRegistry plumbing, also rename HwasanThread to ThreadKostya Serebryany2018-08-301-5/+37
| | | | llvm-svn: 341005
* [hwasan] formatting change, NFCKostya Serebryany2018-08-291-1/+1
| | | | llvm-svn: 340980
* Add a thread-local ring buffer of heap allocationsKostya Serebryany2018-08-291-0/+4
| | | | | | | | | | | | | | | | | | Summary: We need this in order to properly report heap-use-after-free, since we don't have a quarantine. This is a first part of the code, more like a proof of concept. But I'd like to commit at as is and proceed with refactoring, adding a ThreadRegistry, and extending the functionality. Reviewers: eugenis Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D51394 llvm-svn: 340971
* [hwasan] Add a (almost) no-interceptor mode.Evgeniy Stepanov2018-08-201-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The idea behind this change is to allow sanitization of libc. We are prototyping on Bionic, but the tool interface will be general enough (or at least generalizable) to support any other libc. When libc depends on libclang_rt.hwasan, the latter can not interpose libc functions. In fact, majority of interceptors become unnecessary when libc code is instrumented. This change gets rid of most hwasan interceptors and provides interface for libc to notify hwasan about thread creation and destruction events. Some interceptors (pthread_create) are kept under #ifdef to enable testing with uninstrumented libc. They are expressed in terms of the new libc interface. The new cmake switch, COMPILER_RT_HWASAN_WITH_INTERCEPTORS, ON by default, builds testing version of the library with the aforementioned pthread_create interceptor. With the OFF setting, the library becomes more of a libc plugin. Reviewers: vitalybuka, kcc, jfb Subscribers: srhines, kubamracek, mgorny, jfb, llvm-commits Differential Revision: https://reviews.llvm.org/D50922 llvm-svn: 340216
* [hwasan] Add heap tag randomization.Evgeniy Stepanov2018-01-031-0/+5
| | | | | | | | | | | | | | Summary: Generate tags for heap allocations from a pseudo-random sequence seeded with getrandom(), where available. Reviewers: kcc, alekseyshl Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D41616 llvm-svn: 321761
* Hardware-assisted AddressSanitizer (compiler-rt)Evgeniy Stepanov2017-12-091-0/+81
Summary: Runtime library for HWASan, initial commit. Does not randomize tags yet, does not handle stack or globals. Reviewers: kcc, pcc, alekseyshl Subscribers: srhines, kubamracek, dberris, mgorny, llvm-commits, krytarowski Differential Revision: https://reviews.llvm.org/D40935 llvm-svn: 320231
OpenPOWER on IntegriCloud