diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-10-01 16:08:43 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-10-01 16:08:43 +0200 |
commit | 513125f30a05b4ad3408d5f4efd36d2c6ba10744 (patch) | |
tree | 1b58660d9e72be8a4fa64ade627fd3ab0cd7d0b5 /kern | |
parent | e64697e4abda6c7ef512f4a2948c0d777d668be9 (diff) | |
download | gnumach-513125f30a05b4ad3408d5f4efd36d2c6ba10744.tar.gz gnumach-513125f30a05b4ad3408d5f4efd36d2c6ba10744.tar.bz2 gnumach-513125f30a05b4ad3408d5f4efd36d2c6ba10744.zip |
mach_msg: Fix checking reception size
We need to check against the actual user size that will be used, not the
current kernel size.
Usually userland uses amply-large reception buffer, but better be exact.
Diffstat (limited to 'kern')
-rw-r--r-- | kern/ipc_mig.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kern/ipc_mig.c b/kern/ipc_mig.c index df8a9467..d26d2c6d 100644 --- a/kern/ipc_mig.c +++ b/kern/ipc_mig.c @@ -198,7 +198,7 @@ mach_msg( kmsg->ikm_header.msgh_seqno = seqno; - if (rcv_size < kmsg->ikm_header.msgh_size) { + if (rcv_size < msg_usize(&kmsg->ikm_header)) { ipc_kmsg_copyout_dest(kmsg, space); ipc_kmsg_put_to_kernel(msg, kmsg, sizeof *msg); return MACH_RCV_TOO_LARGE; |