GHSA-2grh-hm3w-w7hv

Source
https://github.com/advisories/GHSA-2grh-hm3w-w7hv
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/08/GHSA-2grh-hm3w-w7hv/GHSA-2grh-hm3w-w7hv.json
Aliases
Published
2021-08-25T20:55:51Z
Modified
2023-11-08T04:06:25.982475Z
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.

References

Affected packages

crates.io / tokio

Package

Name
tokio

Affected ranges

Type
SEMVER
Events
Introduced
1.8.0
Fixed
1.8.1

Ecosystem specific

{
    "affected_functions": [
        "tokio::task::JoinHandle::abort"
    ]
}

crates.io / tokio

Package

Name
tokio

Affected ranges

Type
SEMVER
Events
Introduced
1.7.0
Fixed
1.7.2

Ecosystem specific

{
    "affected_functions": [
        "tokio::task::JoinHandle::abort"
    ]
}

crates.io / tokio

Package

Name
tokio

Affected ranges

Type
SEMVER
Events
Introduced
1.6.0
Fixed
1.6.3

Ecosystem specific

{
    "affected_functions": [
        "tokio::task::JoinHandle::abort"
    ]
}

crates.io / tokio

Package

Name
tokio

Affected ranges

Type
SEMVER
Events
Introduced
0.3.0
Fixed
1.5.1

Ecosystem specific

{
    "affected_functions": [
        "tokio::task::JoinHandle::abort"
    ]
}