Add process hardening: core dumps, mlock, memfd#44
Merged
jgowdy-godaddy merged 1 commit intomainfrom Apr 16, 2026
Merged
Conversation
db068ad to
a077fde
Compare
- enclaveapp_core::process: harden_process() disables core dumps via setrlimit; mlock_buffer/munlock_buffer for secret memory pages - Launcher: mlock env_override values before spawn, zeroize and munlock after child exits - temp_config: add create_memfd_config() for Linux anonymous memory files (no filesystem path, eliminates same-user temp file read attack)
a077fde to
b499a56
Compare
This was referenced Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
enclaveapp_core::processmodule:harden_process()disables core dumps viasetrlimit(RLIMIT_CORE, 0)on Unix;mlock_buffer()/munlock_buffer()lock secret memory pages to prevent swap pagingcreate_memfd_config()(Linux): usesmemfd_createto create anonymous in-memory config files with no filesystem path, eliminating the same-user temp file read attack surface; sealed after write to prevent modificationTest plan
cargo test --workspacepasses (including new tests forharden_process,core_dumps_are_disabled,mlock_empty_buffer,munlock_empty_buffer,zeroize_str_clears_contents)cargo clippy --workspace --all-targets -- -D warningspasses cleancargo fmt --all -- --checkpasses cleannpmenc,sshenc,awsenc) compile with therun()signature change (&LaunchRequest->&mut LaunchRequest)