Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASLR: Lay down the foundations #725

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft

ASLR: Lay down the foundations #725

wants to merge 12 commits into from

Commits on Sep 18, 2024

  1. ASLR: Lay down the foundations

    - Move x86_64-related paging code to src/arch/x86_64/paging
    - Tests: x86_64-related paging tests should use a guest_address that is
      not 0
    - Tests: Move them in separate files, use appropriate 'use' directives
    - Tests: Use init_guest_mem wrapper in test_virt_to_phys
    - Fix kernel memory loading
    - Add guest_address getter in UhyveVm
    - Change names of constants to clarify their purpose
    - Use u64 for arch::RAM_START instead of GuestVirtAddr
    - Remove pagetable_l0 from virt_to_phys function
    - Various `cargo fmt`-related changes
    - aarch64: Blindly replace constant names and similar RAM_START change
    
    We currently rely on guest_address in MmapMemory to calculate the
    offsets during the initialization of the VM and when converting
    virtual addresses to physical addresses. The latter case is intended
    to be temporary - we should read the value from the CR3 register at
    a later point, but this is too complex for the time being because of
    the different architectures.
    
    Although this current revision does work with relocatable binaries, it
    is not making use of this functionality _just_ yet.
    
    Fixes hermit-os#719.
    
    Co-authored-by: Jonathan <[email protected]>
    n0toose and jounathaen committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    b8e07d9 View commit details
    Browse the repository at this point in the history
  2. ASLR: Use OnceLock for storing guest_address

    This will be used by other functions for now, instead of
    relying on mem.guest_address.
    
    guest_address should only be a GuestPhysAddr internally for now,
    as other functions in places like src/linux/x86_64/kvm_cpu.rs
    use it.
    n0toose authored and jounathaen committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    6df01b7 View commit details
    Browse the repository at this point in the history
  3. WIP ASLR work

    n0toose authored and jounathaen committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    61effc2 View commit details
    Browse the repository at this point in the history
  4. ASLR: Remove superfluous start_address entry

    Removes the start_address entry and uses the existing offset entry
    instead. Plus some `cargo fmt` changes
    n0toose authored and jounathaen committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    931f6a4 View commit details
    Browse the repository at this point in the history
  5. ASLR: Mark some variables as unused

    n0toose authored and jounathaen committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    9d7d7a4 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    f2d6622 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    abf2ec9 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    e2ca713 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    57f01a7 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    702bc0a View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    89ea5a6 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    258784a View commit details
    Browse the repository at this point in the history