-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Task dropped in wrong thread when aborting LocalSet task #3929
Labels
A-tokio
Area: The main tokio crate
C-bug
Category: This is a bug.
I-unsound 💥
A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
M-task
Module: tokio/task
Comments
Darksonn
added
C-bug
Category: This is a bug.
A-tokio
Area: The main tokio crate
M-task
Module: tokio/task
I-unsound 💥
A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
labels
Jul 6, 2021
Note: I have some follow-up PRs to #3909 planned, which will fix this issue. |
This was fixed in #3934. The fix has been backported to all minor releases that are at most 3 months old which includes |
bors bot
added a commit
to nervosnetwork/ckb
that referenced
this issue
Jul 8, 2021
2813: chore(deps): bump tokio from 1.8.0 to 1.8.1 r=quake,driftluo a=yangby-cryptape Fix [RUSTSEC-2021-0072: Task dropped in wrong thread when aborting LocalSet task](https://rustsec.org/advisories/RUSTSEC-2021-0072). See tokio-rs/tokio#3929 for more details. Co-authored-by: Boyu Yang <yangby@cryptape.com>
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-tokio
Area: The main tokio crate
C-bug
Category: This is a bug.
I-unsound 💥
A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
M-task
Module: tokio/task
When aborting a task with
JoinHandle::abort
, the future is dropped in the thread callingabort
if the task is not currently being executed. This is incorrect for tasks spawned on aLocalSet
. See this example that exploits it to send a non-send value to a different thread:This can easily result in race conditions as many projects use
Rc
orRefCell
in their Tokio tasks for better performance.The text was updated successfully, but these errors were encountered: