Skip to content

wasm: free clone callback after creation failure - #58

Merged
tombl merged 1 commit into
wasmfrom
fix/wasm-clone-failure-cleanup
Oct 4, 2026
Merged

tombl merged 1 commit into
wasmfrom
fix/wasm-clone-failure-cleanup

Conversation

@tombl

@tombl tombl commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

applies the fix from HighCWu@fa8637a, fixing a leak that could occur if you repeatedly call clone with invalid flags.

The clone syscall allocates clone_fn before calling kernel_clone(), but
only the child callback frees it. If creation fails, for example because
CLONE_THREAD is set without CLONE_SIGHAND, no child runs the callback and
the allocation leaks.

Free clone_fn when kernel_clone() returns an error. On success, leave
ownership with wasm_call_clone_fn().

Based on HighCWu/linux commit fa8637a
("wasm: free clone callback after creation failure").
@tombl
tombl marked this pull request as ready for review October 4, 2026 14:08
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-10-04T14:18:52.116790Z 6ee1a9c Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@tombl
tombl merged commit 5ad6142 into wasm Oct 4, 2026
1 check passed
@tombl
tombl deleted the fix/wasm-clone-failure-cleanup branch October 4, 2026 14:11
tombl added a commit to tombl/distro that referenced this pull request Oct 4, 2026
Update the Linux pin to 5ad61429eac77535a904e70153ce1502bc82ff86,
the commit merged into wasm from tombl/linux#58.

The merged tree matches the previously tested PR head. Recomputed the
unpacked source NAR hash from the merged commit archive; it is unchanged.
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.

1 participant