From 66775cd2279be8e81269c06575c836900aa64793 Mon Sep 17 00:00:00 2001 From: Luca Dariz Date: Tue, 28 Jun 2022 12:10:53 +0200 Subject: hack vm memory object proxy creation for vm arrays * 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 Message-Id: <20220628101054.446126-15-luca@orpolo.org> --- vm/memory_object_proxy.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'vm/memory_object_proxy.c') diff --git a/vm/memory_object_proxy.c b/vm/memory_object_proxy.c index 4d50bab4..46a57932 100644 --- a/vm/memory_object_proxy.c +++ b/vm/memory_object_proxy.c @@ -155,6 +155,13 @@ memory_object_create_proxy (ipc_space_t space, vm_prot_t max_protection, if (!IP_VALID(object[0])) return KERN_INVALID_NAME; +#ifdef USER32 + /* FIXME: simplify RPC, fix mig, or add a new VM data type in message.h */ + *offset &= 0xFFFFFFFFU; + *start &= 0xFFFFFFFFU; + *len &= 0xFFFFFFFFU; +#endif + /* FIXME: Support a different offset from 0. */ if (offset[0] != 0) return KERN_INVALID_ARGUMENT; -- cgit v1.2.3