rust-embedded-community/async-on-embedded

{task,Executor}::block_on are unsound

Opened this issue · 2 comments

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.

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.