Advisory

GHSA-2grh-hm3w-w7hv

Also known as: CVE-2021-38191, RUSTSEC-2021-0072

Summary

Race condition in tokio

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.

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2021-08-25 20:55 UTC
Modified
2023-11-08 04:06 UTC

Affected packages and fixes

tokio

crates.io · All systems

Affected

  • introduced 1.8.0, fixed 1.8.1 (semver)

Fixed versions

1.8.1

Fix

  • Fixed version 1.8.1
    cargo update -p tokio --precise 1.8.1

tokio

crates.io · All systems

Affected

  • introduced 1.7.0, fixed 1.7.2 (semver)

Fixed versions

1.7.2

Fix

  • Fixed version 1.7.2
    cargo update -p tokio --precise 1.7.2

tokio

crates.io · All systems

Affected

  • introduced 1.6.0, fixed 1.6.3 (semver)

Fixed versions

1.6.3

Fix

  • Fixed version 1.6.3
    cargo update -p tokio --precise 1.6.3

tokio

crates.io · All systems

Affected

  • introduced 0.3.0, fixed 1.5.1 (semver)

Fixed versions

1.5.1

Fix

  • Fixed version 1.5.1
    cargo update -p tokio --precise 1.5.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: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences