this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add some more Mach port traps

These are for guarded ports. While I believe we don't currently deliver port guard violation exceptions, there are certain updated programs (like `notifyd`) that need to be able to create and destroy Mach ports using `mach_port_{construct,destruct}`. This commit therefore adds some of the necessary plumbing (which is enough to satisfy `notifyd`) and leaves it up to a future commit to add proper support for guarded ports and port guard violation exceptions.

+27 -8
+27 -8
src/kernel/emulation/linux/mach/mach_traps.c
··· 449 449 mach_port_name_t *name 450 450 ) 451 451 { 452 - UNIMPLEMENTED_TRAP(); 453 - return KERN_FAILURE; 452 + struct mach_port_construct_args args = { 453 + .task_right_name = target, 454 + .options = options, 455 + .context = context, 456 + .port_right_name_out = name, 457 + }; 458 + return lkm_call(NR__kernelrpc_mach_port_construct_trap, &args); 454 459 } 455 460 456 461 kern_return_t _kernelrpc_mach_port_destruct_trap_impl( ··· 460 465 uint64_t guard 461 466 ) 462 467 { 463 - UNIMPLEMENTED_TRAP(); 464 - return KERN_FAILURE; 468 + struct mach_port_destruct_args args = { 469 + .task_right_name = target, 470 + .port_right_name = name, 471 + .srdelta = srdelta, 472 + .guard = guard, 473 + }; 474 + return lkm_call(NR__kernelrpc_mach_port_destruct_trap, &args); 465 475 } 466 476 467 477 kern_return_t _kernelrpc_mach_port_guard_trap_impl( ··· 471 481 boolean_t strict 472 482 ) 473 483 { 474 - UNIMPLEMENTED_TRAP(); 475 - return KERN_FAILURE; 484 + struct mach_port_guard_args args = { 485 + .task_right_name = target, 486 + .port_right_name = name, 487 + .guard = guard, 488 + .strict = strict, 489 + }; 490 + return lkm_call(NR__kernelrpc_mach_port_guard_trap, &args); 476 491 } 477 492 478 493 kern_return_t _kernelrpc_mach_port_unguard_trap_impl( ··· 481 496 uint64_t guard 482 497 ) 483 498 { 484 - UNIMPLEMENTED_TRAP(); 485 - return KERN_FAILURE; 499 + struct mach_port_unguard_args args = { 500 + .task_right_name = target, 501 + .port_right_name = name, 502 + .guard = guard, 503 + }; 504 + return lkm_call(NR__kernelrpc_mach_port_unguard_trap, &args); 486 505 } 487 506 488 507 kern_return_t thread_get_special_reply_port_impl(void)