LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Access physical memory in Dom0 from kernel in DomU (https://www.linuxquestions.org/questions/linux-kernel-70/access-physical-memory-in-dom0-from-kernel-in-domu-913396/)

leechaotang 11-14-2011 12:19 AM

Access physical memory in Dom0 from kernel in DomU
 
Hi,

I want to access a physical address in Dom0 from the kernel in DomU, how can I do it?

I try to do it by the following step,

1. Allocate a virtual memory address space in DomU kernel.
struct vm_struct * get_vm_area (unsigned long size, unsigned long flags);

2. Map the virtual memory address space to physical address in Dom0
???????????


Is there function call can do the ???????? part ?

Pearlseattle 11-14-2011 12:34 PM

Hi
Sorry, but wouldn't that be a security breach? I always thought that domUs/VMs were supposed to be self-contained and not able to directly communicate to the outer world... (and that it would therefore be more "secure" to run a dangerous app in a VM rather than on the physical machine).

sundialsvcs 11-14-2011 05:47 PM

Yup ... the virtual-machine monitor ensures that each VM is separate.

Pearlseattle 11-16-2011 04:51 PM

So, leechaotang, forget it - unless you're a cracker and you find a 0-day exploit for the VM that you're using.
Or if you want to hear about crazy ideas you could e.g. copy in the dom0, using a cronjob, the whole memory content to a file and access it via a share from domU or some more direct way again using softlinks, pipes, tubes or whatever... .
Don't wanna think about it - I'll leave the dark arts of memory access through VMs to you so that you have a chance of becoming famous (please mention sundialsvcs and Pearlseattle when you're interviewed by Slashdot) :)

leechaotang 11-16-2011 05:30 PM

Hi,

Maybe I am not show my issue clearly, I mean I can do anything on Dom0/DomU and I want to access the SRAM physical address on Dom0 from DomU.

I use the KVM hypervisor, someone talk to me to modify the page table, but it is a little tough ...


All times are GMT -5. The time now is 01:00 AM.