Skip to content

fix(whp): use NULL DACL for map_file_cow file mapping sections#1386

Merged
jprendes merged 4 commits intohyperlight-dev:mainfrom
danbugs:fix/whp-map-file-cow-dacl
Apr 17, 2026
Merged

fix(whp): use NULL DACL for map_file_cow file mapping sections#1386
jprendes merged 4 commits intohyperlight-dev:mainfrom
danbugs:fix/whp-map-file-cow-dacl

Conversation

@danbugs
Copy link
Copy Markdown
Contributor

@danbugs danbugs commented Apr 17, 2026

Summary

  • File-backed sections created with the default DACL via CreateFileMappingW fail with ERROR_ACCESS_DENIED when mapped into a surrogate process via MapViewOfFileNuma2 on modern Windows
  • Fix: create the section with a NULL DACL security descriptor granting unrestricted access
  • The mapping remains file-backed and zero-copy (FILE_MAP_READ, no data copied)
  • Adds a map-file-cow-test example that exercises the full lifecycle (create → map_file_cow → evolve → call) — fails before this change on Windows, succeeds after

@danbugs danbugs added the kind/bugfix For PRs that fix bugs label Apr 17, 2026
@danbugs danbugs force-pushed the fix/whp-map-file-cow-dacl branch from 8e90e1c to 397dec1 Compare April 17, 2026 07:07
File-backed sections created with the default DACL via
CreateFileMappingW fail with ERROR_ACCESS_DENIED when mapped into
a surrogate process via MapViewOfFileNuma2 on modern Windows.

Create the section with a NULL DACL security descriptor which grants
unrestricted access. The mapping remains file-backed and zero-copy
(FILE_MAP_READ, no data copied).

Also adds a map-file-cow-test example that exercises the full
lifecycle (create → map_file_cow → evolve → call) and would fail
before this change on Windows.

Signed-off-by: danbugs <danilochiarlone@gmail.com>
@danbugs danbugs force-pushed the fix/whp-map-file-cow-dacl branch from 397dec1 to fa1a5ac Compare April 17, 2026 07:25
@andreiltd andreiltd force-pushed the fix/whp-map-file-cow-dacl branch 2 times, most recently from e77a3ad to 9bd786c Compare April 17, 2026 08:17
Comment thread src/hyperlight_host/src/sandbox/file_mapping.rs Outdated
Comment thread src/hyperlight_host/src/sandbox/file_mapping.rs Outdated
Copy link
Copy Markdown
Contributor

@dblnz dblnz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have anything else to add. Once the other comments are fixed, I'll approve

Comment thread src/hyperlight_host/src/sandbox/file_mapping.rs Outdated
Comment thread src/hyperlight_host/src/sandbox/file_mapping.rs Outdated
@andreiltd andreiltd force-pushed the fix/whp-map-file-cow-dacl branch 2 times, most recently from 18b6c26 to 46879cc Compare April 17, 2026 09:25
Copy link
Copy Markdown
Contributor

@jprendes jprendes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread src/hyperlight_host/src/sandbox/file_mapping.rs
Signed-off-by: Tomasz Andrzejak <andreiltd@gmail.com>
Signed-off-by: Tomasz Andrzejak <andreiltd@gmail.com>
Signed-off-by: Tomasz Andrzejak <andreiltd@gmail.com>
@andreiltd andreiltd force-pushed the fix/whp-map-file-cow-dacl branch from 46879cc to c24e4f3 Compare April 17, 2026 11:45
@jprendes jprendes enabled auto-merge (squash) April 17, 2026 11:49
@jprendes jprendes merged commit 17cddf3 into hyperlight-dev:main Apr 17, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bugfix For PRs that fix bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants