summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2020-06-20 13:17:21 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2020-06-20 13:28:52 +0200
commitaf9f471b500bcd0c1023259c7577e074fe6d3ee5 (patch)
tree70e08c32ea2b78f1ac8fad4f512ed927d6dd9a2b
parent204a382c7b6ccc6443a81688066319d73ef65cab (diff)
vm_map: Allow passing the name of a memory object
as is returned by vm_info. * vm/vm_user.c (vm_map): Before trying to vm_object_enter, try to simply lookup the name.
-rw-r--r--vm/vm_user.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/vm/vm_user.c b/vm/vm_user.c
index 92b1e494..f6fb1a41 100644
--- a/vm/vm_user.c
+++ b/vm/vm_user.c
@@ -345,14 +345,16 @@ kern_return_t vm_map(
object = VM_OBJECT_NULL;
offset = 0;
copy = FALSE;
- } else if ((object = vm_object_enter(memory_object, size, FALSE))
- == VM_OBJECT_NULL)
+ } else if ((object = vm_object_lookup_name (memory_object)) == VM_OBJECT_NULL &&
+ (object = vm_object_enter(memory_object, size, FALSE)) == VM_OBJECT_NULL)
{
ipc_port_t real_memobj;
vm_prot_t prot;
+
result = memory_object_proxy_lookup (memory_object, &real_memobj,
&prot);
if (result != KERN_SUCCESS)
+ /* Really no luck */
return result;
/* Reduce the allowed access to the memory object. */