Skip to content

feat(v2): improve aslr, adjust max memory size#1263

Merged
jounathaen merged 2 commits intohermit-os:mainfrom
n0toose:v2-aslr-memory-improvements
Mar 9, 2026
Merged

feat(v2): improve aslr, adjust max memory size#1263
jounathaen merged 2 commits intohermit-os:mainfrom
n0toose:v2-aslr-memory-improvements

Conversation

@n0toose
Copy link
Member

@n0toose n0toose commented Feb 17, 2026

Refactor of ASLR to support v2 and v1 images, which achieves the following:

  • It reduces code duplication for generate_address
  • Removes a useless parameter
  • Demonstrates different handling between v1 and v2 images that correspondingly allows users to use v2 with higher memory amounts

Fixes #1257

@n0toose n0toose marked this pull request as draft February 17, 2026 14:48
@n0toose n0toose added the feature/security Concerns security-related behavior, soundness, isolation or reliability. label Feb 17, 2026
@n0toose n0toose force-pushed the v2-aslr-memory-improvements branch from 626b749 to d2830e8 Compare February 17, 2026 14:49
@github-actions github-actions bot removed the feature/security Concerns security-related behavior, soundness, isolation or reliability. label Feb 17, 2026
@codecov
Copy link

codecov bot commented Feb 17, 2026

Codecov Report

❌ Patch coverage is 95.34884% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.91%. Comparing base (beb184c) to head (45e752a).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/vm.rs 96.55% 4 Missing ⚠️
src/linux/x86_64/kvm_cpu.rs 84.61% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1263      +/-   ##
==========================================
+ Coverage   75.29%   75.91%   +0.61%     
==========================================
  Files          27       27              
  Lines        3955     4040      +85     
==========================================
+ Hits         2978     3067      +89     
+ Misses        977      973       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@n0toose n0toose force-pushed the v2-aslr-memory-improvements branch 2 times, most recently from 0c9ffcc to 7e42d07 Compare February 17, 2026 15:17
@n0toose
Copy link
Member Author

n0toose commented Feb 17, 2026

wait, this is still in development and there's a few nasty bugs i just caught

@fogti
Copy link
Contributor

fogti commented Feb 17, 2026

ik.

@n0toose n0toose force-pushed the v2-aslr-memory-improvements branch 2 times, most recently from beb89e2 to a67f146 Compare February 17, 2026 15:42
@n0toose n0toose marked this pull request as ready for review February 17, 2026 15:44
@n0toose n0toose requested review from fogti and jounathaen February 17, 2026 15:45
@n0toose n0toose force-pushed the v2-aslr-memory-improvements branch from a67f146 to 43428ce Compare February 17, 2026 15:48
@n0toose n0toose force-pushed the v2-aslr-memory-improvements branch from 43428ce to 53a2d3b Compare February 17, 2026 16:57
@n0toose n0toose requested a review from jounathaen February 17, 2026 18:53
@n0toose n0toose force-pushed the v2-aslr-memory-improvements branch from 7f36afb to d25cd6c Compare February 18, 2026 14:43
@fogti
Copy link
Contributor

fogti commented Feb 18, 2026

btw. please rebase on main to get rid of the Cargo.toml divergence.

@n0toose n0toose force-pushed the v2-aslr-memory-improvements branch 7 times, most recently from fee3965 to fd102da Compare February 18, 2026 22:08
@n0toose n0toose force-pushed the v2-aslr-memory-improvements branch from fd102da to 7e168b2 Compare February 19, 2026 15:04
@n0toose n0toose force-pushed the v2-aslr-memory-improvements branch 2 times, most recently from 4e8b27d to 876b2f7 Compare March 6, 2026 01:10
Refactor of ASLR to support `v2` and `v1` images, which achieves the
following:
- Move start address derivation into `generate_guest_start_address`
  (f.k.a. `generate_address`)
- Reduce code duplication
- Remove a useless parameter
- Introduce different handling between v1 and v2 images that
  correspondingly allows users to use v2 with higher memory amounts
- Introduce relevant warnings/errors if user-provided parameters
  can cause Uhyve to error
- Add assertions that prevent memory allocations within x86_64 gap

Fixes hermit-os#1257
@n0toose n0toose force-pushed the v2-aslr-memory-improvements branch from 876b2f7 to 8ea7742 Compare March 6, 2026 14:01
@github-actions github-actions bot added the tests Integration and unit-tests verifying Uhyve's behavior label Mar 6, 2026
@n0toose
Copy link
Member Author

n0toose commented Mar 6, 2026

@jounathaen ready for review :)

@n0toose n0toose added feature/optimization Used for issues involving optimization (i.e. code size, performance, benches). feature/security Concerns security-related behavior, soundness, isolation or reliability. labels Mar 6, 2026
@n0toose n0toose force-pushed the v2-aslr-memory-improvements branch from 2dfa251 to 45e752a Compare March 9, 2026 11:38
@n0toose n0toose requested review from fogti and jounathaen March 9, 2026 11:49
@jounathaen jounathaen added this pull request to the merge queue Mar 9, 2026
@jounathaen
Copy link
Member

Nice! Thank you!

Merged via the queue into hermit-os:main with commit 1ee86ee Mar 9, 2026
11 checks passed
@jounathaen jounathaen deleted the v2-aslr-memory-improvements branch March 9, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature/optimization Used for issues involving optimization (i.e. code size, performance, benches). feature/security Concerns security-related behavior, soundness, isolation or reliability. tests Integration and unit-tests verifying Uhyve's behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve hole gap logic

3 participants