Skip to content

[46.0.0] Fix leak in fd_renumber#13649

Merged
alexcrichton merged 1 commit into
bytecodealliance:release-46.0.0from
alexcrichton:back46
Jun 15, 2026
Merged

[46.0.0] Fix leak in fd_renumber#13649
alexcrichton merged 1 commit into
bytecodealliance:release-46.0.0from
alexcrichton:back46

Conversation

@alexcrichton

Copy link
Copy Markdown
Member

This commit fixes a file descriptor leak in the WASIp1 implementation of fd_renumber in the wasmtime-wasi crate. Notably the previous implementation did not fully close the file descriptor being renumbered-to which meant that the host's resources for the file, including the file descriptor, stayed alive. The fix here is to validate both fds exist and then delegate to the fd_close call to close the destination.

This commit fixes a file descriptor leak in the WASIp1 implementation of
`fd_renumber` in the `wasmtime-wasi` crate. Notably the previous
implementation did not fully close the file descriptor being
renumbered-to which meant that the host's resources for the file,
including the file descriptor, stayed alive. The fix here is to validate
both fds exist and then delegate to the `fd_close` call to close the
destination.
@alexcrichton alexcrichton requested review from a team as code owners June 15, 2026 14:36
@alexcrichton alexcrichton requested review from pchickey and removed request for a team June 15, 2026 14:36
@alexcrichton alexcrichton merged commit 7535c02 into bytecodealliance:release-46.0.0 Jun 15, 2026
193 checks passed
@alexcrichton alexcrichton deleted the back46 branch June 15, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants