| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
Adds a line to /proc/$PID/maps with more or less up-to-date memory
stats of the process.
llvm-svn: 341735
|
|
|
|
|
|
|
|
|
| |
Check size limit before rounding up, otherwise malloc((size_t)-1)
would happily allocate 0 bytes.
Steal a nice test case from scudo.
llvm-svn: 341612
|
|
|
|
| |
llvm-svn: 341610
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
When building without COMPILER_RT_HWASAN_WITH_INTERCEPTORS, skip
interceptors for malloc/free/etc and only export their versions with
__sanitizer_ prefix.
Also remove a hack in mallinfo() interceptor that does not apply to
hwasan.
Reviewers: kcc
Subscribers: kubamracek, krytarowski, llvm-commits
Differential Revision: https://reviews.llvm.org/D51711
llvm-svn: 341598
|
|
|
|
| |
llvm-svn: 341594
|
|
|
|
| |
llvm-svn: 341592
|
|
|
|
| |
llvm-svn: 341507
|
|
|
|
| |
llvm-svn: 341501
|
|
|
|
|
|
|
|
|
|
| |
Sigtrap is used for error reporting, but all other signals are better
left for the platform.
In particular, sanitizer signal handlers do not dump registers or
memory which makes debugging harder for no good reason.
llvm-svn: 341500
|
|
|
|
| |
llvm-svn: 341441
|
|
|
|
| |
llvm-svn: 341440
|
|
|
|
|
|
| |
pthread_create on Linux)
llvm-svn: 341438
|
|
|
|
|
|
| |
can call t->Destroy in __hwasan_thread_exit, same as on Android
llvm-svn: 341435
|
|
|
|
| |
llvm-svn: 341432
|
|
|
|
|
|
| |
GetThreadStackAndTls was always called with 'at_initialization=true', fixed that.
llvm-svn: 341431
|
|
|
|
|
|
| |
creation/destruction
llvm-svn: 341428
|
|
|
|
|
|
|
| |
Fixes "allocator is out of memory trying to allocate 0x0 bytes" by
always allocating at least one byte.
llvm-svn: 341229
|
|
|
|
|
|
| |
(HwasanThreadLocalMallocStorage) that had incorrect size and used 10x more than needed RAM (500K instead of 50K per thread)
llvm-svn: 341170
|
|
|
|
| |
llvm-svn: 341166
|
|
|
|
|
|
| |
thread
llvm-svn: 341160
|
|
|
|
| |
llvm-svn: 341159
|
|
|
|
|
|
| |
on Linux at all
llvm-svn: 341158
|
|
|
|
|
|
| |
stack addresses
llvm-svn: 341156
|
|
|
|
|
|
| |
threaded tests
llvm-svn: 341143
|
|
|
|
| |
llvm-svn: 341133
|
|
|
|
|
|
| |
heavy) simply maintain a linked list of Threads
llvm-svn: 341111
|
|
|
|
|
|
| |
disable tagging in malloc with inside pthread_create)
llvm-svn: 341007
|
|
|
|
| |
llvm-svn: 341005
|
|
|
|
| |
llvm-svn: 340989
|
|
|
|
| |
llvm-svn: 340985
|
|
|
|
| |
llvm-svn: 340983
|
|
|
|
| |
llvm-svn: 340980
|
|
|
|
| |
llvm-svn: 340979
|
|
|
|
|
|
| |
realloc. This may slowdown some realloc-heavy code, but at least at this point a want simpler code. Also added a test
llvm-svn: 340973
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The previous version of the patch makes some code unable to distinguish
failure to map address 0 and error.
Revert to turn the bots back to green while figuring out a new approach.
Reviewers: eugenis
Reviewed By: eugenis
Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D51451
llvm-svn: 340957
|
|
|
|
| |
llvm-svn: 340593
|
|
|
|
| |
llvm-svn: 340591
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
`MmapNoAccess` & `MmapFixedNoAccess` return directly the result of
`internal_mmap`, as opposed to other Mmap functions that return nullptr.
This inconsistency leads to some confusion for the callers, as some check for
`~(uptr)0` (`MAP_FAILED`) for failure (while it can fail with `-ENOMEM` for
example).
Two potential solutions: change the callers, or make the functions return
`nullptr` on failure to follow the precedent set by the other functions.
The second option looked more appropriate to me.
Correct the callers that were wrongly checking for `~(uptr)0` or
`MAP_FAILED`.
TODO for follow up CLs:
- There are a couple of `internal_mmap` calls in XRay that check for
MMAP_FAILED as a result as well (cc: @dberris); they should use
`internal_iserror`;
Reviewers: eugenis, alekseyshl, dberris, kubamracek
Reviewed By: alekseyshl
Subscribers: kristina, kubamracek, delcypher, #sanitizers, dberris, llvm-commits
Differential Revision: https://reviews.llvm.org/D50940
llvm-svn: 340576
|
|
|
|
|
|
| |
around the buggy access, simplify one test
llvm-svn: 340470
|
|
|
|
| |
llvm-svn: 340442
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
This reapplies commit r339935 with the following changes:
* make longjmp test C, not C++, to avoid dependency on libc++/libstdc++
* untag pointer in memset interceptor
x86_64 does not have TBI, so hwasan barely works there. Tests must be carefully
written in a way that does not leak tagged pointer to system libraries.
llvm-svn: 339963
|
|
|
|
|
|
| |
This reverts commit 339935 which breaks hwasan tests on x86_64.
llvm-svn: 339957
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Enable syslog as soon as the shadow is mapped.
Reviewers: vitalybuka, kcc
Subscribers: srhines, kubamracek, llvm-commits
Differential Revision: https://reviews.llvm.org/D50865
llvm-svn: 339950
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
A callback to annotate longjmp-like code.
Unlike __asan_handle_no_return, in hwasan we can not conservatively
"unpoison" the entire thread stack, because there is no such thing as
unpoisoned memory. Pointer and memory tags must always match.
Reviewers: vitalybuka, kcc
Subscribers: kubamracek, llvm-commits
Differential Revision: https://reviews.llvm.org/D50752
llvm-svn: 339935
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: vitalybuka, kcc
Subscribers: kubamracek, llvm-commits
Differential Revision: https://reviews.llvm.org/D50753
llvm-svn: 339932
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Add user tag manipulation functions:
__hwasan_tag_memory
__hwasan_tag_pointer
__hwasan_print_shadow (very simple and ugly, for now)
Reviewers: vitalybuka, kcc
Subscribers: kubamracek, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D50746
llvm-svn: 339746
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Export __sanitizer_malloc, etc as aliases to malloc, etc.
This way users can wrap sanitizer malloc, even in fully static binaries.
Both jemalloc and tcmalloc provide similar aliases (je_* and tc_*).
Reviewers: vitalybuka, kcc
Subscribers: llvm-commits, kubamracek
Differential Revision: https://reviews.llvm.org/D50570
llvm-svn: 339614
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Don't crash when /proc/self/maps is inaccessible from main thread.
It's not a big deal, really.
Reviewers: vitalybuka, kcc
Subscribers: kubamracek, llvm-commits
Differential Revision: https://reviews.llvm.org/D50574
llvm-svn: 339607
|