Xen memory management
A message that is not in the archive (sent off-list or not yet received): [email protected]
Thank you for bringing this topic up Myong. Thanks Mark for explaining the M2P mapping.
[email protected] wrote on 02/16/2006 09:27:36 AM:
Quoted 5 lines
Quoted 3 lines
Xen interface manual describes the following:
"Xen maintains a globally readable machine-to-physical table which records the mapping from machine page frames to pseudo-physical ones."...
It's mapped into a domain's address space. (nb. this is x86 specific).
I
Quoted 4 lines
can't remember where it's mapped, though... Anyhow, the overhead of a hypercall isn't necessary to read it, it's just a single memory access.
The advantage here is that a domain can map a machine address back into
a
Quoted 1 line
guest physical address by simply doing a table lookup. This also means
it
Quoted 1 line
can see the M2P mappings for all the other domains,
...
Quoted 2 lines
but this doesn't really
leak any information since it still can't see the memory contents of
other
Quoted 1 line
domains.
The sentence above seems optimistic. To determine how much a domain can leak through this shared table is an interesting problem.
I have two questions related to this problem:
a) How easily can a domain affect its own M2P mapping?
--> this gives a first estimate about how easily a domain can modulate
information onto the mapping,
which can be observed by other domains looking at this mapping
b) Can this global mapping be converted to a per-domain mapping so that a domain can only access its own M2P mappings?
(Is there any reason why one domain would need to see another domain's
mapping?)
Note: there are non-Xen specific implicit/covert/illegal channels based on shared HW/SW resources. While this is not a Xen-specific problem, Xen as an open-source VMM offers a great foundation for researchers to apply existing and cooperatively develop new covert channel analysis technology and tools. Finding covert channels is one thing, estimating their real channel bandwidth is as important.
Quoted 2 lines
It is, however, a channel by which malicious guests might theoretically exchange data whilst bypassing security checks.
Yes. It is up to security researchers to bring this "theoretically" into a "real" context before selling solutions to users/customers. Very hard problem.
Quoted 2 lines
This is only reallyan issue
in Mandatory Access Control systems, and even there there are liable to
be
Quoted 1 line
many other covert channels too.
The question that might arise in the future is where to start restricting covert channels and how to balance the trade-off between security and performance/code intrusiveness of security configurations. To find a trade-off, we need bandwidth estimates for covert channels, which likely depend on the VMM configuration (noise on this covert channel can depend on how many VMs are running, what kind of resource control is applied, etc.).
Are covert channel analysis tools available that apply to the C language and the programming environment of Xen?
The Chinese Wall policy available in the Xen Access Control Module offers a first trade-off between security and utilization (risk mitigation): it supervises which VMs can run at the same time on the same system. In doing so, it controls the VMs among which the hardware resources and hypervisor resources are shared.
Quoted 1 line
Quoted 1 line
Is it possible to read memory content of guest domain B (or domain 0)
from
Quoted 3 lines
Quoted 1 line
guest domain A?
No. On x86 you can only read memory if you can map it with the
pagetables
Quoted 1 line
(i.e. no direct physical addressing). You can therefore only read the
memory
Quoted 1 line
contents of another domain if you can create a pagetable mapping for
that
Quoted 1 line
domain. Xen validates any updates to the pagetables to make sure that
they
Quoted 1 line
are safe, so a domain can't create arbitrary mappings to other domains -
if
Quoted 1 line
it tries to make an illegal mapping, Xen won't allow the pagetable
updates.
Thanks
Reiner
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 9 lines
Quoted 2 lines
but this doesn't really
leak any information since it still can't see the memory contents ofother
Quoted 1 line
domains.
The sentence above seems optimistic. To determine how much a domain can leak through this shared table is an interesting problem.
Yep. It doesn't leak any security-related information just by being there, but it could certainly be used as a signalling channel.
Quoted 4 lines
a) How easily can a domain affect its own M2P mapping?
--> this gives a first estimate about how easily a domain can modulate
information onto the mapping,
which can be observed by other domains looking at this mapping
It's updated using a hypercall - the hypercall could of course be rate-limited but this might impact performance. I'm not sure that doing this would affect performance much in most cases, but it'd have an impact on network IO.
Quoted 4 lines
b) Can this global mapping be converted to a per-domain mapping so that a domain can only access its own M2P mappings?
(Is there any reason why one domain would need to see another domain's
mapping?)
Full details in my other e-mail... Essentially there's no benefit to being able to see another domains mappings, but maintaining a per-domain M2P would imply a substantial extra space usage.
Less-flexible memory allocation could be used to limit the necessary size of the M2P (i.e. allocate in larger chunks, instead of a per-page basis), I guess, but this would require changes to the IO model to work well (consider page flipping).
Quoted 6 lines
Note: there are non-Xen specific implicit/covert/illegal channels based on shared HW/SW resources. While this is not a Xen-specific problem, Xen as an open-source VMM offers a great foundation for researchers to apply existing and cooperatively develop new covert channel analysis technology and tools. Finding covert channels is one thing, estimating their real channel bandwidth is as important.
*nod*
Quoted 10 lines
The question that might arise in the future is where to start restricting covert channels and how to balance the trade-off between security and performance/code intrusiveness of security configurations. To find a trade-off, we need bandwidth estimates for covert channels, which likely depend on the VMM configuration (noise on this covert channel can depend on how many VMs are running, what kind of resource control is applied, etc.).
Are covert channel analysis tools available that apply to the C language and the programming environment of Xen?
I guess a straightforward way might just be to write code to exploit these covert channels? It'd certainly be quite interesting and would give a concrete measure of bandwidth (nb. an analysis of covert channels and their bandwidth in one or more modern enterprise-class VMMs would make an interesting paper!)
There's probably a surprisingly large set of possible covert channels - particularly once you consider dom0.
Cheers,
Mark
Quoted 38 lines
The Chinese Wall policy available in the Xen Access Control Module offers a first trade-off between security and utilization (risk mitigation): it supervises which VMs can run at the same time on the same system. In doing so, it controls the VMs among which the hardware resources and hypervisor resources are shared.
Quoted 1 line
Quoted 1 line
Is it possible to read memory content of guest domain B (or domain 0)
from
Quoted 3 lines
Quoted 1 line
guest domain A?
No. On x86 you can only read memory if you can map it with the
pagetables
Quoted 1 line
(i.e. no direct physical addressing). You can therefore only read the
memory
Quoted 1 line
contents of another domain if you can create a pagetable mapping for
that
Quoted 1 line
domain. Xen validates any updates to the pagetables to make sure that
they
Quoted 1 line
are safe, so a domain can't create arbitrary mappings to other domains -
if
Quoted 1 line
it tries to make an illegal mapping, Xen won't allow the pagetable
updates.
Thanks
Reiner
Signature · 4 lines
Dave: Just a question. What use is a unicyle with no seat? And no pedals! Mark: To answer a question with a question: What use is a skateboard? Dave: Skateboards have wheels. Mark: My wheel has a wheel!