]> git.saurik.com Git - apple/xnu.git/blob - osfmk/kern/ipc_kobject.c
73e7a084a1b9aa4bee0448a70dd02bc2a7979672
[apple/xnu.git] / osfmk / kern / ipc_kobject.c
1 /*
2 * Copyright (c) 2000-2016 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28 /*
29 * @OSF_COPYRIGHT@
30 */
31 /*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56 /*
57 * NOTICE: This file was modified by McAfee Research in 2004 to introduce
58 * support for mandatory and extensible security protections. This notice
59 * is included in support of clause 2.2 (b) of the Apple Public License,
60 * Version 2.0.
61 * Copyright (c) 2005 SPARTA, Inc.
62 */
63 /*
64 */
65 /*
66 * File: kern/ipc_kobject.c
67 * Author: Rich Draves
68 * Date: 1989
69 *
70 * Functions for letting a port represent a kernel object.
71 */
72
73 #include <mach_debug.h>
74 #include <mach_ipc_test.h>
75 #include <mach_rt.h>
76
77 #include <mach/mig.h>
78 #include <mach/port.h>
79 #include <mach/kern_return.h>
80 #include <mach/message.h>
81 #include <mach/mig_errors.h>
82 #include <mach/notify.h>
83 #include <mach/ndr.h>
84 #include <mach/vm_param.h>
85
86 #include <mach/mach_vm_server.h>
87 #include <mach/mach_port_server.h>
88 #include <mach/mach_host_server.h>
89 #include <mach/host_priv_server.h>
90 #include <mach/host_security_server.h>
91 #include <mach/clock_server.h>
92 #include <mach/clock_priv_server.h>
93 #include <mach/lock_set_server.h>
94 #include <mach/memory_object_control_server.h>
95 #include <mach/memory_object_default_server.h>
96 #include <mach/processor_server.h>
97 #include <mach/processor_set_server.h>
98 #include <mach/task_server.h>
99 #include <mach/mach_voucher_server.h>
100 #include <mach/mach_voucher_attr_control_server.h>
101 #ifdef VM32_SUPPORT
102 #include <mach/vm32_map_server.h>
103 #endif
104 #include <mach/thread_act_server.h>
105
106 #include <device/device_types.h>
107 #include <device/device_server.h>
108
109 #include <UserNotification/UNDReplyServer.h>
110
111 #if CONFIG_AUDIT
112 #include <kern/audit_sessionport.h>
113 #endif
114
115 #if MACH_MACHINE_ROUTINES
116 #include <machine/machine_routines.h>
117 #endif /* MACH_MACHINE_ROUTINES */
118 #if XK_PROXY
119 #include <uk_xkern/xk_uproxy_server.h>
120 #endif /* XK_PROXY */
121
122 #include <kern/ipc_tt.h>
123 #include <kern/ipc_mig.h>
124 #include <kern/ipc_misc.h>
125 #include <kern/ipc_kobject.h>
126 #include <kern/host_notify.h>
127 #include <kern/mk_timer.h>
128 #include <kern/misc_protos.h>
129 #include <ipc/ipc_kmsg.h>
130 #include <ipc/ipc_port.h>
131 #include <ipc/ipc_voucher.h>
132 #include <kern/sync_sema.h>
133 #include <kern/counters.h>
134
135 #include <vm/vm_protos.h>
136
137 #include <security/mac_mach_internal.h>
138
139 extern char *proc_name_address(void *p);
140 extern int proc_pid(void *p);
141
142 /*
143 * Routine: ipc_kobject_notify
144 * Purpose:
145 * Deliver notifications to kobjects that care about them.
146 */
147 boolean_t
148 ipc_kobject_notify(
149 mach_msg_header_t *request_header,
150 mach_msg_header_t *reply_header);
151
152 typedef struct {
153 mach_msg_id_t num;
154 mig_routine_t routine;
155 int size;
156 #if MACH_COUNTERS
157 mach_counter_t callcount;
158 #endif
159 } mig_hash_t;
160
161 #define MAX_MIG_ENTRIES 1031
162 #define MIG_HASH(x) (x)
163
164 #ifndef max
165 #define max(a,b) (((a) > (b)) ? (a) : (b))
166 #endif /* max */
167
168 static mig_hash_t mig_buckets[MAX_MIG_ENTRIES];
169 static int mig_table_max_displ;
170 static mach_msg_size_t mig_reply_size = sizeof(mig_reply_error_t);
171
172
173
174 const struct mig_subsystem *mig_e[] = {
175 (const struct mig_subsystem *)&mach_vm_subsystem,
176 (const struct mig_subsystem *)&mach_port_subsystem,
177 (const struct mig_subsystem *)&mach_host_subsystem,
178 (const struct mig_subsystem *)&host_priv_subsystem,
179 (const struct mig_subsystem *)&host_security_subsystem,
180 (const struct mig_subsystem *)&clock_subsystem,
181 (const struct mig_subsystem *)&clock_priv_subsystem,
182 (const struct mig_subsystem *)&processor_subsystem,
183 (const struct mig_subsystem *)&processor_set_subsystem,
184 (const struct mig_subsystem *)&is_iokit_subsystem,
185 (const struct mig_subsystem *)&lock_set_subsystem,
186 (const struct mig_subsystem *)&task_subsystem,
187 (const struct mig_subsystem *)&thread_act_subsystem,
188 #ifdef VM32_SUPPORT
189 (const struct mig_subsystem *)&vm32_map_subsystem,
190 #endif
191 (const struct mig_subsystem *)&UNDReply_subsystem,
192 (const struct mig_subsystem *)&mach_voucher_subsystem,
193 (const struct mig_subsystem *)&mach_voucher_attr_control_subsystem,
194
195 #if XK_PROXY
196 (const struct mig_subsystem *)&do_uproxy_xk_uproxy_subsystem,
197 #endif /* XK_PROXY */
198 #if MACH_MACHINE_ROUTINES
199 (const struct mig_subsystem *)&MACHINE_SUBSYSTEM,
200 #endif /* MACH_MACHINE_ROUTINES */
201 #if MCMSG && iPSC860
202 (const struct mig_subsystem *)&mcmsg_info_subsystem,
203 #endif /* MCMSG && iPSC860 */
204 };
205
206 void
207 mig_init(void)
208 {
209 unsigned int i, n = sizeof(mig_e)/sizeof(const struct mig_subsystem *);
210 int howmany;
211 mach_msg_id_t j, pos, nentry, range;
212
213 for (i = 0; i < n; i++) {
214 range = mig_e[i]->end - mig_e[i]->start;
215 if (!mig_e[i]->start || range < 0)
216 panic("the msgh_ids in mig_e[] aren't valid!");
217
218 for (j = 0; j < range; j++) {
219 if (mig_e[i]->routine[j].stub_routine) {
220 /* Only put real entries in the table */
221 nentry = j + mig_e[i]->start;
222 for (pos = MIG_HASH(nentry) % MAX_MIG_ENTRIES, howmany = 1;
223 mig_buckets[pos].num;
224 pos++, pos = pos % MAX_MIG_ENTRIES, howmany++) {
225 if (mig_buckets[pos].num == nentry) {
226 printf("message id = %d\n", nentry);
227 panic("multiple entries with the same msgh_id");
228 }
229 if (howmany == MAX_MIG_ENTRIES)
230 panic("the mig dispatch table is too small");
231 }
232
233 mig_buckets[pos].num = nentry;
234 mig_buckets[pos].routine = mig_e[i]->routine[j].stub_routine;
235 if (mig_e[i]->routine[j].max_reply_msg)
236 mig_buckets[pos].size = mig_e[i]->routine[j].max_reply_msg;
237 else
238 mig_buckets[pos].size = mig_e[i]->maxsize;
239
240 mig_table_max_displ = max(howmany, mig_table_max_displ);
241 }
242 }
243 }
244 printf("mig_table_max_displ = %d\n", mig_table_max_displ);
245 }
246
247
248 /*
249 * Routine: ipc_kobject_server
250 * Purpose:
251 * Handle a message sent to the kernel.
252 * Generates a reply message.
253 * Version for Untyped IPC.
254 * Conditions:
255 * Nothing locked.
256 */
257
258 ipc_kmsg_t
259 ipc_kobject_server(
260 ipc_kmsg_t request,
261 mach_msg_option_t __unused option)
262 {
263 mach_msg_size_t reply_size;
264 ipc_kmsg_t reply;
265 kern_return_t kr;
266 ipc_port_t *destp;
267 ipc_port_t replyp = IPC_PORT_NULL;
268 mach_msg_format_0_trailer_t *trailer;
269 mig_hash_t *ptr;
270 task_t task = TASK_NULL;
271 uint32_t exec_token;
272 boolean_t exec_token_changed = FALSE;
273
274 /*
275 * Find out corresponding mig_hash entry if any
276 */
277 {
278 int key = request->ikm_header->msgh_id;
279 unsigned int i = (unsigned int)MIG_HASH(key);
280 int max_iter = mig_table_max_displ;
281
282 do {
283 ptr = &mig_buckets[i++ % MAX_MIG_ENTRIES];
284 } while (key != ptr->num && ptr->num && --max_iter);
285
286 if (!ptr->routine || key != ptr->num) {
287 ptr = (mig_hash_t *)0;
288 reply_size = mig_reply_size;
289 } else {
290 reply_size = ptr->size;
291 #if MACH_COUNTER
292 ptr->callcount++;
293 #endif
294 }
295 }
296
297 /* round up for trailer size */
298 reply_size += MAX_TRAILER_SIZE;
299 reply = ipc_kmsg_alloc(reply_size);
300
301 if (reply == IKM_NULL) {
302 printf("ipc_kobject_server: dropping request\n");
303 ipc_kmsg_trace_send(request, option);
304 ipc_kmsg_destroy(request);
305 return IKM_NULL;
306 }
307
308 /*
309 * Initialize reply message.
310 */
311 {
312 #define InP ((mach_msg_header_t *) request->ikm_header)
313 #define OutP ((mig_reply_error_t *) reply->ikm_header)
314
315 /*
316 * MIG should really assure no data leakage -
317 * but until it does, pessimistically zero the
318 * whole reply buffer.
319 */
320 bzero((void *)OutP, reply_size);
321
322 OutP->NDR = NDR_record;
323 OutP->Head.msgh_size = sizeof(mig_reply_error_t);
324
325 OutP->Head.msgh_bits =
326 MACH_MSGH_BITS_SET(MACH_MSGH_BITS_LOCAL(InP->msgh_bits), 0, 0, 0);
327 OutP->Head.msgh_remote_port = InP->msgh_local_port;
328 OutP->Head.msgh_local_port = MACH_PORT_NULL;
329 OutP->Head.msgh_voucher_port = MACH_PORT_NULL;
330 OutP->Head.msgh_id = InP->msgh_id + 100;
331
332 #undef InP
333 #undef OutP
334 }
335
336 /*
337 * Find the routine to call, and call it
338 * to perform the kernel function
339 */
340 ipc_kmsg_trace_send(request, option);
341 {
342 if (ptr) {
343 /*
344 * Check if the port is a task port, if its a task port then
345 * snapshot the task exec token before the mig routine call.
346 */
347 ipc_port_t port = request->ikm_header->msgh_remote_port;
348 if (IP_VALID(port) && ip_kotype(port) == IKOT_TASK) {
349 task = convert_port_to_task_with_exec_token(port, &exec_token);
350 }
351
352 (*ptr->routine)(request->ikm_header, reply->ikm_header);
353
354 /* Check if the exec token changed during the mig routine */
355 if (task != TASK_NULL) {
356 if (exec_token != task->exec_token) {
357 exec_token_changed = TRUE;
358 }
359 task_deallocate(task);
360 }
361
362 kernel_task->messages_received++;
363 }
364 else {
365 if (!ipc_kobject_notify(request->ikm_header, reply->ikm_header)){
366 #if DEVELOPMENT || DEBUG
367 printf("ipc_kobject_server: bogus kernel message, id=%d\n",
368 request->ikm_header->msgh_id);
369 #endif /* DEVELOPMENT || DEBUG */
370 _MIG_MSGID_INVALID(request->ikm_header->msgh_id);
371
372 ((mig_reply_error_t *) reply->ikm_header)->RetCode
373 = MIG_BAD_ID;
374 }
375 else
376 kernel_task->messages_received++;
377 }
378 kernel_task->messages_sent++;
379 }
380
381 /*
382 * Destroy destination. The following code differs from
383 * ipc_object_destroy in that we release the send-once
384 * right instead of generating a send-once notification
385 * (which would bring us here again, creating a loop).
386 * It also differs in that we only expect send or
387 * send-once rights, never receive rights.
388 *
389 * We set msgh_remote_port to IP_NULL so that the kmsg
390 * destroy routines don't try to destroy the port twice.
391 */
392 destp = (ipc_port_t *) &request->ikm_header->msgh_remote_port;
393 switch (MACH_MSGH_BITS_REMOTE(request->ikm_header->msgh_bits)) {
394 case MACH_MSG_TYPE_PORT_SEND:
395 ipc_port_release_send(*destp);
396 break;
397
398 case MACH_MSG_TYPE_PORT_SEND_ONCE:
399 ipc_port_release_sonce(*destp);
400 break;
401
402 default:
403 panic("ipc_kobject_server: strange destination rights");
404 }
405 *destp = IP_NULL;
406
407 /*
408 * Destroy voucher. The kernel MIG servers never take ownership
409 * of vouchers sent in messages. Swallow any such rights here.
410 */
411 if (IP_VALID(request->ikm_voucher)) {
412 assert(MACH_MSG_TYPE_PORT_SEND ==
413 MACH_MSGH_BITS_VOUCHER(request->ikm_header->msgh_bits));
414 ipc_port_release_send(request->ikm_voucher);
415 request->ikm_voucher = IP_NULL;
416 }
417
418 if (!(reply->ikm_header->msgh_bits & MACH_MSGH_BITS_COMPLEX) &&
419 ((mig_reply_error_t *) reply->ikm_header)->RetCode != KERN_SUCCESS)
420 kr = ((mig_reply_error_t *) reply->ikm_header)->RetCode;
421 else
422 kr = KERN_SUCCESS;
423
424 if ((kr == KERN_SUCCESS) || (kr == MIG_NO_REPLY)) {
425 /*
426 * The server function is responsible for the contents
427 * of the message. The reply port right is moved
428 * to the reply message, and we have deallocated
429 * the destination port right, so we just need
430 * to free the kmsg.
431 */
432 ipc_kmsg_free(request);
433
434 } else {
435 /*
436 * The message contents of the request are intact.
437 * Destroy everthing except the reply port right,
438 * which is needed in the reply message.
439 */
440 request->ikm_header->msgh_local_port = MACH_PORT_NULL;
441 ipc_kmsg_destroy(request);
442 }
443
444 replyp = (ipc_port_t)reply->ikm_header->msgh_remote_port;
445
446 if (kr == MIG_NO_REPLY) {
447 /*
448 * The server function will send a reply message
449 * using the reply port right, which it has saved.
450 */
451
452 ipc_kmsg_free(reply);
453
454 return IKM_NULL;
455 } else if (!IP_VALID(replyp)) {
456 /*
457 * Can't queue the reply message if the destination
458 * (the reply port) isn't valid.
459 */
460
461 ipc_kmsg_destroy(reply);
462
463 return IKM_NULL;
464 } else if (replyp->ip_receiver == ipc_space_kernel) {
465 /*
466 * Don't send replies to kobject kernel ports
467 */
468 #if DEVELOPMENT || DEBUG
469 printf("%s: refusing to send reply to kobject %d port (id:%d)\n",
470 __func__, ip_kotype(replyp),
471 request->ikm_header->msgh_id);
472 #endif /* DEVELOPMENT || DEBUG */
473 ipc_kmsg_destroy(reply);
474 return IKM_NULL;
475 }
476
477 /* Fail the MIG call if the task exec token changed during the call */
478 if (kr == KERN_SUCCESS && exec_token_changed) {
479 /*
480 * Create a new reply msg with error and destroy the old reply msg.
481 */
482 ipc_kmsg_t new_reply = ipc_kmsg_alloc(reply_size);
483
484 if (new_reply == IKM_NULL) {
485 printf("ipc_kobject_server: dropping request\n");
486 ipc_kmsg_destroy(reply);
487 return IKM_NULL;
488 }
489 /*
490 * Initialize the new reply message.
491 */
492 {
493 #define OutP_new ((mig_reply_error_t *) new_reply->ikm_header)
494 #define OutP_old ((mig_reply_error_t *) reply->ikm_header)
495
496 bzero((void *)OutP_new, reply_size);
497
498 OutP_new->NDR = OutP_old->NDR;
499 OutP_new->Head.msgh_size = sizeof(mig_reply_error_t);
500 OutP_new->Head.msgh_bits = OutP_old->Head.msgh_bits & ~MACH_MSGH_BITS_COMPLEX;
501 OutP_new->Head.msgh_remote_port = OutP_old->Head.msgh_remote_port;
502 OutP_new->Head.msgh_local_port = MACH_PORT_NULL;
503 OutP_new->Head.msgh_voucher_port = MACH_PORT_NULL;
504 OutP_new->Head.msgh_id = OutP_old->Head.msgh_id;
505
506 /* Set the error as KERN_INVALID_TASK */
507 OutP_new->RetCode = KERN_INVALID_TASK;
508
509 #undef OutP_new
510 #undef OutP_old
511 }
512
513 /*
514 * Destroy everything in reply except the reply port right,
515 * which is needed in the new reply message.
516 */
517 reply->ikm_header->msgh_remote_port = MACH_PORT_NULL;
518 ipc_kmsg_destroy(reply);
519
520 reply = new_reply;
521 }
522
523 trailer = (mach_msg_format_0_trailer_t *)
524 ((vm_offset_t)reply->ikm_header + (int)reply->ikm_header->msgh_size);
525
526 trailer->msgh_sender = KERNEL_SECURITY_TOKEN;
527 trailer->msgh_trailer_type = MACH_MSG_TRAILER_FORMAT_0;
528 trailer->msgh_trailer_size = MACH_MSG_TRAILER_MINIMUM_SIZE;
529
530 return reply;
531 }
532
533 /*
534 * Routine: ipc_kobject_set
535 * Purpose:
536 * Make a port represent a kernel object of the given type.
537 * The caller is responsible for handling refs for the
538 * kernel object, if necessary.
539 * Conditions:
540 * Nothing locked. The port must be active if setting
541 * a kobject linkage. Clearing a linkage is OK on an
542 * inactive port.
543 */
544 void
545 ipc_kobject_set(
546 ipc_port_t port,
547 ipc_kobject_t kobject,
548 ipc_kobject_type_t type)
549 {
550 ip_lock(port);
551 ipc_kobject_set_atomically(port, kobject, type);
552 ip_unlock(port);
553 }
554
555 void
556 ipc_kobject_set_atomically(
557 ipc_port_t port,
558 ipc_kobject_t kobject,
559 ipc_kobject_type_t type)
560 {
561 assert(type == IKOT_NONE || ip_active(port));
562 #if MACH_ASSERT
563 port->ip_spares[2] = (port->ip_bits & IO_BITS_KOTYPE);
564 #endif /* MACH_ASSERT */
565 port->ip_bits = (port->ip_bits &~ IO_BITS_KOTYPE) | type;
566 port->ip_kobject = kobject;
567 }
568
569 /*
570 * Routine: ipc_kobject_destroy
571 * Purpose:
572 * Release any kernel object resources associated
573 * with the port, which is being destroyed.
574 *
575 * This should only be needed when resources are
576 * associated with a user's port. In the normal case,
577 * when the kernel is the receiver, the code calling
578 * ipc_port_dealloc_kernel should clean up the resources.
579 * Conditions:
580 * The port is not locked, but it is dead.
581 */
582
583 void
584 ipc_kobject_destroy(
585 ipc_port_t port)
586 {
587 switch (ip_kotype(port)) {
588
589 case IKOT_TIMER:
590 mk_timer_port_destroy(port);
591 break;
592
593 case IKOT_NAMED_ENTRY:
594 mach_destroy_memory_entry(port);
595 break;
596
597 case IKOT_HOST_NOTIFY:
598 host_notify_port_destroy(port);
599 break;
600
601 default:
602 break;
603 }
604 }
605
606
607 boolean_t
608 ipc_kobject_notify(
609 mach_msg_header_t *request_header,
610 mach_msg_header_t *reply_header)
611 {
612 mach_msg_max_trailer_t * trailer;
613 ipc_port_t port = (ipc_port_t) request_header->msgh_remote_port;
614
615 ((mig_reply_error_t *) reply_header)->RetCode = MIG_NO_REPLY;
616
617 trailer = (mach_msg_max_trailer_t *)
618 ((vm_offset_t)request_header + request_header->msgh_size);
619 if (0 != bcmp(&trailer->msgh_audit, &KERNEL_AUDIT_TOKEN,
620 sizeof(trailer->msgh_audit))) {
621 return FALSE;
622 }
623 if (0 != bcmp(&trailer->msgh_sender, &KERNEL_SECURITY_TOKEN,
624 sizeof(trailer->msgh_sender))) {
625 return FALSE;
626 }
627
628 switch (request_header->msgh_id) {
629 case MACH_NOTIFY_NO_SENDERS:
630 switch (ip_kotype(port)) {
631 case IKOT_VOUCHER:
632 ipc_voucher_notify(request_header);
633 return TRUE;
634
635 case IKOT_VOUCHER_ATTR_CONTROL:
636 ipc_voucher_attr_control_notify(request_header);
637 return TRUE;
638
639 case IKOT_SEMAPHORE:
640 semaphore_notify(request_header);
641 return TRUE;
642
643 case IKOT_TASK:
644 task_port_notify(request_header);
645 return TRUE;
646
647 case IKOT_NAMED_ENTRY:
648 ip_lock(port);
649
650 /*
651 * Bring the sequence number and mscount in
652 * line with ipc_port_destroy assertion.
653 */
654 port->ip_mscount = 0;
655 port->ip_messages.imq_seqno = 0;
656 ipc_port_destroy(port); /* releases lock */
657 return TRUE;
658
659 case IKOT_UPL:
660 upl_no_senders(
661 request_header->msgh_remote_port,
662 (mach_port_mscount_t)
663 ((mach_no_senders_notification_t *)
664 request_header)->not_count);
665 reply_header->msgh_remote_port = MACH_PORT_NULL;
666 return TRUE;
667
668 #if CONFIG_AUDIT
669 case IKOT_AU_SESSIONPORT:
670 audit_session_nosenders(request_header);
671 return TRUE;
672 #endif
673 case IKOT_FILEPORT:
674 fileport_notify(request_header);
675 return TRUE;
676 }
677 break;
678
679 case MACH_NOTIFY_PORT_DELETED:
680 case MACH_NOTIFY_PORT_DESTROYED:
681 case MACH_NOTIFY_SEND_ONCE:
682 case MACH_NOTIFY_DEAD_NAME:
683 break;
684
685 default:
686 return FALSE;
687 }
688 switch (ip_kotype(port)) {
689
690 #ifdef IOKIT
691 case IKOT_IOKIT_OBJECT:
692 case IKOT_IOKIT_CONNECT:
693 case IKOT_IOKIT_SPARE:
694 {
695 return iokit_notify(request_header);
696 }
697 #endif
698 case IKOT_TASK_RESUME:
699 {
700 return task_suspension_notify(request_header);
701 }
702
703 default:
704 return FALSE;
705 }
706 }