summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Dariz <luca@orpolo.org>2023-02-27 21:44:59 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-02-27 22:36:23 +0100
commit8d402b754f3a436dc0e7e6e7ed3b763e98379976 (patch)
tree5aa973bac16f74f35718b4e9225cee926669aaa4
parent4592eb3b02b6e6bd78bd493cf64edcd6fb65a694 (diff)
fix port name copyin
* 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. Message-Id: <20230227204501.2492152-4-luca@orpolo.org>
-rw-r--r--x86_64/copy_user.c2
1 files changed, 2 insertions, 0 deletions
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;