From d6ea7a742b92d3e516035a584ab9347a96be363a Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sat, 14 Jan 2023 04:58:34 +0900 Subject: [PATCH 1/3] Add `T: Unpin` bound to ReadHalf::unsplit --- tokio/src/io/split.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tokio/src/io/split.rs b/tokio/src/io/split.rs index 8258a0f7a08..a3aa9d60c07 100644 --- a/tokio/src/io/split.rs +++ b/tokio/src/io/split.rs @@ -74,7 +74,10 @@ impl ReadHalf { /// same `split` operation this method will panic. /// This can be checked ahead of time by comparing the stream ID /// of the two halves. - pub fn unsplit(self, wr: WriteHalf) -> T { + pub fn unsplit(self, wr: WriteHalf) -> T + where + T: Unpin, + { if self.is_pair_of(&wr) { drop(wr); From 171ce0ff8d38b87a39c1e6a16fedc9a2373720e0 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Tue, 17 Jan 2023 23:00:38 +0900 Subject: [PATCH 2/3] chore: prepare Tokio v1.18.5 release --- README.md | 2 +- tokio/CHANGELOG.md | 10 +++++++++- tokio/Cargo.toml | 2 +- tokio/README.md | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0ef20ec0b18..46b1e089cfd 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Make sure you activated the full features of the tokio crate on Cargo.toml: ```toml [dependencies] -tokio = { version = "1.18.4", features = ["full"] } +tokio = { version = "1.18.5", features = ["full"] } ``` Then, on your main.rs: diff --git a/tokio/CHANGELOG.md b/tokio/CHANGELOG.md index 8652e4a0e49..05f4d8152e0 100644 --- a/tokio/CHANGELOG.md +++ b/tokio/CHANGELOG.md @@ -1,3 +1,11 @@ +# 1.18.5 (January 17, 2023) + +### Fixed + +- io: fix unsoundness in `ReadHalf::unsplit` ([#5375]) + +[#5375]: https://github.com/tokio-rs/tokio/pull/5375 + # 1.18.4 (January 3, 2022) ### Fixed @@ -136,7 +144,7 @@ performance improvements. - time: use bit manipulation instead of modulo to improve performance ([#4480]) - net: use `std::future::Ready` instead of our own `Ready` future ([#4271]) - replace deprecated `atomic::spin_loop_hint` with `hint::spin_loop` ([#4491]) -- fix miri failures in intrusive linked lists ([#4397]) +- fix miri failures in intrusive linked lists ([#4397]) ### Documented diff --git a/tokio/Cargo.toml b/tokio/Cargo.toml index 42beeb73d64..3e6b95784b6 100644 --- a/tokio/Cargo.toml +++ b/tokio/Cargo.toml @@ -6,7 +6,7 @@ name = "tokio" # - README.md # - Update CHANGELOG.md. # - Create "v1.0.x" git tag. -version = "1.18.4" +version = "1.18.5" edition = "2018" rust-version = "1.49" authors = ["Tokio Contributors "] diff --git a/tokio/README.md b/tokio/README.md index 0ef20ec0b18..46b1e089cfd 100644 --- a/tokio/README.md +++ b/tokio/README.md @@ -56,7 +56,7 @@ Make sure you activated the full features of the tokio crate on Cargo.toml: ```toml [dependencies] -tokio = { version = "1.18.4", features = ["full"] } +tokio = { version = "1.18.5", features = ["full"] } ``` Then, on your main.rs: From f3ce29a0038c04094c39915c0221c8e428fe7ac3 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Tue, 17 Jan 2023 11:09:42 -0800 Subject: [PATCH 3/3] chore: prepare Tokio v1.20.4 release --- README.md | 2 +- tokio/CHANGELOG.md | 10 ++++++++++ tokio/Cargo.toml | 2 +- tokio/README.md | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3113fadd8ab..288662716ef 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Make sure you activated the full features of the tokio crate on Cargo.toml: ```toml [dependencies] -tokio = { version = "1.20.3", features = ["full"] } +tokio = { version = "1.20.4", features = ["full"] } ``` Then, on your main.rs: diff --git a/tokio/CHANGELOG.md b/tokio/CHANGELOG.md index 60266e42b35..ad6034a6aa2 100644 --- a/tokio/CHANGELOG.md +++ b/tokio/CHANGELOG.md @@ -1,3 +1,13 @@ +# 1.20.4 (January 17, 2023) + +Forward ports 1.18.5 changes. + +### Fixed + +- io: fix unsoundness in `ReadHalf::unsplit` ([#5375]) + +[#5375]: https://github.com/tokio-rs/tokio/pull/5375 + # 1.20.3 (January 3, 2022) This release forward ports changes from 1.18.4. diff --git a/tokio/Cargo.toml b/tokio/Cargo.toml index a83937445b6..121cd5df5c6 100644 --- a/tokio/Cargo.toml +++ b/tokio/Cargo.toml @@ -6,7 +6,7 @@ name = "tokio" # - README.md # - Update CHANGELOG.md. # - Create "v1.0.x" git tag. -version = "1.20.3" +version = "1.20.4" edition = "2018" rust-version = "1.49" authors = ["Tokio Contributors "] diff --git a/tokio/README.md b/tokio/README.md index 3113fadd8ab..288662716ef 100644 --- a/tokio/README.md +++ b/tokio/README.md @@ -56,7 +56,7 @@ Make sure you activated the full features of the tokio crate on Cargo.toml: ```toml [dependencies] -tokio = { version = "1.20.3", features = ["full"] } +tokio = { version = "1.20.4", features = ["full"] } ``` Then, on your main.rs: