kernel: services: don't remap memory on intra-process lends

This brings intra-process lending in-line with intra-process sending,
where memory is not remapped the pointer is simply reused.

We may change this at a later point in order to further enforce the
concept of lent-memory-is-inaccessible, so do not rely in this behavior.

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2021-04-06 09:08:03 +08:00
parent d83b7de12d
commit 21a8ddd458

View file

@ -1147,6 +1147,10 @@ impl SystemServices {
}
let current_pid = self.current_pid();
// If it's within the same process, ignore the operation.
if current_pid == dest_pid {
return Ok(src_virt);
}
let src_mapping = self.get_process(current_pid)?.mapping;
let dest_mapping = self.get_process(dest_pid)?.mapping;
use crate::mem::MemoryManager;