aboutsummaryrefslogtreecommitdiffstats
path: root/internal
diff options
context:
space:
mode:
authorKJ Tsanaktsidis <kj@kjtsanaktsidis.id.au>2024-01-12 17:32:16 +1100
committerKJ Tsanaktsidis <kj@kjtsanaktsidis.id.au>2024-01-12 17:58:54 +1100
commit688a6ff51053ddebaf4c34dbf74ac0e5f026157b (patch)
tree58df023f39b638d1ea7778670e628e5996d96dbd /internal
parent18d85af9698522d6ce356a070a9bd01906a8aaed (diff)
downloadruby-688a6ff51053ddebaf4c34dbf74ac0e5f026157b.tar.gz
Revert "Mark asan fake stacks during machine stack marking"
This reverts commit d10bc3a2b8300cffc383e10c3730871e851be24c.
Diffstat (limited to 'internal')
-rw-r--r--internal/sanitizers.h63
1 files changed, 0 insertions, 63 deletions
diff --git a/internal/sanitizers.h b/internal/sanitizers.h
index 3fc31b350e..d444903aa0 100644
--- a/internal/sanitizers.h
+++ b/internal/sanitizers.h
@@ -213,67 +213,4 @@ asan_get_real_stack_addr(void* slot)
return addr ? addr : slot;
}
-/*!
- * Gets the current thread's fake stack handle, which can be passed into get_fake_stack_extents
- *
- * \retval An opaque value which can be passed to asan_get_fake_stack_extents
- */
-static inline void *
-asan_get_thread_fake_stack_handle(void)
-{
- return __asan_get_current_fake_stack();
-}
-
-/*!
- * Checks if the given VALUE _actually_ represents a pointer to an ASAN fake stack.
- *
- * If the given slot _is_ actually a reference to an ASAN fake stack, and that fake stack
- * contains the real values for the passed-in range of machine stack addresses, returns true
- * and the range of the fake stack through the outparams.
- *
- * Otherwise, returns false, and sets the outparams to NULL.
- *
- * Note that this function expects "start" to be > "end" on downward-growing stack architectures;
- *
- * \param[in] thread_fake_stack_handle The asan fake stack reference for the thread we're scanning
- * \param[in] slot The value on the machine stack we want to inspect
- * \param[in] machine_stack_start The extents of the real machine stack on which slot lives
- * \param[in] machine_stack_end The extents of the real machine stack on which slot lives
- * \param[out] fake_stack_start_out The extents of the fake stack which contains real VALUEs
- * \param[out] fake_stack_end_out The extents of the fake stack which contains real VALUEs
- * \return Whether slot is a pointer to a fake stack for the given machine stack range
-*/
-
-static inline bool
-asan_get_fake_stack_extents(void *thread_fake_stack_handle, VALUE slot,
- void *machine_stack_start, void *machine_stack_end,
- void **fake_stack_start_out, void **fake_stack_end_out)
-{
- /* the ifdef is needed here to suppress a warning about fake_frame_{start/end} being
- uninitialized if __asan_addr_is_in_fake_stack is an empty macro */
-#ifdef RUBY_ASAN_ENABLED
- void *fake_frame_start;
- void *fake_frame_end;
- void *real_stack_frame = __asan_addr_is_in_fake_stack(
- thread_fake_stack_handle, (void *)slot, &fake_frame_start, &fake_frame_end
- );
- if (real_stack_frame) {
- bool in_range;
-#if STACK_GROW_DIRECTION < 0
- in_range = machine_stack_start >= real_stack_frame && real_stack_frame >= machine_stack_end;
-#else
- in_range = machine_stack_start <= real_stack_frame && real_stack_frame <= machine_stack_end;
-#endif
- if (in_range) {
- *fake_stack_start_out = fake_frame_start;
- *fake_stack_end_out = fake_frame_end;
- return true;
- }
- }
-#endif
- *fake_stack_start_out = 0;
- *fake_stack_end_out = 0;
- return false;
-}
-
#endif /* INTERNAL_SANITIZERS_H */