Skip to content

ASLR doesn't work on macOS #949

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

Closed
stlankes opened this issue Apr 13, 2025 · 0 comments · Fixed by #952
Closed

ASLR doesn't work on macOS #949

stlankes opened this issue Apr 13, 2025 · 0 comments · Fixed by #952

Comments

@stlankes
Copy link
Collaborator

On macOS, uhyve have to disable ASLR support. For instance,

RUST_LOG=debug target/debug/uhyve --no-aslr data/aarch64/hello_world

works on macOS. Without the flag --no-aslr, uhyve will crash:

RUST_LOG=debug target/debug/uhyve data/aarch64/hello_world 
[INFO  hermit_entry::elf] Parsing kernel from ELF at 0x148008000..0x1480d7cd0 (len = 0xcfcd0 B / 851152 B)
[INFO  hermit_entry::elf] Found Hermit version 0.11.0
[INFO  uhyvelib::vm] Loading a Hermit v0.11.0 kernel
[DEBUG uhyvelib::vm] Kernel gets loaded to 0x9be40000
[INFO  hermit_entry::elf] Loading kernel to 0x105a68000..0x105b1b9f0 (len = 0xb39f0 B / 735728 B)
[INFO  hermit_entry::elf] TLS is at 0x9bed89b8..0x9bed8a28 (len =  0x70 B / 112 B)
[DEBUG uhyvelib::vm] Stack starts at 0x9be38000
[DEBUG uhyvelib::macos::aarch64::vcpu] Create VM...
[DEBUG uhyvelib::macos::aarch64::vcpu] Map guest memory...
[DEBUG uhyvelib::macos::aarch64::vcpu] Create GIC...
[WARN  uhyvelib::macos::aarch64::vcpu] CPU base frequency detection not implemented!
[DEBUG uhyvelib::vm] Writing FDT in memory
[DEBUG uhyvelib::vm] fdt.len() = 665
[DEBUG uhyvelib::vm] Writing BootInfo to PhysAddr(0x9be09000)
[DEBUG uhyvelib::vm] Initialize guest memory
[WARN  uhyvelib::arch::aarch64] aarch64 pagetable initialization is untested!
[DEBUG uhyvelib::arch::aarch64] mapping frame 9be00000 to pagetable 0-2-1247-3584

thread 'main' panicked at library/core/src/panicking.rs:218:5:
unsafe precondition(s) violated: slice::from_raw_parts_mut requires the pointer to be aligned and non-null, and the total size of the slice not to exceed `isize::MAX`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread caused non-unwinding panic. aborting.
zsh: abort      RUST_LOG=debug target/debug/uhyve data/aarch64/hello_world
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 a pull request may close this issue.

1 participant