Skip to content

fix(memory): add MADV_WIPEONFORK to os_lock on Linux#206

Merged
jgowdy-godaddy merged 1 commit into
mainfrom
fix/wipeonfork-on-lock
Jun 27, 2026
Merged

fix(memory): add MADV_WIPEONFORK to os_lock on Linux#206
jgowdy-godaddy merged 1 commit into
mainfrom
fix/wipeonfork-on-lock

Conversation

@jgowdy-godaddy

Copy link
Copy Markdown
Contributor

Summary

  • Adds MADV_WIPEONFORK hint to locked pages on Linux so forked child processes have the pages automatically zeroed rather than inheriting key material
  • Already had MADV_DONTDUMP; this is the matching fork-safety primitive
  • Best-effort (like DONTDUMP) — kernel silently ignores it if unsupported

Test plan

  • cargo test --workspace --all-targets passes (all existing memory tests pass)
  • No consumer breakage: zeroing on fork is always correct for key material; no legitimate use case needs forks to inherit locked secrets

Prevents forked child processes from inheriting locked key material.
@jgowdy-godaddy jgowdy-godaddy merged commit 3530e38 into main Jun 27, 2026
3 checks passed
@jgowdy-godaddy jgowdy-godaddy deleted the fix/wipeonfork-on-lock branch June 27, 2026 03:14
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