Open Nemo157 opened 4 years ago
It is possible for the future passed to block_on to stash a clone of the provided Waker somewhere, then call wake on it after completion, resulting in an attempt to access the ready variable from the freed block_on stack.
block_on
Waker
wake
ready
Hmm, is it possible to save this waker in a safe way?
Yes, it could be put into a static WAKER: RefCell<Option<Waker>>; or similar construct.
static WAKER: RefCell<Option<Waker>>;
It is possible for the future passed to
block_on
to stash a clone of the providedWaker
somewhere, then callwake
on it after completion, resulting in an attempt to access theready
variable from the freedblock_on
stack.