Rust nightly update - covert_channel_evaluation

This commit is contained in:
Guillume DIDIER 2021-06-10 11:21:23 +02:00
parent 7ecb6f5244
commit f9fd75e3e9
2 changed files with 8 additions and 8 deletions

View File

@ -7,9 +7,9 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
rand = "0.7.3" rand = "0.8.3"
bit_field = "0.10.1" bit_field = "0.10.1"
turn_lock = { path = "../turn_lock" } turn_lock = { path = "../turn_lock" }
cache_utils = { path = "../cache_utils" } cache_utils = { path = "../cache_utils" }
nix = "0.18.0" nix = "0.20.0"
cache_side_channel = { path = "../cache_side_channel" } cache_side_channel = { path = "../cache_side_channel" }

View File

@ -35,11 +35,11 @@ use std::thread;
* Safety considerations : Not ensure thread safety, need proper locking as needed. * Safety considerations : Not ensure thread safety, need proper locking as needed.
*/ */
pub trait CovertChannel: Send + Sync + CoreSpec + Debug { pub trait CovertChannel: Send + Sync + CoreSpec + Debug {
type Handle; type CovertChannelHandle;
const BIT_PER_PAGE: usize; const BIT_PER_PAGE: usize;
unsafe fn transmit(&self, handle: &mut Self::Handle, bits: &mut BitIterator); unsafe fn transmit(&self, handle: &mut Self::CovertChannelHandle, bits: &mut BitIterator);
unsafe fn receive(&self, handle: &mut Self::Handle) -> Vec<bool>; unsafe fn receive(&self, handle: &mut Self::CovertChannelHandle) -> Vec<bool>;
unsafe fn ready_page(&mut self, page: *const u8) -> Result<Self::Handle, ()>; // TODO Error Type unsafe fn ready_page(&mut self, page: *const u8) -> Result<Self::CovertChannelHandle, ()>; // TODO Error Type
} }
#[derive(Debug)] #[derive(Debug)]
@ -118,7 +118,7 @@ impl Iterator for BitIterator<'_> {
} }
struct CovertChannelParams<T: CovertChannel + Send> { struct CovertChannelParams<T: CovertChannel + Send> {
handles: Vec<TurnHandle<T::Handle>>, handles: Vec<TurnHandle<T::CovertChannelHandle>>,
covert_channel: Arc<T>, covert_channel: Arc<T>,
} }
@ -162,7 +162,7 @@ pub fn benchmark_channel<T: 'static + Send + CovertChannel>(
) -> CovertChannelBenchmarkResult { ) -> CovertChannelBenchmarkResult {
// Allocate pages // 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 size = num_pages * PAGE_SIZE;
let mut m = MMappedMemory::new(size, false); let mut m = MMappedMemory::new(size, false);