All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/5] x86: two-phase syscall tracing and seccomp fastpath
@ 2014-07-29  3:38 ` Andy Lutomirski
  0 siblings, 0 replies; 62+ messages in thread
From: Andy Lutomirski @ 2014-07-29  3:38 UTC (permalink / raw)
  To: linux-kernel, Kees Cook, Will Drewry
  Cc: Oleg Nesterov, x86, linux-arm-kernel, linux-mips, linux-arch,
	linux-security-module, Alexei Starovoitov, hpa,
	Frederic Weisbecker, Andy Lutomirski

This applies to:
git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git seccomp-fastpath

Gitweb:
https://git.kernel.org/cgit/linux/kernel/git/kees/linux.git/log/?h=seccomp/fastpath

This is both a cleanup and a speedup.  It reduces overhead due to
installing a trivial seccomp filter by 87%.  The speedup comes from
avoiding the full syscall tracing mechanism for filters that don't
return SECCOMP_RET_TRACE.

This series depends on splitting the seccomp hooks into two phases.
The first phase evaluates the filter; it can skip syscalls, allow
them, kill the calling task, or pass a u32 to the second phase.  The
second phase requires a full tracing context, and it sends ptrace
events if necessary.  The seccomp core part is in Kees' seccomp/fastpath
tree.

These patches implement a similar split for the x86 syscall
entry work.  The C callback is invoked in two phases: the first has
only a partial frame, and it can request phase 2 processing with a
full frame.

Finally, I switch the 64-bit system_call code to use the new split
entry work.  This is a net deletion of assembly code: it replaces
all of the audit entry muck.

In the process, I fixed some bugs.

If this is acceptable, someone can do the same tweak for the
ia32entry and entry_32 code.

This passes all seccomp tests that I know of.

Changes from v3:
 - Dropped the core seccomp changes from the email -- Kees has applied them.
 - Add patch 2 (the TIF_NOHZ change).
 - Fix TIF_NOHZ in the two-phase entry code (thanks, Oleg).

Changes from v2:
 - Fixed 32-bit x86 build (and the tests pass).
 - Put the doc patch where it belongs.

Changes from v1:
 - Rebased on top of Kees' shiny new seccomp tree (no effect on the x86
   part).
 - Improved patch 6 vs patch 7 split (thanks Alexei!)
 - Fixed bogus -ENOSYS in patch 5 (thanks Kees!)
 - Improved changelog message in patch 6.

Changes from RFC version:
 - The first three patches are more or less the same
 - The rest is more or less a rewrite


Andy Lutomirski (5):
  x86,x32,audit: Fix x32's AUDIT_ARCH wrt audit
  x86,entry: Only call user_exit if TIF_NOHZ
  x86: Split syscall_trace_enter into two phases
  x86_64,entry: Treat regs->ax the same in fastpath and slowpath
    syscalls
  x86_64,entry: Use split-phase syscall_trace_enter for 64-bit syscalls

 arch/x86/include/asm/calling.h |   6 +-
 arch/x86/include/asm/ptrace.h  |   5 ++
 arch/x86/kernel/entry_64.S     |  51 +++++--------
 arch/x86/kernel/ptrace.c       | 159 ++++++++++++++++++++++++++++++++++-------
 4 files changed, 161 insertions(+), 60 deletions(-)

-- 
1.9.3


^ permalink raw reply	[flat|nested] 62+ messages in thread

end of thread, other threads:[~2014-07-31 17:20 UTC | newest]

Thread overview: 62+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-29  3:38 [PATCH v4 0/5] x86: two-phase syscall tracing and seccomp fastpath Andy Lutomirski
2014-07-29  3:38 ` Andy Lutomirski
2014-07-29  3:38 ` [PATCH v4 1/5] x86,x32,audit: Fix x32's AUDIT_ARCH wrt audit Andy Lutomirski
2014-07-29  3:38   ` Andy Lutomirski
2014-07-29  3:38 ` [PATCH v4 2/5] x86,entry: Only call user_exit if TIF_NOHZ Andy Lutomirski
2014-07-29  3:38   ` Andy Lutomirski
2014-07-29 19:32   ` Oleg Nesterov
2014-07-29 19:32     ` Oleg Nesterov
2014-07-30 16:43     ` Frederic Weisbecker
2014-07-30 16:43       ` Frederic Weisbecker
2014-07-30 17:23       ` Andy Lutomirski
2014-07-30 17:23         ` Andy Lutomirski
2014-07-30 17:23         ` Andy Lutomirski
2014-07-31 15:16         ` Frederic Weisbecker
2014-07-31 15:16           ` Frederic Weisbecker
2014-07-31 15:16           ` Frederic Weisbecker
2014-07-31 16:42           ` Oleg Nesterov
2014-07-31 16:42             ` Oleg Nesterov
2014-07-31 16:42             ` Oleg Nesterov
2014-07-31 16:49             ` Frederic Weisbecker
2014-07-31 16:49               ` Frederic Weisbecker
2014-07-31 16:49               ` Frederic Weisbecker
2014-07-31 16:54               ` Oleg Nesterov
2014-07-31 16:54                 ` Oleg Nesterov
2014-07-31 16:54                 ` Oleg Nesterov
2014-07-31 16:58                 ` Oleg Nesterov
2014-07-31 16:58                   ` Oleg Nesterov
2014-07-31 16:58                   ` Oleg Nesterov
2014-07-31 17:17                 ` Frederic Weisbecker
2014-07-31 17:17                   ` Frederic Weisbecker
2014-07-31 17:17                   ` Frederic Weisbecker
2014-07-29  3:38 ` [PATCH v4 3/5] x86: Split syscall_trace_enter into two phases Andy Lutomirski
2014-07-29  3:38   ` Andy Lutomirski
2014-07-29 19:25   ` Oleg Nesterov
2014-07-29 19:25     ` Oleg Nesterov
2014-07-29  3:38 ` [PATCH v4 4/5] x86_64,entry: Treat regs->ax the same in fastpath and slowpath syscalls Andy Lutomirski
2014-07-29  3:38   ` [PATCH v4 4/5] x86_64, entry: " Andy Lutomirski
2014-07-29  3:38 ` [PATCH v4 5/5] x86_64,entry: Use split-phase syscall_trace_enter for 64-bit syscalls Andy Lutomirski
2014-07-29  3:38   ` [PATCH v4 5/5] x86_64, entry: " Andy Lutomirski
2014-07-29 19:20 ` [PATCH v4 0/5] x86: two-phase syscall tracing and seccomp fastpath Oleg Nesterov
2014-07-29 19:20   ` Oleg Nesterov
2014-07-29 20:54   ` Andy Lutomirski
2014-07-29 20:54     ` Andy Lutomirski
2014-07-29 20:54     ` Andy Lutomirski
2014-07-29 23:30     ` Andy Lutomirski
2014-07-29 23:30       ` Andy Lutomirski
2014-07-29 23:30       ` Andy Lutomirski
2014-07-30 15:32       ` Oleg Nesterov
2014-07-30 15:32         ` Oleg Nesterov
2014-07-30 15:32         ` Oleg Nesterov
2014-07-30 16:59       ` Frederic Weisbecker
2014-07-30 16:59         ` Frederic Weisbecker
2014-07-30 16:59         ` Frederic Weisbecker
2014-07-30 17:25         ` Andy Lutomirski
2014-07-30 17:25           ` Andy Lutomirski
2014-07-30 17:25           ` Andy Lutomirski
2014-07-31 16:56           ` H. Peter Anvin
2014-07-31 16:56             ` H. Peter Anvin
2014-07-31 16:56             ` H. Peter Anvin
2014-07-31 17:20             ` Frederic Weisbecker
2014-07-31 17:20               ` Frederic Weisbecker
2014-07-31 17:20               ` Frederic Weisbecker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.