Skip to content

Commit

Permalink
[catnap] Bug Fix: fix use-after-free related to I/O cancellation in c…
Browse files Browse the repository at this point in the history
…atnap for Windows
  • Loading branch information
kyleholohan authored and ppenna committed Feb 1, 2024
1 parent c48b41a commit 0954a64
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/rust/catnap/win/overlapped.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,12 @@ impl IoCompletionPort {
if err.errno == libc::ECANCELED {
if let Err(cancel_err) = cancel(completion.get_state_ref(), overlapped) {
warn!("cancellation failed: {}", cancel_err);
} else {
return Err(err);
}
}

// NOTE: the semantics of completion ports with cancellation is unclear: CancelIoEx
// documentation implies that some operations may not post a completion packet after this
// operation. If completions are found to leak, this may be why.
completion.abandon();
return Err(err);
},
Expand Down

0 comments on commit 0954a64

Please sign in to comment.