Output:
~/work/local/hello-vm-memory master* 7m 13s
❯ target/debug/hello-vm-memory
GuestMemoryMmap { regions: [GuestRegionMmap { mapping: MmapRegion { addr: 0x7f593adbf000, size: 8192, bitmap: (), file_offset: None, prot: 3, flags: 16418, owned: true, hugetlbfs: None }, guest_base: GuestAddress(0) }] }
So, in case you’ve ever wondered, this is how you map anonymous memory with vm-memory crate:
//! Copyright (c) Jarkko Sakkinen 2024
#![deny(clippy::all)]
#![deny(clippy::pedantic)]
use vm_memory::{GuestAddress, GuestMemoryMmap};
fn main() {
let mem: GuestMemoryMmap<()> =
GuestMemoryMmap::from_ranges(&[(GuestAddress(0u64), 8192usize)]).unwrap();
println!("{:?}", mem);
}
The type parameter is for Bitmap.
I’ll do a small test program for each type of memory that we need in Enarx and after that make the changes to the project itself. Changes are simple but the code base is large so this is fastest way to formalize a decent patch.
So next step is /dev/kvm
test.
#Anonym has the same #privacy bug as #Signal:
Objectively we can thus come to the conclusion that it is belief system based #security.
Especially this is weird given the collaboration with a browser vendor.
Even for AGPL code confidentiality can be faked by emulating necessary opcodes with a modified QEMU.
The whole core idea of confidential computing is based on exactly to the ability for client to verify that the payload is unmodified. This is just fake marketing.
The security promise is exactly as truthful as it was for ANON phones that FBI sold to crooks ;-)
Call sites:
~/work/github/enarx/enarx main
❯ git grep -e Map\<
crates/enarx-config/src/lib.rs: pub env: HashMap<String, String>,
src/backend/binary.rs: pages: Map<perms::ReadWrite>,
src/backend/kvm/builder.rs: fn map(&mut self, pages: Map<perms::ReadWrite>, to: usize, with: u32) -> anyhow::Result<()> {
src/backend/kvm/builder.rs: pages: &Map<perms::ReadWrite>,
src/backend/kvm/mem.rs: backing: Map<perms::ReadWrite>,
src/backend/kvm/mem.rs: pub fn new(slot: Slot, backing: Map<perms::ReadWrite>) -> Self {
src/backend/kvm/mem.rs: backing_memory: &Map<perms::ReadWrite>,
src/backend/kvm/mod.rs: pages: Map<perms::ReadWrite>,
src/backend/sev/builder.rs: mut pages: Map<perms::ReadWrite>,
src/backend/sev/hasher.rs: fn map(&mut self, pages: Map<perms::ReadWrite>, to: usize, with: u32) -> anyhow::Result<()> {
src/backend/sgx/builder.rs: mmap: Map<perms::Unknown>,
src/backend/sgx/builder.rs: pages: Map<perms::ReadWrite>,
src/backend/sgx/hasher.rs: pages: Map<perms::ReadWrite>,
src/backend/sgx/mod.rs: mem: Map<perms::Unknown>,