From f9fd75e3e9093c828a0a4235d6ec4ff7f3b10c80 Mon Sep 17 00:00:00 2001 From: Guillume DIDIER Date: Thu, 10 Jun 2021 11:21:23 +0200 Subject: [PATCH] Rust nightly update - covert_channel_evaluation --- covert_channels_evaluation/Cargo.toml | 4 ++-- covert_channels_evaluation/src/lib.rs | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/covert_channels_evaluation/Cargo.toml b/covert_channels_evaluation/Cargo.toml index 09bc917..06b415f 100644 --- a/covert_channels_evaluation/Cargo.toml +++ b/covert_channels_evaluation/Cargo.toml @@ -7,9 +7,9 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -rand = "0.7.3" +rand = "0.8.3" bit_field = "0.10.1" turn_lock = { path = "../turn_lock" } cache_utils = { path = "../cache_utils" } -nix = "0.18.0" +nix = "0.20.0" cache_side_channel = { path = "../cache_side_channel" } diff --git a/covert_channels_evaluation/src/lib.rs b/covert_channels_evaluation/src/lib.rs index 3242e7e..29df623 100644 --- a/covert_channels_evaluation/src/lib.rs +++ b/covert_channels_evaluation/src/lib.rs @@ -35,11 +35,11 @@ use std::thread; * Safety considerations : Not ensure thread safety, need proper locking as needed. */ pub trait CovertChannel: Send + Sync + CoreSpec + Debug { - type Handle; + type CovertChannelHandle; const BIT_PER_PAGE: usize; - unsafe fn transmit(&self, handle: &mut Self::Handle, bits: &mut BitIterator); - unsafe fn receive(&self, handle: &mut Self::Handle) -> Vec; - unsafe fn ready_page(&mut self, page: *const u8) -> Result; // TODO Error Type + unsafe fn transmit(&self, handle: &mut Self::CovertChannelHandle, bits: &mut BitIterator); + unsafe fn receive(&self, handle: &mut Self::CovertChannelHandle) -> Vec; + unsafe fn ready_page(&mut self, page: *const u8) -> Result; // TODO Error Type } #[derive(Debug)] @@ -118,7 +118,7 @@ impl Iterator for BitIterator<'_> { } struct CovertChannelParams { - handles: Vec>, + handles: Vec>, covert_channel: Arc, } @@ -162,7 +162,7 @@ pub fn benchmark_channel( ) -> CovertChannelBenchmarkResult { // Allocate pages - let old_affinity = set_affinity(&channel.main_core()); + let old_affinity = set_affinity(&channel.main_core()).unwrap(); let size = num_pages * PAGE_SIZE; let mut m = MMappedMemory::new(size, false);