diff options
author | Luca Dariz <luca@orpolo.org> | 2023-04-19 21:47:00 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-04-20 22:53:59 +0200 |
commit | 2be047b97235796b9d4a5a51566d252384afc06e (patch) | |
tree | c97f82d750b3aa733398ffcb32ba0416b4d0538a /x86_64 | |
parent | 6b6d49a71f016a4ea60c4ae63af8dfd8c76f55ba (diff) | |
download | gnumach-2be047b97235796b9d4a5a51566d252384afc06e.tar.gz gnumach-2be047b97235796b9d4a5a51566d252384afc06e.tar.bz2 gnumach-2be047b97235796b9d4a5a51566d252384afc06e.zip |
fix copyoutmsg for 64-bit userspace
* x86_64/copy_user.c: use the correct user/kernel msg structure
Message-Id: <20230419194703.410575-2-luca@orpolo.org>
Diffstat (limited to 'x86_64')
-rw-r--r-- | x86_64/copy_user.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/x86_64/copy_user.c b/x86_64/copy_user.c index b5084996..f76e44c9 100644 --- a/x86_64/copy_user.c +++ b/x86_64/copy_user.c @@ -430,7 +430,7 @@ int copyoutmsg (const void *kernelbuf, void *userbuf, const size_t ksize) usaddr = (vm_offset_t)(umsg + 1); keaddr = ksaddr + ksize - sizeof(mach_msg_header_t); - if (ksize > sizeof(mach_msg_user_header_t)) + if (ksize > sizeof(mach_msg_header_t)) { while (ksaddr < keaddr) { @@ -484,8 +484,7 @@ int copyoutmsg (const void *kernelbuf, void *userbuf, const size_t ksize) mach_msg_size_t usize; usize = sizeof(mach_msg_user_header_t) + usaddr - (vm_offset_t)(umsg + 1); - usize = usize; - if (copyout(&usize, &umsg->msgh_size, sizeof(kmsg->msgh_size))) + if (copyout(&usize, &umsg->msgh_size, sizeof(umsg->msgh_size))) return 1; return 0; |