[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/5] fix port name copyin
From: |
Luca Dariz |
Subject: |
[PATCH 3/5] fix port name copyin |
Date: |
Mon, 27 Feb 2023 21:44:59 +0100 |
* x86_64/copy_user.c: in mach_msg_user_header_t there are some holes
that need to be cleared, to adapt to the different layout of
mach_msg_header_t.
---
x86_64/copy_user.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/x86_64/copy_user.c b/x86_64/copy_user.c
index 86d23525..ae17c368 100644
--- a/x86_64/copy_user.c
+++ b/x86_64/copy_user.c
@@ -194,6 +194,8 @@ int copyinmsg (const void *userbuf, void *kernelbuf, const
size_t usize)
"mach_msg_header_t and mach_msg_user_header_t expected to be
of the same size");
if (copyin(umsg, kmsg, sizeof(mach_msg_header_t)))
return 1;
+ kmsg->msgh_remote_port &= 0xFFFFFFFF; // FIXME: still have port names here
+ kmsg->msgh_local_port &= 0xFFFFFFFF; // also, this assumes little-endian
#endif
vm_offset_t usaddr, ueaddr, ksaddr;
--
2.30.2