[][src]Module sunrise_kernel::paging::cross_process

Cross Process Mapping

Provides mechanics for temporarily mirroring a Userland mapping in KernelLand.

When kernel has to access memory in UserLand (for example a user has provided a buffer as an argument of a syscall), it can do it in two ways:

This module covers the second case.

The remapping is represented by a CrossProcessMapping structure. It is created from a reference to the mapping being mirrored, and the KernelLand address where it will be remapped. When this struct is dropped, the frames are unmap'd from KernelLand.

A CrossProcessMapping shares the ownership of the underlying frames. As such, only refcounted memory regions can be mirror-mapped. This is rarely a problem, as almost all memory is refcounted.

There is no guarantee that the CrossProcessMapping doesn't outlive the original mapping.

Structs

CrossProcessMapping

A struct representing a UserLand mapping mirrored in KernelSpace.