diff options
author | Jakub Jelinek <jakub@redhat.com> | 2024-04-17 10:24:18 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2024-04-17 10:24:18 +0200 |
commit | 299d14a54672a4d12c1abbe4031a732bb56cddaa (patch) | |
tree | 1742c76995de8f51c2be15fc1e32794ef7b99c7d /gcc/asan.cc | |
parent | 9c7cf5d71f071655a90a6d364369d111bafdb25a (diff) | |
download | gcc-299d14a54672a4d12c1abbe4031a732bb56cddaa.zip gcc-299d14a54672a4d12c1abbe4031a732bb56cddaa.tar.gz gcc-299d14a54672a4d12c1abbe4031a732bb56cddaa.tar.bz2 |
asan: Don't instrument .ABNORMAL_DISPATCHER [PR114743]
.ABNORMAL_DISPATCHER is currently the only internal function with
ECF_NORETURN, and asan likes to instrument ECF_NORETURN calls by adding
some builtin call before them, which breaks the .ABNORMAL_DISPATCHER
discovery added in gsi_safe_*.
The following patch fixes asan not to instrument .ABNORMAL_DISPATCHER
calls, like it doesn't instrument a couple of specific builtin calls
as well.
2024-04-17 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/114743
* asan.cc (maybe_instrument_call): Don't instrument calls to
.ABNORMAL_DISPATCHER.
* gcc.dg/asan/pr112709-2.c (freddy): New function from
gcc.dg/ubsan/pr112709-2.c version of the test.
Diffstat (limited to 'gcc/asan.cc')
-rw-r--r-- | gcc/asan.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/asan.cc b/gcc/asan.cc index 57c3a9b..9e0f51b 100644 --- a/gcc/asan.cc +++ b/gcc/asan.cc @@ -3030,6 +3030,9 @@ maybe_instrument_call (gimple_stmt_iterator *iter) break; } } + if (gimple_call_internal_p (stmt, IFN_ABNORMAL_DISPATCHER)) + /* Don't instrument this. */ + return false; /* If a function does not return, then we must handle clearing up the shadow stack accordingly. For ASAN we can simply set the entire stack to "valid" for accesses by setting the shadow space to 0 and all |