hw: deny to attach managed dataspaces to VMs

Issue #3111
This commit is contained in:
Alexander Boettcher 2019-01-10 13:58:11 +01:00 committed by Norman Feske
parent 5b8e1cdbbb
commit 9f8198d946
1 changed files with 4 additions and 0 deletions

View File

@ -59,6 +59,10 @@ void Vm_session_component::attach(Dataspace_capability ds_cap, addr_t vm_addr)
_ds_ep->apply(ds_cap, [&] (Dataspace_component *dsc) {
if (!dsc) throw Invalid_dataspace();
/* unsupported - deny otherwise arbitrary physical memory can be mapped to a VM */
if (dsc->managed())
throw Invalid_dataspace();
_attach(dsc->phys_addr(), vm_addr, dsc->size());
});
}