Skip to content

Add process hardening: core dumps, mlock, memfd#44

Merged
jgowdy-godaddy merged 1 commit intomainfrom
feat/process-hardening
Apr 16, 2026
Merged

Add process hardening: core dumps, mlock, memfd#44
jgowdy-godaddy merged 1 commit intomainfrom
feat/process-hardening

Conversation

@jgowdy-godaddy
Copy link
Copy Markdown
Contributor

Summary

  • enclaveapp_core::process module: harden_process() disables core dumps via setrlimit(RLIMIT_CORE, 0) on Unix; mlock_buffer()/munlock_buffer() lock secret memory pages to prevent swap paging
  • Launcher mlock integration: env override values are mlocked before child spawn and zeroized + munlocked after the child exits, preventing secrets from persisting in process memory or swap
  • create_memfd_config() (Linux): uses memfd_create to create anonymous in-memory config files with no filesystem path, eliminating the same-user temp file read attack surface; sealed after write to prevent modification

Test plan

  • cargo test --workspace passes (including new tests for harden_process, core_dumps_are_disabled, mlock_empty_buffer, munlock_empty_buffer, zeroize_str_clears_contents)
  • cargo clippy --workspace --all-targets -- -D warnings passes clean
  • cargo fmt --all -- --check passes clean
  • Verify consuming apps (npmenc, sshenc, awsenc) compile with the run() signature change (&LaunchRequest -> &mut LaunchRequest)

@jgowdy-godaddy jgowdy-godaddy force-pushed the feat/process-hardening branch from db068ad to a077fde Compare April 16, 2026 18:59
- 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)
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