Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Box the socket address to allow moving the Connect future #126

Merged
merged 1 commit into from
Oct 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/driver/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ use std::io;
/// Open a file
pub(crate) struct Connect {
fd: SharedFd,
socket_addr: SockAddr,
// this avoids a UAF (UAM?) if the future is moved, but not if the future is
// dropped. no Op can be dropped before completion in tokio-uring land right now.
socket_addr: Box<SockAddr>,
}

impl Op<Connect> {
Expand All @@ -17,7 +19,7 @@ impl Op<Connect> {
Op::submit_with(
Connect {
fd: fd.clone(),
socket_addr,
socket_addr: Box::new(socket_addr),
},
|connect| {
opcode::Connect::new(
Expand Down