[PATCH] D103304: Update and improve compiler-rt tests for -mllvm -asan_use_after_return=(never|[runtime]|always).
Kevin Athey via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 5 07:59:32 PDT 2021
kda added a comment.
Regarding below, I had this previously: https://reviews.llvm.org/differential/changeset/?ref=2601358
The problem I don't know how to navigate is that GetFakeStackFast is only called from one place (at runtime, the other is for testing only).
That call is in OnMalloc. Which, in turn, is only called from one place: __asan_stack_malloc_<##class_id>
How do I have the runtime code pick the Always version of GetFakeStackFast without examining the global?
Do I inject the function ptr when generating the call to __asan_stack_malloc?
In D103304#2800596 <https://reviews.llvm.org/D103304#2800596>, @vitalybuka wrote:
> I looked at Lazy approach and it's simpler then I thought. Asan already contains all needed pieces.
> Considering that we have not idea how to handle Windows and Darwin we should do that in this patch.
>
> Cloning of GetFakeStackFast -> GetFakeStackFastAlways which does not check __asan_option_detect_stack_use_after_return should be enough.
>
> static FakeStack *GetFakeStackFast() {
> if (FakeStack *fs = GetTLSFakeStack())
> return fs;
> if (!__asan_option_detect_stack_use_after_return)
> return nullptr;
> return GetFakeStack();
> }
>
>
> static FakeStack *GetFakeStackFastAlways() {
> if (FakeStack *fs = GetTLSFakeStack())
> return fs;
> return GetFakeStack();
> }
>
> And same for all callers.
> Anything __asan_detect_use_after_return_always related can be reverted.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103304/new/
https://reviews.llvm.org/D103304
More information about the llvm-commits
mailing list