ADVISORIES

RustSec Advisory Database

RUSTSEC-2021-0072

Task dropped in wrong thread when aborting `LocalSet` task

Details

When aborting a task with JoinHandle::abort, the future is dropped in the thread calling abort if the task is not currently being executed. This is incorrect for tasks spawned on a LocalSet.

This can easily result in race conditions as many projects use Rc or RefCell in their Tokio tasks for better performance.

See [tokio#3929][issue] for more details.

[issue]: https://github.com/tokio-rs/tokio/issues/3929

Affected packages

EcosystemPackageAffected versions
crates.iotokio
From 0.3.0 before 1.5.1 (fixed in 1.5.1)
From 1.6.0 before 1.6.3 (fixed in 1.6.3)
From 1.7.0 before 1.7.2 (fixed in 1.7.2)
From 1.8.0 before 1.8.1 (fixed in 1.8.1)

References