12 Commits

Author SHA1 Message Date
Vitaly Buka
5b7dfa968f
[NFC][sanitizer] Rename InternalScopedString::append to AppendF (#66558)
Prepare to introduce trivial InternalScopedString::Append(const char*).
2023-09-15 17:06:20 -07:00
Vitaly Buka
515c435e37 [asan] Fix stack pointers comparison in FakeStack
Unlucky naming top/bottom for stack bounds, has nothing to do with real
stack top. So top > botton is here, and opposite of
9be8892908d49c19fd6c9fc930d0f41276c3e345 assumption.

This is minimal fix in case cherry-picks is needed. Naming fix and
testing (if possible) will be in followup patches.

Introduced in 9be8892908d49c19fd6c9fc930d0f41276c3e345.
Can't symply reverted 9be8892908d49c19fd6c9fc930d0f41276c3e345 as
it fixes ~10 year old bug, accidentally exposed by
a8bef8865e4a4226ee608df327fddd380870c620.
2023-08-18 00:28:20 -07:00
Vitaly Buka
9be8892908 [asan] Fix GC of FakeFrames
When FakeStack GC from altstack, it may see default stack on lower
addressed and incorectly disard all frames.

Fixes bug exposed by D153536.

Reviewed By: kstoimenov

Differential Revision: https://reviews.llvm.org/D157552
2023-08-09 20:47:23 -07:00
Vitaly Buka
2b0bfb6928 [NFC][Asan] Use GET_CURRENT_FRAME instead of local var 2023-08-08 18:48:54 -07:00
Mitch Phillips
0f6d9501cf [NFCI] Fix set-but-unused warning in asan_fake_stack.cpp 2022-03-23 15:45:09 -07:00
Kirill Stoimenov
ad56941a57 [ASan] Renamed SHADOW_XYZ to ASAN_SHADOW_XYZ.
Follow up from D115271.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D115293
2021-12-08 00:22:56 +00:00
Martin Liska
13a442ca49 Enable -Wformat-pedantic and fix fallout.
Differential Revision: https://reviews.llvm.org/D113172
2021-11-05 13:12:35 +01:00
Kevin Athey
ddac31c593 Cleanup for final comment on https://reviews.llvm.org/D103304
Consolidate DEFINE_STACK_MALLOC to simplify.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D103965
2021-06-09 13:47:12 -07:00
Kevin Athey
af8c59e06d Update and improve compiler-rt tests for -mllvm -asan_use_after_return=(never|[runtime]|always).
In addition:
  - optionally add global flag to capture compile intent for UAR:
    __asan_detect_use_after_return_always.
    The global is a SANITIZER_WEAK_ATTRIBUTE.

for issue: https://github.com/google/sanitizers/issues/1394

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D103304
2021-06-08 14:39:06 -07:00
Vitaly Buka
5b0e50550c [NFC][asan] Split fake_stack() into two funcions 2021-06-04 23:29:04 -07:00
Vitaly Buka
e0dadf3de2 [sanitizer] Remove max_len parameter from InternalScopedString
InternalScopedString uses InternalMmapVector internally
so it can be resized dynamically as needed.

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D98751
2021-03-17 16:57:09 -07: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