diff --git a/src/24-hide/pidhide.bpf.c b/src/24-hide/pidhide.bpf.c index 4e02290..e5246a1 100644 --- a/src/24-hide/pidhide.bpf.c +++ b/src/24-hide/pidhide.bpf.c @@ -174,7 +174,7 @@ int handle_getdents_exit(struct trace_event_raw_sys_exit *ctx) return 0; } -SEC("tp/syscalls/sys_exit_getdents64") +SEC("tp/unused") int handle_getdents_patch(struct trace_event_raw_sys_exit *ctx) { // Only patch if we've already checked and found our pid's folder to hide diff --git a/src/24-hide/pidhide.c b/src/24-hide/pidhide.c index 4da32ed..9cf1dc7 100644 --- a/src/24-hide/pidhide.c +++ b/src/24-hide/pidhide.c @@ -180,6 +180,9 @@ int main(int argc, char **argv) goto cleanup; } + // 禁用 patch 程序的自动 attach,因为它只能通过尾调用执行 + bpf_program__set_autoattach(skel->progs.handle_getdents_patch, false); + // Setup Maps for tail calls int index = PROG_01; int prog_fd = bpf_program__fd(skel->progs.handle_getdents_exit);