Skip to content
  • Andy Lutomirski's avatar
    seccomp: Refactor the filter callback and the API · 13aa72f0
    Andy Lutomirski authored
    
    
    The reason I did this is to add a seccomp API that will be usable
    for an x86 fast path.  The x86 entry code needs to use a rather
    expensive slow path for a syscall that might be visible to things
    like ptrace.  By splitting seccomp into two phases, we can check
    whether we need the slow path and then use the fast path in if the
    filter allows the syscall or just returns some errno.
    
    As a side effect, I think the new code is much easier to understand
    than the old code.
    
    This has one user-visible effect: the audit record written for
    SECCOMP_RET_TRACE is now a simple indication that SECCOMP_RET_TRACE
    happened.  It used to depend in a complicated way on what the tracer
    did.  I couldn't make much sense of it.
    
    Signed-off-by: default avatarAndy Lutomirski <luto@amacapital.net>
    Signed-off-by: default avatarKees Cook <keescook@chromium.org>
    13aa72f0