RUSTSEC-2021-0072

Source
https://rustsec.org/advisories/RUSTSEC-2021-0072
Import Source
https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2021-0072.json
Aliases
Published
2021-07-07T12:00:00Z
Modified
2023-11-08T04:06:25.982475Z
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 for more details.

References

Affected packages

crates.io / tokio

Package

Name
tokio

Affected ranges

Type
SEMVER
Events
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

Ecosystem specific

{
    "affects": {
        "os": [],
        "functions": [
            "tokio::task::JoinHandle::abort"
        ],
        "arch": []
    }
}

Database specific

{
    "cvss": null,
    "informational": null,
    "categories": [
        "memory-corruption"
    ]
}