Project

General

Profile

Actions

Bug #20220

closed

M:N threading needs to tell ASAN about stack switches

Added by kjtsanaktsidis (KJ Tsanaktsidis) about 1 month ago. Updated 24 days ago.


Description

When switching stacks via coroutine_transfer in the M:N threading information, we need to tell ASAN about it in the same way that we do in cont.c. This is a matter of calling __sanitizer_start_switch_fiber in the transferring M:N thread, and then calling __sanitizer_finish_switch_fiber in the transferred-to M:N thread.

Actions #1

Updated by Anonymous 24 days ago

  • Status changed from Open to Closed

Applied in changeset git|719db18b50a996f3df4f76854f7dc9d69f875582.


notify ASAN about M:N threading stack switches

In a similar way to how we do it with fibers in cont.c, we need to call
__sanitize_start_switch_fiber and __sanitize_finish_switch_fiber around
the call to coroutine_transfer to let ASAN save & restore the fake stack
pointer.

When a M:N thread is exiting, we pass to_dead to the new
coroutine_transfer0 function, so that we can pass NULL for saving the
stack pointer. This signals to ASAN that the fake stack can be freed
(otherwise it would be leaked)

[Bug #20220]

Actions

Also available in: Atom PDF

Like0
Like0