#
8681202d |
| 12-Jul-2024 |
Mitch Phillips <31459023+hctim@users.noreply.github.com> |
[ASan] [HWASan] Add __sanitizer_ignore_free_hook() (#96749)
This change adds a new weak API function which makes the sanitizer
ignore the call to free(), and implements the
functionality in ASan a
[ASan] [HWASan] Add __sanitizer_ignore_free_hook() (#96749)
This change adds a new weak API function which makes the sanitizer
ignore the call to free(), and implements the
functionality in ASan and HWAsan. The runtime that implements this hook
can then call free() at a later point again on the same pointer (and
making sure the hook returns zero so that the memory will actually be
freed) when it's actually ready for the memory to be cleaned up.
This is needed in order to implement an sanitizer-compatible version
of Chrome's BackupRefPtr algorithm, since process-wide double-shimming
of malloc/free does not work on some platforms.
Requested and designed by @c01db33f (Mark) from Project Zero.
---------
Co-authored-by: Mark Brand <markbrand@google.com>
show more ...
|
Revision tags: llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5 |
|
#
7639265a |
| 24-May-2023 |
Jin Xin Ng <njx@google.com> |
[sanitizer] Implement __sanitizer_get_allocated_size_fast
The primary motivation for this change is to allow FreeHooks to obtain the allocated size of the pointer being freed in a fast, efficient ma
[sanitizer] Implement __sanitizer_get_allocated_size_fast
The primary motivation for this change is to allow FreeHooks to obtain the allocated size of the pointer being freed in a fast, efficient manner.
Differential Revision: https://reviews.llvm.org/D151360
show more ...
|
Revision tags: llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2 |
|
#
b1bd52cd |
| 12-Apr-2023 |
Thurston Dang <thurston@google.com> |
Fix tls_get_addr handling for glibc >=2.25
This changes the sanitizers' tls_get_addr handling from a heuristic check of __signal_safe_memalign allocations (which has only been used in a since deprec
Fix tls_get_addr handling for glibc >=2.25
This changes the sanitizers' tls_get_addr handling from a heuristic check of __signal_safe_memalign allocations (which has only been used in a since deprecated version of Google's runtime), to using the sanitizers' interface function to check if it is a malloc allocation (used since glibc >= 2.25).
This is one of the approaches proposed by Keno in https://github.com/google/sanitizers/issues/1409#issuecomment-1214244142
This moves the weak annotation of __sanitizer_get_allocated_size/begin from the header to sanitizer_tls_get_addr.cpp, as suggested by Vitaly in D148060.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D147459
show more ...
|
Revision tags: llvmorg-16.0.1 |
|
#
d644ab02 |
| 04-Apr-2023 |
Thurston Dang <thurston@google.com> |
Update __sanitizer_get_allocated_begin to return const void*
D147005 introduced __sanitizer_get_allocated_begin, with a return value of void*. This involved a few naughty casts that dropped the cons
Update __sanitizer_get_allocated_begin to return const void*
D147005 introduced __sanitizer_get_allocated_begin, with a return value of void*. This involved a few naughty casts that dropped the const. This patch adds back the const qualifier.
Differential Revision: https://reviews.llvm.org/D147489
show more ...
|
#
415b1cfd |
| 03-Apr-2023 |
Thurston Dang <thurston@google.com> |
Add __sanitizer_get_allocated_begin API and implementations
This function will return the start of the allocation, if given a pointer that lies within an allocation. Otherwise, it returns NULL.
It
Add __sanitizer_get_allocated_begin API and implementations
This function will return the start of the allocation, if given a pointer that lies within an allocation. Otherwise, it returns NULL.
It will be useful for detecting dynamic TLS allocations in glibc >=2.25, which uses malloc (see https://github.com/google/sanitizers/issues/1409#issuecomment-1214244142).
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D147005
show more ...
|
Revision tags: llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1, llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1, llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4, llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init, llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1, llvmorg-11.0.1, llvmorg-11.0.1-rc2, llvmorg-11.0.1-rc1, llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4, llvmorg-11.0.0-rc3, llvmorg-11.0.0-rc2, llvmorg-11.0.0-rc1, llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4, llvmorg-10.0.1-rc3, llvmorg-10.0.1-rc2, llvmorg-10.0.1-rc1, llvmorg-10.0.0, llvmorg-10.0.0-rc6, llvmorg-10.0.0-rc5, llvmorg-10.0.0-rc4, llvmorg-10.0.0-rc3, llvmorg-10.0.0-rc2, llvmorg-10.0.0-rc1, llvmorg-11-init, llvmorg-9.0.1, llvmorg-9.0.1-rc3, llvmorg-9.0.1-rc2, llvmorg-9.0.1-rc1, llvmorg-9.0.0, llvmorg-9.0.0-rc6, llvmorg-9.0.0-rc5, llvmorg-9.0.0-rc4, llvmorg-9.0.0-rc3, llvmorg-9.0.0-rc2, llvmorg-9.0.0-rc1, llvmorg-10-init, llvmorg-8.0.1, llvmorg-8.0.1-rc4, llvmorg-8.0.1-rc3, llvmorg-8.0.1-rc2, llvmorg-8.0.1-rc1, llvmorg-8.0.0, llvmorg-8.0.0-rc5, llvmorg-8.0.0-rc4, llvmorg-8.0.0-rc3, llvmorg-7.1.0, llvmorg-7.1.0-rc1, llvmorg-8.0.0-rc2, llvmorg-8.0.0-rc1 |
|
#
2946cd70 |
| 19-Jan-2019 |
Chandler Carruth <chandlerc@gmail.com> |
Update the file headers across all of the LLVM projects in the monorepo to reflect the new license.
We understand that people may be surprised that we're moving the header entirely to discuss the ne
Update the file headers across all of the LLVM projects in the monorepo 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
show more ...
|
Revision tags: llvmorg-7.0.1, llvmorg-7.0.1-rc3, llvmorg-7.0.1-rc2, llvmorg-7.0.1-rc1, llvmorg-7.0.0, llvmorg-7.0.0-rc3, llvmorg-7.0.0-rc2, llvmorg-7.0.0-rc1, llvmorg-6.0.1, llvmorg-6.0.1-rc3, llvmorg-6.0.1-rc2, llvmorg-6.0.1-rc1, llvmorg-5.0.2, llvmorg-5.0.2-rc2, llvmorg-5.0.2-rc1, llvmorg-6.0.0, llvmorg-6.0.0-rc3, llvmorg-6.0.0-rc2, llvmorg-6.0.0-rc1, llvmorg-5.0.1, llvmorg-5.0.1-rc3, llvmorg-5.0.1-rc2, llvmorg-5.0.1-rc1 |
|
#
028c4cdd |
| 23-Oct-2017 |
Alex Shlyapnikov <alekseys@google.com> |
[Sanitizers] New sanitizer API to purge allocator quarantine.
Summary: Purging allocator quarantine and returning memory to OS might be desired between fuzzer iterations since, most likely, the quar
[Sanitizers] New sanitizer API to purge allocator quarantine.
Summary: Purging allocator quarantine and returning memory to OS might be desired between fuzzer iterations since, most likely, the quarantine is not going to catch bugs in the code under fuzz, but reducing RSS might significantly prolong the fuzzing session.
Reviewers: cryptoad
Subscribers: kubamracek, llvm-commits
Differential Revision: https://reviews.llvm.org/D39153
llvm-svn: 316347
show more ...
|
Revision tags: llvmorg-5.0.0, llvmorg-5.0.0-rc5, llvmorg-5.0.0-rc4, llvmorg-5.0.0-rc3, llvmorg-5.0.0-rc2, llvmorg-5.0.0-rc1, llvmorg-4.0.1, llvmorg-4.0.1-rc3, llvmorg-4.0.1-rc2, llvmorg-4.0.1-rc1 |
|
#
82a41dd6 |
| 15-Mar-2017 |
Kostya Serebryany <kcc@google.com> |
[asan] add one more argument to __sanitizer_print_memory_profile, remove a redundant weak definition.
llvm-svn: 297914
|
Revision tags: llvmorg-4.0.0, llvmorg-4.0.0-rc4, llvmorg-4.0.0-rc3, llvmorg-4.0.0-rc2 |
|
#
25527bf0 |
| 31-Jan-2017 |
Marcos Pividori <mpividori@google.com> |
[sanitizer] Add list of symbols exported in sanitizers' interface.
Add a new auxiliary file to each sanitizer: sanitizer_interface.inc, listing all the functions exported, with the macros: INTERFACE
[sanitizer] Add list of symbols exported in sanitizers' interface.
Add a new auxiliary file to each sanitizer: sanitizer_interface.inc, listing all the functions exported, with the macros: INTERFACE_FUNCTION() and INTERFACE_WEAK_FUNCTION(). So, when we need to define or repeat a procedure for each function in the sanitizer's interface, we can define the macros and include that header. In particular, these files are needed for Windows, in the nexts commits. Also, this files could replace the existing files: weak_symbols.txt for Apple. Instead of reading weak_symbols.txt to get the list of weak symbols, we could read the file sanitizer_interface.inc and consider all the symbols included with the macro INTERFACE_WEAK_FUNCTION(Name).
In this commit, I only include these files to the sanitizers that work on Windows. We could do the same for the rest of the sanitizers when needed.
I updated tests for: Linux, Darwin and Windows. If a new function is exported but is not present in the interface list, the tests "interface_symbols_[darwin|windows|linux].c" fail.
Also, I remove the comments: "/* OPTIONAL */" which are not required any more, because we use the macro: INTERFACE_WEAK_FUNCTION() for weak functions.
Differential Revision: https://reviews.llvm.org/D29148
llvm-svn: 293682
show more ...
|
Revision tags: llvmorg-4.0.0-rc1, llvmorg-3.9.1, llvmorg-3.9.1-rc3, llvmorg-3.9.1-rc2, llvmorg-3.9.1-rc1 |
|
#
7b296aa5 |
| 14-Sep-2016 |
Kostya Serebryany <kcc@google.com> |
[asan] add heap_profile=1 to asan to periodically print the heap profile. So far this is a very basic heap-profile functionality
llvm-svn: 281546
|
Revision tags: llvmorg-3.9.0, llvmorg-3.9.0-rc3, llvmorg-3.9.0-rc2, llvmorg-3.9.0-rc1 |
|
#
bf6a04fd |
| 16-Jun-2016 |
Kostya Serebryany <kcc@google.com> |
[sanitizers] introduce yet another API function: __sanitizer_install_malloc_and_free_hooks
llvm-svn: 272943
|
Revision tags: llvmorg-3.8.1, llvmorg-3.8.1-rc1, llvmorg-3.8.0, llvmorg-3.8.0-rc3, llvmorg-3.8.0-rc2, llvmorg-3.8.0-rc1, llvmorg-3.7.1, llvmorg-3.7.1-rc2, llvmorg-3.7.1-rc1, llvmorg-3.7.0, llvmorg-3.7.0-rc4, llvmorg-3.7.0-rc3, studio-1.4, llvmorg-3.7.0-rc2, llvmorg-3.7.0-rc1, llvmorg-3.6.2, llvmorg-3.6.2-rc1, llvmorg-3.6.1, llvmorg-3.6.1-rc1, llvmorg-3.5.2, llvmorg-3.5.2-rc1, llvmorg-3.6.0, llvmorg-3.6.0-rc4, llvmorg-3.6.0-rc3, llvmorg-3.6.0-rc2, llvmorg-3.6.0-rc1, llvmorg-3.5.1, llvmorg-3.5.1-rc2, llvmorg-3.5.1-rc1, llvmorg-3.5.0, llvmorg-3.5.0-rc4, llvmorg-3.5.0-rc3, llvmorg-3.5.0-rc2, llvmorg-3.5.0-rc1 |
|
#
91bb8e0e |
| 07-Jul-2014 |
Alexey Samsonov <vonosmas@gmail.com> |
Generalize sanitizer allocator public interface.
Introduce new public header <sanitizer/allocator_interface.h> and a set of functions __sanitizer_get_ownership(), __sanitizer_malloc_hook() etc. that
Generalize sanitizer allocator public interface.
Introduce new public header <sanitizer/allocator_interface.h> and a set of functions __sanitizer_get_ownership(), __sanitizer_malloc_hook() etc. that will eventually replace their tool-specific equivalents (__asan_get_ownership(), __msan_get_ownership() etc.). Tool-specific functions are now deprecated and implemented as stubs redirecting to __sanitizer_ versions (which are implemented differently in each tool).
Replace all uses of __xsan_ versions with __sanitizer_ versions in unit and lit tests.
llvm-svn: 212469
show more ...
|