Skip to content

Commit

Permalink
ASLR: Mark some variables as unused
Browse files Browse the repository at this point in the history
  • Loading branch information
n0toose authored and jounathaen committed Aug 5, 2024
1 parent 5471cb9 commit d88aabd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ fn detect_cpu_freq() -> u32 {
/// For this purpose, ThreadRng is used. Currently, this feature only works on Linux (x86_64).
///
/// This function gets invoked when a new UhyveVM gets created, provided that the object file is relocatable.
fn generate_address(object_mem_size: usize, params_mem_size: usize) -> u64 {
fn generate_address(object_mem_size: usize, _params_mem_size: usize) -> u64 {
#[cfg(feature = "aslr")]
#[cfg(not(all(target_arch = "x86_64", target_os = "linux")))]
compile_error!("ASLR is only supported on Linux (x86_64)");
Expand Down Expand Up @@ -162,7 +162,7 @@ impl<VCpuType: VirtualCPU> UhyveVm<VCpuType> {
// generate_address will return arch::RAM_START. At this stage, we still need
// to store the u64 somewhere, as this is what MmapMemory needs.
let offset = object.start_addr().unwrap_or_else(|| {
let generated_address = generate_address(object.mem_size(), memory_size);
let _generated_address = generate_address(object.mem_size(), memory_size);
// This sets the generated address and initializes the singleton GUEST_ADDRESS that
// we use for the virt_to_phys functions
guest_address = GuestPhysAddr::new(0x99000);
Expand Down

0 comments on commit d88aabd

Please sign in to comment.