Re: Passing a memory map

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 29 Dec 2004, Maurizio Monge wrote:

> it is well known that a file descritor can be passed from a process to
> another.  Is it possible to modify the kernel to allow the same thing to
> be done with memory maps?

You'd have to essentially "pass a VMA" from one process
to another.  The big complication is that the userland
processes do not know about VMAs, but only about ranges
of addresses.

It should still be possible to implement, though.

> any hint (where i should start, what i should learn)?

You will want to read do_mmap_pgoff and sys_mprotect
functions and all the functions surrounding them.

They should give you an idea to the data structures
you need to read and copy over to another process.

Of course, you need to make sure that the receiving
process is not able to grow the mmaps it received,
but can only shrink or unmap them!  Otherwise the
receiving process could end up getting access to
more memory than it should.

You seem to have picked a challenging project ;)

-- 
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux