diff --git a/src/driver/connect.rs b/src/driver/connect.rs index d4dad8ee..c3168fc1 100644 --- a/src/driver/connect.rs +++ b/src/driver/connect.rs @@ -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, } impl Op { @@ -17,7 +19,7 @@ impl Op { Op::submit_with( Connect { fd: fd.clone(), - socket_addr, + socket_addr: Box::new(socket_addr), }, |connect| { opcode::Connect::new(