about summary refs log tree commit diff
path: root/mach
diff options
context:
space:
mode:
authorFlavio Cruz <flaviocruz@gmail.com>2023-11-24 16:30:38 -0500
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-12-03 01:03:41 +0100
commit7e23b3c2c008e0b9b5da055e675d40cc27bb10ef (patch)
treefac8ee478962b2e81659277e1a177c032a3be3e8 /mach
parent2fb85a37874c09fb22cd069f7c3c7fd6d8eb2f8f (diff)
downloadglibc-7e23b3c2c008e0b9b5da055e675d40cc27bb10ef.tar.gz
glibc-7e23b3c2c008e0b9b5da055e675d40cc27bb10ef.tar.xz
glibc-7e23b3c2c008e0b9b5da055e675d40cc27bb10ef.zip
Update code to handle the new ABI for sending inlined port rights.
For i686, this change is no op but for x86_64 it forces all inlined port
rights to be 8 bytes long.
Message-ID: <20231124213041.952886-2-flaviocruz@gmail.com>
Diffstat (limited to 'mach')
-rw-r--r--mach/msg-destroy.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/mach/msg-destroy.c b/mach/msg-destroy.c
index 19137baa62..8640c965bd 100644
--- a/mach/msg-destroy.c
+++ b/mach/msg-destroy.c
@@ -108,11 +108,17 @@ __mach_msg_destroy (mach_msg_header_t *msg)
 	    addr = is_inline ? saddr : * (vm_offset_t *) saddr;
 
 	    if (MACH_MSG_TYPE_PORT_ANY(name)) {
-		mach_port_t *ports = (mach_port_t *) addr;
 		mach_msg_type_number_t i;
 
-		for (i = 0; i < number; i++)
-		    mach_msg_destroy_port(*ports++, name);
+		if (is_inline) {
+		    mach_port_name_inlined_t *inlined_ports = (mach_port_name_inlined_t *)addr;
+		    for (i = 0; i < number; i++)
+			mach_msg_destroy_port(inlined_ports[i].name, name);
+		} else {
+		    mach_port_t *ports = (mach_port_t *) addr;
+		    for (i = 0; i < number; i++)
+			mach_msg_destroy_port(ports[i], name);
+		}
 	    }
 
 	    if (is_inline) {