Skip to content

RFC Two-phase seccomp and an x86_64 fast path

Andy Lutomirski linux-arch linux-arm-kernel linux-mips linux-s390 lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest5 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5seccomp,x86,arm,mips,s390: Remove nr parameter from secure_computingarch/arm/kernel/ptrace.c arch/mips/kernel/ptrace.c arch/s390/kernel/ptrace.c +4 more+65 -340 replies
2/5x86_64,entry: Treat regs->ax the same in fastpath and slowpath syscallsarch/x86/include/asm/calling.h arch/x86/kernel/entry_64.S+8 -90 replies
3/5seccomp: Refactor the filter callback and the APIinclude/linux/seccomp.h kernel/seccomp.c+122 -630 replies
4/5seccomp: Allow arch code to provide seccomp_datainclude/linux/seccomp.h kernel/seccomp.c+20 -140 replies
5/5x86,seccomp: Add a seccomp fastpatharch/x86/kernel/entry_64.S include/linux/seccomp.h+47 -28 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 0/5] Two-phase seccomp and an x86_64 fast path

On my VM, getpid takes about 70ns. Before this patchset, adding a single-instruction always-accept seccomp filter added about 134ns of overhead to getpid. With this patchset, the overhead is down to about 13ns.

I'd really appreciate careful review from all relevant arch maintainers for patch 1.

This is an RFC for now. I'll submit a non-RFC version after the merge window ends.

Andy Lutomirski (5):
seccomp,x86,arm,mips,s390: Remove nr parameter from secure_computing x86_64,entry: Treat regs->ax the same in fastpath and slowpath
syscalls
seccomp: Refactor the filter callback and the API
seccomp: Allow arch code to provide seccomp_data x86,seccomp: Add a seccomp fastpath

 arch/arm/kernel/ptrace.c       |   7 +-
 arch/mips/kernel/ptrace.c      |   2 +-
 arch/s390/kernel/ptrace.c      |   2 +-
 arch/x86/include/asm/calling.h |   6 +-
 arch/x86/kernel/entry_64.S     |  52 ++++++++-
 arch/x86/kernel/ptrace.c       |   2 +-
 arch/x86/kernel/vsyscall_64.c  |   2 +-
 include/linux/seccomp.h        |  25 +++--
 kernel/seccomp.c               | 244 +++++++++++++++++++++++++++--------------
 9 files changed, 241 insertions(+), 101 deletions(-)
Signature · 1 line
1.9.3