Prepare for seccomp-assisted syscall filtering.
* strace.c (next_event): Capture PTRACE_EVENT_SECCOMP event.
(dispatch_event): Handle PTRACE_EVENT_SECCOMP event.
* trace_event.h (enum trace_event) <TE_SECCOMP>: New enumeration entity.
return TE_STOP_BEFORE_EXECVE;
case PTRACE_EVENT_EXIT:
return TE_STOP_BEFORE_EXIT;
+ case PTRACE_EVENT_SECCOMP:
+ return TE_SECCOMP;
default:
return TE_RESTART;
}
case TE_RESTART:
break;
+ case TE_SECCOMP:
+ break;
+
case TE_SYSCALL_STOP:
if (trace_syscall(current_tcp, &restart_sig) < 0) {
/*
* Restart the tracee with signal 0.
*/
TE_STOP_BEFORE_EXIT,
+
+ /*
+ * SECCOMP_RET_TRACE rule is triggered.
+ */
+ TE_SECCOMP,
};
#endif /* !STRACE_TRACE_EVENT_H */