19 Commits

Author SHA1 Message Date
PiJoules
a5fa4dba6e
[compiler-rt] Add interceptors for free_[aligned_]sized for asan+hwasan (#189109) 2026-03-27 23:16:52 +00:00
Jake Egan
839676bef1
[asan][AIX] Add vec_malloc and vec_calloc interceptors (#175584)
On AIX, when both the `__VEC__` and `_ALL_SOURCE` macros are defined
(they are defined by default), the malloc and calloc system calls are
mapped to vec_malloc and vec_calloc respectively, so we need the
following vec_malloc and vec_calloc interceptors.

Issue: #138916
2026-02-09 13:09:41 -05:00
Jake Egan
5ec319119f
[asan] Adjust interception compatibility for AIX (#131870)
Adjust asan interceptor compatbility for AIX. AIX uses dlsym to retrieve
addresses of exported functions. However, some functions in libc.a, such
as memcpy, are not exported, so we currently have a limitation in
retrieving these addresses.

Issue: https://github.com/llvm/llvm-project/issues/138916
2026-01-02 17:31:26 -05:00
Justin King
681c2ee4df
asan: refactor interceptor allocation/deallocation functions (#145087)
Do some refactoring to allocation/deallocation interceptors. Expose
explicit per-alloc_type functions and stop accepting explicit AllocType.
This ensures we do not accidentally mix.

NOTE: This change rejects attempts to call `operator new(<some_size>,
static_cast<std::align_val_t>(0))`.

For https://github.com/llvm/llvm-project/issues/144435

Signed-off-by: Justin King <jcking@google.com>
2025-07-22 15:47:23 -07:00
Brad Smith
d49063b496
[compiler-rt][sanitizer][NFC] update endif markers for Haiku (#135475) 2025-04-12 00:49:23 -04:00
Brad Smith
d1fd97737e
[compiler-rt][sanitizer] add Haiku support (#134772)
Co-authored-by: Jérôme Duval <jerome.duval@gmail.com>
2025-04-11 16:21:00 -04:00
Vitaly Buka
b07f1be92c
[sanitizer] Remove DTLS_on_libc_memalign (#108120)
`DTLS_on_libc_memalign` is called from primary
allocator, so `__sanitizer_get_allocated_begin`
should also be aware of allocation,
and correctly handled by `GetDTLSRange`.
2024-09-12 00:50:54 -07:00
Fangrui Song
ba66d60b1c
[sanitizer] Replace ALIGNED with alignas
C++11 `alignas` is already used extensively. `alignas` must precede
`static`, so adjust the ordering accordingly.

msan.cpp: Clang 15 doesn't allow `__attribute__((visibility("default"))) alignas(16)`.
Use the order `alignas(16) SANITIZER_INTERFACE_ATTRIBUTE`. Tested with Clang 7.

Pull Request: https://github.com/llvm/llvm-project/pull/98958
2024-07-15 16:12:42 -07:00
Vitaly Buka
eef39f4341
[NFC][asan] Inline ENSURE_ASAN_INITED macro (#74174) 2023-12-04 14:58:51 -08:00
Vitaly Buka
5aa2f8c98c
[NFC][ASAN] Replace AsanInitIsRunning with TryAsanInitFromRtl
Reviewers: zacklj89

Reviewed By: zacklj89

Pull Request: https://github.com/llvm/llvm-project/pull/74171
2023-12-04 11:10:18 -08:00
Zachary Johnson
5d6304f017 [NFC][asan] Change asan_init and asan_init_is_running; add setters/getters
For #71833
2023-11-09 13:57:46 -08:00
Vitaly Buka
cb0e14ce6d [sanitizer] Switch dlsym hack to internal_allocator
Since glibc 2.34, dlsym does
  1. malloc 1
  2. malloc 2
  3. free pointer from malloc 1
  4. free pointer from malloc 2
These sequence was not handled by trivial dlsym hack.

This fixes https://bugs.llvm.org/show_bug.cgi?id=52278

Reviewed By: eugenis, morehouse

Differential Revision: https://reviews.llvm.org/D112588
2021-11-12 16:11:10 -08:00
Vitaly Buka
1da33a51f1 [NFC][asan][memprov] Remove dlsym hack from posix_memalign
It was added for RTEMS which was removed at D104279.
2021-11-10 16:35:14 -08:00
Vitaly Buka
6478ef61b1 [asan] Remove Asan, Ubsan support of RTEMS and Myriad
Differential Revision: https://reviews.llvm.org/D104279
2021-06-15 12:59:05 -07:00
Vitaly Buka
b8919fb0ea [NFC][sanitizer] clang-format some code 2021-06-14 18:05:22 -07:00
Kamil Rytarowski
85e578f53a [compiler-rt] Replace INLINE with inline
This fixes the clash with BSD headers.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D87562
2020-09-17 16:24:20 +02:00
Vitaly Buka
6cf72ad3b3 [NFC][asan] Don't unwind stack before pool check 2020-08-28 02:00:35 -07:00
Vitaly Buka
c0fa632236 Remove NOLINTs from compiler-rt
llvm-svn: 371687
2019-09-11 23:19:48 +00:00
Nico Weber
217222abea compiler-rt: Rename .cc file in lib/asan to .cpp
Like r367463, but for asan.

llvm-svn: 367558
2019-08-01 13:43:28 +00:00