XNU as a loadable kernel module inside Linux (macOS personality for arm64 Linux)
C
Debug: posix_spawn paths logged like execve's (xpcproxy starts daemons with posix_spawn)
Heyang Zhoud11a043f1dab
diff --git a/xnu-patches/0001-linux64-stage-hook.patch b/xnu-patches/0001-linux64-stage-hook.patchindex 20b18da..6da7edf 100644--- a/xnu-patches/0001-linux64-stage-hook.patch+++ b/xnu-patches/0001-linux64-stage-hook.patch@@ -2216,7 +2216,7 @@ index d211433..dc247da 100644// No need for atomic - These are per CPU and interrupts are disableddiff --git a/osfmk/arm64/sleh.c b/osfmk/arm64/sleh.c-index d8f1b19..145d3f2 100644+index d8f1b19..affd44d 100644--- a/osfmk/arm64/sleh.c+++ b/osfmk/arm64/sleh.c@@ -3646,3 +3646,194 @@ sleh_panic_lockdown_should_initiate_el1_sp0_sync(uint64_t esr, uint64_t elr,@@ -2401,10 +2401,10 @@ index d8f1b19..145d3f2 100644+ (uint64_t)thread->kernel_stack);+ }+ }-+ if (num == 59 || (linux64_tracing() && (num == 5 || num == 463 || num == 33 || num == 338 || num == 340 || num == 466 || num == 469))) {++ if (num == 59 || num == 244 || (linux64_tracing() && (num == 5 || num == 463 || num == 33 || num == 338 || num == 340 || num == 466 || num == 469))) {+ char path[128];+ size_t len = 0;-+ uint64_t ua = (num == 463 || num == 466 || num == 469) ? f->x[1] : f->x[0];++ uint64_t ua = (num == 463 || num == 466 || num == 469 || num == 244) ? f->x[1] : f->x[0];+ if (copyinstr((user_addr_t)ua, path, sizeof(path), &len) == 0) {+ kprintf("linux64: svc %lld path \"%s\"\n", num, path);+ }