`tokio::io::ReadHalf<T>::unsplit` is Unsound
Low severity
GitHub Reviewed
Published
Feb 4, 2023
to the GitHub Advisory Database
Package
Affected versions
>= 1.21.0, < 1.24.2
>= 1.19.0, < 1.20.4
>= 0.2.0, < 1.18.5
Patched versions
1.24.2
1.20.4
1.18.5
Description
Published to the GitHub Advisory Database
Feb 4, 2023
Reviewed
Feb 4, 2023
tokio::io::ReadHalf<T>::unsplit
can violate thePin
contractThe soundness issue is described in the tokio/issues#5372
Specific set of conditions needed to trigger an issue (a !Unpin type in ReadHalf)
is unusual, combined with the difficulty of making any arbitrary use-after-free
exploitable in Rust without doing a lot of careful alignment of data types in
the surrounding code.
The
tokio
featureio-util
is also required to be enabled to trigger thissoundness issue.
Thanks to zachs18 reporting the issue to Tokio team responsibly and taiki-e
and carllerche appropriately responding and fixing the soundness bug.
Tokio before 0.2.0 used
futures
0.1 that did not havePin
, so it is notaffected by this issue.
References