Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1322731
| From | Andy Lutomirski <luto@amacapital.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC][PATCH] seccomp: add SECCOMP_RET_ACK for non-fatal SIGSYS |
| Date | 2016-01-31 21:20 +0100 |
| Message-ID | <qX6Dw-5f-9@gated-at.bofh.it> (permalink) |
| References | <qW5Jv-3s7-9@gated-at.bofh.it> <qW78B-4lQ-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Jan 28, 2016 6:33 PM, "Andy Lutomirski" <luto@amacapital.net> wrote: > > On Thu, Jan 28, 2016 at 5:06 PM, Kees Cook <keescook@chromium.org> wrote: > > Tracing processes for syscall usage can be done one step at a time with > > SECCOMP_RET_TRAP, but this will block the syscall. Alternatively, using > > a ptrace manager to handle SECCOMP_RET_TRACE returns can be used but is > > heavy weight and depends on the ptrace infrastructure. A light-weight > > method to learn syscalls is needed, which can reuse the existing delivery > > of SIGSYS but without skipping the syscall. This is implemented as > > SECCOMP_RET_ACK which is as permissive as SECCOMP_RET_ALLOW but delivers > > SIGSYS after syscall completion, as long as the SECCOMP_RET_DATA is > > non-zero. A signal handler can install a new rule for each syscall as > > they are signaled with SECCOMP_RET_DATA set to 0 to disable reporting > > for that syscall in the future (which is required for restarting syscalls > > that are signal-sensitive like nanosleep). > > > > Registers from the signal will reflect registers after the syscall returns > > rather than before. Signal-sensitive syscalls will trigger EINTR, so they > > must be whitelisted before they are resumed. Not allowing the sigreturn > > syscall (and likely prctl to whitelist) will make using SECCOMP_RET_ACK > > useless. > > > > Signed-off-by: Kees Cook <keescook@chromium.org> > > Could this use task_work to queue the signal on return to user mode > instead? Would that solve the EINTR issues? > As another option, use the existing TRAP option but add a way for a process to set a flag such that it can delete and re-add a filter. Then you get SIGSYS, delete the old filter, add a new one that allows the current syscall, and resume. No funny business with EINTR or clobbered regs. --Andy
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[RFC][PATCH] seccomp: add SECCOMP_RET_ACK for non-fatal SIGSYS Kees Cook <keescook@chromium.org> - 2016-01-29 02:10 +0100
Re: [RFC][PATCH] seccomp: add SECCOMP_RET_ACK for non-fatal SIGSYS Andy Lutomirski <luto@amacapital.net> - 2016-01-29 03:40 +0100
Re: [RFC][PATCH] seccomp: add SECCOMP_RET_ACK for non-fatal SIGSYS Jeffrey Vander Stoep <jeffv@google.com> - 2016-01-29 04:10 +0100
Re: [RFC][PATCH] seccomp: add SECCOMP_RET_ACK for non-fatal SIGSYS Andy Lutomirski <luto@amacapital.net> - 2016-01-31 21:20 +0100
csiph-web