ipc_port_t port;
thread_t th = current_thread();
mach_msg_return_t error = MACH_MSG_SUCCESS;
+ boolean_t kernel_reply = FALSE;
spl_t s;
/* Check if honor qlimit flag is set on thread. */
return MACH_MSG_SUCCESS;
}
+ ipc_voucher_send_preprocessing(kmsg);
+
port = (ipc_port_t) kmsg->ikm_header->msgh_remote_port;
assert(IP_VALID(port));
ip_lock(port);
assert(IP_VALID(port));
ip_lock(port);
/* fall thru with reply - same options */
+ kernel_reply = TRUE;
}
#if IMPORTANCE_INHERITANCE
ipc_kmsg_destroy(kmsg);
return MACH_MSG_SUCCESS;
}
+
+ if (error != MACH_MSG_SUCCESS && kernel_reply) {
+ /*
+ * Kernel reply messages that fail can't be allowed to
+ * pseudo-receive on error conditions. We need to just treat
+ * the message as a successful delivery.
+ */
+ ip_release(port); /* JMM - Future: release right, not just ref */
+ kmsg->ikm_header->msgh_remote_port = MACH_PORT_NULL;
+ ipc_kmsg_destroy(kmsg);
+ return MACH_MSG_SUCCESS;
+ }
return error;
}
ipc_port_t dport = (ipc_port_t)dest_port;
/* dport still locked from above */
- if (ipc_port_importance_delta(dport, 1) == FALSE) {
+ if (ipc_port_importance_delta(dport, IPID_OPTION_SENDPOSSIBLE, 1) == FALSE) {
ip_unlock(dport);
}
}
kern_return_t kr;
rcv_addr = 0;
+ if (vm_map_copy_validate_size(map, copy, (vm_map_size_t)size) == FALSE)
+ panic("Inconsistent OOL/copyout size on %p: expected %d, got %lld @%p",
+ dsc, size, (unsigned long long)copy->size, copy);
kr = vm_map_copyout(map, &rcv_addr, copy);
if (kr != KERN_SUCCESS) {
if (kr == KERN_RESOURCE_SHORTAGE)