Advisory

RUSTSEC-2021-0072

Also known as: CVE-2021-38191, GHSA-2grh-hm3w-w7hv

Summary

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

Severity

Not rated by the source.

Dates

Published
2021-07-07 12:00 UTC
Modified
2023-11-08 04:06 UTC

Affected packages and fixes

tokio

crates.io · All systems

Affected

  • introduced 0.3.0, fixed 1.5.1, introduced 1.6.0, fixed 1.6.3, introduced 1.7.0, fixed 1.7.2, introduced 1.8.0, fixed 1.8.1 (semver)

Fixed versions

1.5.1, 1.6.3, 1.7.2, 1.8.1

Fix

  • Fixed version 1.5.1
    cargo update -p tokio --precise 1.5.1
  • Fixed version 1.6.3
    cargo update -p tokio --precise 1.6.3
  • Fixed version 1.7.2
    cargo update -p tokio --precise 1.7.2
  • Fixed version 1.8.1
    cargo update -p tokio --precise 1.8.1

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: RustSec Advisory Database · CC0-1.0

Sources & licences