Re: [PATCH v7 1/6] seccomp: add a return code to trap to userspace

2018-10-22 Thread Christian Brauner
On Sun, Oct 21, 2018 at 05:04:37PM +0100, Tycho Andersen wrote: > On Wed, Oct 17, 2018 at 03:21:02PM -0700, Kees Cook wrote: > > On Wed, Oct 17, 2018 at 1:29 PM, Tycho Andersen wrote: > > > On Thu, Sep 27, 2018 at 02:31:24PM -0700, Kees Cook wrote: > > >> On Thu, Sep 27, 2018 at 8:11 AM, Tycho And

Re: [PATCH v7 1/6] seccomp: add a return code to trap to userspace

2018-10-21 Thread Tycho Andersen
On Wed, Oct 17, 2018 at 03:21:02PM -0700, Kees Cook wrote: > On Wed, Oct 17, 2018 at 1:29 PM, Tycho Andersen wrote: > > On Thu, Sep 27, 2018 at 02:31:24PM -0700, Kees Cook wrote: > >> On Thu, Sep 27, 2018 at 8:11 AM, Tycho Andersen wrote: > >> > @@ -60,4 +62,29 @@ struct seccomp_data { > >> >

Re: [PATCH v7 1/6] seccomp: add a return code to trap to userspace

2018-10-17 Thread Tycho Andersen
On Wed, Oct 17, 2018 at 03:21:02PM -0700, Kees Cook wrote: > On Wed, Oct 17, 2018 at 1:29 PM, Tycho Andersen wrote: > > On Thu, Sep 27, 2018 at 02:31:24PM -0700, Kees Cook wrote: > >> On Thu, Sep 27, 2018 at 8:11 AM, Tycho Andersen wrote: > >> > @@ -60,4 +62,29 @@ struct seccomp_data { > >> >

Re: [PATCH v7 1/6] seccomp: add a return code to trap to userspace

2018-10-17 Thread Kees Cook
On Wed, Oct 17, 2018 at 1:29 PM, Tycho Andersen wrote: > On Thu, Sep 27, 2018 at 02:31:24PM -0700, Kees Cook wrote: >> On Thu, Sep 27, 2018 at 8:11 AM, Tycho Andersen wrote: >> > @@ -60,4 +62,29 @@ struct seccomp_data { >> > __u64 args[6]; >> > }; >> > >> > +struct seccomp_notif { >> > +

Re: [PATCH v7 1/6] seccomp: add a return code to trap to userspace

2018-10-17 Thread Tycho Andersen
On Thu, Sep 27, 2018 at 02:31:24PM -0700, Kees Cook wrote: > On Thu, Sep 27, 2018 at 8:11 AM, Tycho Andersen wrote: > > @@ -60,4 +62,29 @@ struct seccomp_data { > > __u64 args[6]; > > }; > > > > +struct seccomp_notif { > > + __u16 len; > > + __u64 id; > > + __u32 pid; >

Re: [PATCH v7 1/6] seccomp: add a return code to trap to userspace

2018-10-09 Thread Tycho Andersen
On Tue, Oct 09, 2018 at 06:24:14PM +0200, Christian Brauner wrote: > On Tue, Oct 09, 2018 at 07:28:33AM -0700, Tycho Andersen wrote: > > On Mon, Oct 08, 2018 at 04:58:05PM +0200, Christian Brauner wrote: > > > On Thu, Sep 27, 2018 at 04:48:39PM -0600, Tycho Andersen wrote: > > > > On Thu, Sep 27, 2

Re: [PATCH v7 1/6] seccomp: add a return code to trap to userspace

2018-10-09 Thread Christian Brauner
On Tue, Oct 09, 2018 at 07:28:33AM -0700, Tycho Andersen wrote: > On Mon, Oct 08, 2018 at 04:58:05PM +0200, Christian Brauner wrote: > > On Thu, Sep 27, 2018 at 04:48:39PM -0600, Tycho Andersen wrote: > > > On Thu, Sep 27, 2018 at 02:31:24PM -0700, Kees Cook wrote: > > > > I have to say, I'm vaguel

Re: [PATCH v7 1/6] seccomp: add a return code to trap to userspace

2018-10-09 Thread Tycho Andersen
On Mon, Oct 08, 2018 at 04:58:05PM +0200, Christian Brauner wrote: > On Thu, Sep 27, 2018 at 04:48:39PM -0600, Tycho Andersen wrote: > > On Thu, Sep 27, 2018 at 02:31:24PM -0700, Kees Cook wrote: > > > I have to say, I'm vaguely nervous about changing the semantics here > > > for passing back the f

Re: [PATCH v7 1/6] seccomp: add a return code to trap to userspace

2018-10-08 Thread Christian Brauner
On Thu, Sep 27, 2018 at 04:48:39PM -0600, Tycho Andersen wrote: > On Thu, Sep 27, 2018 at 02:31:24PM -0700, Kees Cook wrote: > > On Thu, Sep 27, 2018 at 8:11 AM, Tycho Andersen wrote: > > > This patch introduces a means for syscalls matched in seccomp to notify > > > some other task that a particu

Re: [PATCH v7 1/6] seccomp: add a return code to trap to userspace

2018-09-28 Thread Aleksa Sarai
On 2018-09-27, Tycho Andersen wrote: > This patch introduces a means for syscalls matched in seccomp to notify > some other task that a particular filter has been triggered. > > The motivation for this is primarily for use with containers. For example, > if a container does an init_module(), we o

Re: [PATCH v7 1/6] seccomp: add a return code to trap to userspace

2018-09-28 Thread Tycho Andersen
On Thu, Sep 27, 2018 at 04:10:29PM -0700, Kees Cook wrote: > On Thu, Sep 27, 2018 at 3:48 PM, Tycho Andersen wrote: > > On Thu, Sep 27, 2018 at 02:31:24PM -0700, Kees Cook wrote: > >> On Thu, Sep 27, 2018 at 8:11 AM, Tycho Andersen wrote: > >> struct seccomp_notif { > >> __u16

Re: [PATCH v7 1/6] seccomp: add a return code to trap to userspace

2018-09-27 Thread Jann Horn
On Fri, Sep 28, 2018 at 1:04 AM Tycho Andersen wrote: > On Thu, Sep 27, 2018 at 11:51:40PM +0200, Jann Horn wrote: > > > +It is worth noting that ``struct seccomp_data`` contains the values of > > > register > > > +arguments to the syscall, but does not contain pointers to memory. The > > > task

Re: [PATCH v7 1/6] seccomp: add a return code to trap to userspace

2018-09-27 Thread Kees Cook
On Thu, Sep 27, 2018 at 3:48 PM, Tycho Andersen wrote: > On Thu, Sep 27, 2018 at 02:31:24PM -0700, Kees Cook wrote: >> On Thu, Sep 27, 2018 at 8:11 AM, Tycho Andersen wrote: >> struct seccomp_notif { >> __u16 len; /* 0 2 */ >> >> /* XX

Re: [PATCH v7 1/6] seccomp: add a return code to trap to userspace

2018-09-27 Thread Tycho Andersen
On Thu, Sep 27, 2018 at 03:45:11PM -0700, Kees Cook wrote: > On Thu, Sep 27, 2018 at 2:51 PM, Jann Horn wrote: > > On Thu, Sep 27, 2018 at 5:11 PM Tycho Andersen wrote: > >> However, care should be taken to avoid the TOCTOU > >> +mentioned above in this document: all arguments being read from the

Re: [PATCH v7 1/6] seccomp: add a return code to trap to userspace

2018-09-27 Thread Tycho Andersen
On Thu, Sep 27, 2018 at 11:51:40PM +0200, Jann Horn wrote: > +Christoph Hellwig, Al Viro, fsdevel: For two questions about the poll > interface (search for "seccomp_notify_poll" and > "seccomp_notify_release" in the patch) > > @Tycho: FYI, I've gone through all of v7 now, apart from the > test/sam

Re: [PATCH v7 1/6] seccomp: add a return code to trap to userspace

2018-09-27 Thread Tycho Andersen
On Thu, Sep 27, 2018 at 02:31:24PM -0700, Kees Cook wrote: > On Thu, Sep 27, 2018 at 8:11 AM, Tycho Andersen wrote: > > This patch introduces a means for syscalls matched in seccomp to notify > > some other task that a particular filter has been triggered. > > > > The motivation for this is primar

Re: [PATCH v7 1/6] seccomp: add a return code to trap to userspace

2018-09-27 Thread Kees Cook
On Thu, Sep 27, 2018 at 2:51 PM, Jann Horn wrote: > On Thu, Sep 27, 2018 at 5:11 PM Tycho Andersen wrote: >> However, care should be taken to avoid the TOCTOU >> +mentioned above in this document: all arguments being read from the tracee's >> +memory should be read into the tracer's memory before

Re: [PATCH v7 1/6] seccomp: add a return code to trap to userspace

2018-09-27 Thread Jann Horn
+Christoph Hellwig, Al Viro, fsdevel: For two questions about the poll interface (search for "seccomp_notify_poll" and "seccomp_notify_release" in the patch) @Tycho: FYI, I've gone through all of v7 now, apart from the test/sample code. So don't wait for more comments from me before sending out v8

Re: [PATCH v7 1/6] seccomp: add a return code to trap to userspace

2018-09-27 Thread Kees Cook
On Thu, Sep 27, 2018 at 8:11 AM, Tycho Andersen wrote: > This patch introduces a means for syscalls matched in seccomp to notify > some other task that a particular filter has been triggered. > > The motivation for this is primarily for use with containers. For example, > if a container does an in