[Top][All Lists]

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

[PATCH 14/15] hack vm memory object proxy creation for vm arrays

From: Luca Dariz
Subject: [PATCH 14/15] hack vm memory object proxy creation for vm arrays
Date: Tue, 28 Jun 2022 12:10:53 +0200

* vm/memory_object_proxy.c: truncate vm array types as if they were
  the rpc_ version because MIG can't handle that. This rpc can't
  handle more than one element anyway.

Note that the same issue with vm arrays is present at least with
syscall emulation, but that functionality seems unused for now.

A better fix could be to add a vm descriptor type in include/mach/message.h,
but then probably we don't need to use the rpc_ types in MIG anymore,
they would be needed only for the syscall definitions.

Signed-off-by: Luca Dariz <luca@orpolo.org>
 vm/memory_object_proxy.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/vm/memory_object_proxy.c b/vm/memory_object_proxy.c
index 4d50bab4..f397351e 100644
--- a/vm/memory_object_proxy.c
+++ b/vm/memory_object_proxy.c
@@ -155,6 +155,11 @@ memory_object_create_proxy (ipc_space_t space, vm_prot_t 
   if (!IP_VALID(object[0]))
     return KERN_INVALID_NAME;
+  /* FIXME: fix mig or add a new VM data type in message.h */
+  *offset &= 0xFFFFFFFF;
+  *start &= 0xFFFFFFFF;
+  *len &= 0xFFFFFFFF;
   /* FIXME: Support a different offset from 0.  */
   if (offset[0] != 0)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]