aboutsummaryrefslogtreecommitdiff
path: root/x86_64
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2022-08-28 13:10:35 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-08-28 13:10:35 +0200
commit4f82ae66628a517585d6bef9465662a45481d024 (patch)
treebfe4affbca50e455b59925b007b19ea096bfb99f /x86_64
parent30c93547cd14db1ae44ea9e32bf36a2c2b152c07 (diff)
downloadgnumach-4f82ae66628a517585d6bef9465662a45481d024.tar.gz
gnumach-4f82ae66628a517585d6bef9465662a45481d024.tar.bz2
gnumach-4f82ae66628a517585d6bef9465662a45481d024.zip
copyinmsg: Set msgh_size inside copyinmsg rather than the caller
In the 32/64 conversion case it is copyinmsg that will know the eventual size.
Diffstat (limited to 'x86_64')
-rw-r--r--x86_64/locore.S6
1 files changed, 4 insertions, 2 deletions
diff --git a/x86_64/locore.S b/x86_64/locore.S
index 612fc493..bbb63252 100644
--- a/x86_64/locore.S
+++ b/x86_64/locore.S
@@ -1318,6 +1318,7 @@ copyin_fail:
*/
ENTRY(copyinmsg)
xchgq %rsi,%rdi /* Get user source and kernel destination */
+ movl %edx,MSGH_MSGH_SIZE(%rdi) /* set msgh_size already */
/* 32 on 64 conversion */
subq $32,%rdx
@@ -1330,8 +1331,9 @@ ENTRY(copyinmsg)
/* Copy msgh_size */
RECOVER(copyin_fail)
lodsl
- addl $8,%eax
- stosl
+ /* But don't actually store it: we have already set it above to what we
+ really copy */
+ addl $4,%rdi
xorq %rax,%rax
/* Copy msgh_remote_port */