Re: [PATCH v4 1/4] seccomp: add a return code to trap to userspace

2018-06-25 Thread Andy Lutomirski
> On Jun 25, 2018, at 6:32 PM, Tycho Andersen wrote: > >> On Sat, Jun 23, 2018 at 12:27:43AM +0200, Jann Horn wrote: >>> On Fri, Jun 22, 2018 at 11:51 PM Kees Cook wrote: >>> On Fri, Jun 22, 2018 at 11:09 AM, Andy Lutomirski wrote: One possible extra issue: IIRC /proc/.../me

Re: [PATCH v4 1/4] seccomp: add a return code to trap to userspace

2018-06-25 Thread Tycho Andersen
On Sat, Jun 23, 2018 at 12:27:43AM +0200, Jann Horn wrote: > On Fri, Jun 22, 2018 at 11:51 PM Kees Cook wrote: > > > > On Fri, Jun 22, 2018 at 11:09 AM, Andy Lutomirski > > wrote: > > > One possible extra issue: IIRC /proc/.../mem uses FOLL_FORCE, which is > > > not what we want here. > > Uuug

Re: [PATCH v4 1/4] seccomp: add a return code to trap to userspace

2018-06-22 Thread Jann Horn
On Fri, Jun 22, 2018 at 11:51 PM Kees Cook wrote: > > On Fri, Jun 22, 2018 at 11:09 AM, Andy Lutomirski wrote: > > One possible extra issue: IIRC /proc/.../mem uses FOLL_FORCE, which is not > > what we want here. Uuugh, I forgot about that. > > How about just adding an explicit “read/write the

Re: [PATCH v4 1/4] seccomp: add a return code to trap to userspace

2018-06-22 Thread Kees Cook
On Fri, Jun 22, 2018 at 11:09 AM, Andy Lutomirski wrote: > One possible extra issue: IIRC /proc/.../mem uses FOLL_FORCE, which is not > what we want here. > > How about just adding an explicit “read/write the seccomp-trapped task’s > memory” primitive? That should be easier than a “open mem fd”

Re: [PATCH v4 1/4] seccomp: add a return code to trap to userspace

2018-06-22 Thread Andy Lutomirski
> On Jun 22, 2018, at 8:15 AM, Tycho Andersen wrote: > > Hi Jann, > >> On Fri, Jun 22, 2018 at 04:40:20PM +0200, Jann Horn wrote: >>> On Fri, Jun 22, 2018 at 12:05 AM Tycho Andersen wrote: >>> This patch introduces a means for syscalls matched in seccomp to notify >>> some other task that a

Re: [PATCH v4 1/4] seccomp: add a return code to trap to userspace

2018-06-22 Thread Jann Horn
On Fri, Jun 22, 2018 at 5:15 PM Tycho Andersen wrote: > > Hi Jann, > > On Fri, Jun 22, 2018 at 04:40:20PM +0200, Jann Horn wrote: > > On Fri, Jun 22, 2018 at 12:05 AM Tycho Andersen wrote: > > > This patch introduces a means for syscalls matched in seccomp to notify > > > some other task that a p

Re: [PATCH v4 1/4] seccomp: add a return code to trap to userspace

2018-06-22 Thread Tycho Andersen
Hi Jann, On Fri, Jun 22, 2018 at 04:40:20PM +0200, Jann Horn wrote: > On Fri, Jun 22, 2018 at 12:05 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

Re: [PATCH v4 1/4] seccomp: add a return code to trap to userspace

2018-06-22 Thread Jann Horn
On Fri, Jun 22, 2018 at 12:05 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

Re: [PATCH v4 1/4] seccomp: add a return code to trap to userspace

2018-06-21 Thread Tycho Andersen
On Fri, Jun 22, 2018 at 03:28:24AM +0200, Jann Horn wrote: > On Fri, Jun 22, 2018 at 2:58 AM Tycho Andersen wrote: > > > > On Fri, Jun 22, 2018 at 01:21:47AM +0200, Jann Horn wrote: > > > On Fri, Jun 22, 2018 at 12:05 AM Tycho Andersen wrote: > > > [...] > > > > + > > > > +static void seccomp_do_

Re: [PATCH v4 1/4] seccomp: add a return code to trap to userspace

2018-06-21 Thread Jann Horn
On Fri, Jun 22, 2018 at 2:58 AM Tycho Andersen wrote: > > On Fri, Jun 22, 2018 at 01:21:47AM +0200, Jann Horn wrote: > > On Fri, Jun 22, 2018 at 12:05 AM Tycho Andersen wrote: > > > > > > This patch introduces a means for syscalls matched in seccomp to notify > > > some other task that a particul

Re: [PATCH v4 1/4] seccomp: add a return code to trap to userspace

2018-06-21 Thread Tycho Andersen
On Fri, Jun 22, 2018 at 01:21:47AM +0200, Jann Horn wrote: > On Fri, Jun 22, 2018 at 12:05 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. > [...] > > +Userspace Notification >

Re: [PATCH v4 1/4] seccomp: add a return code to trap to userspace

2018-06-21 Thread Jann Horn
On Fri, Jun 22, 2018 at 12:05 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. [...] > +Userspace Notification > +== > + > +The ``SECCOMP_RET_USER_NOTIF`` return c

[PATCH v4 1/4] seccomp: add a return code to trap to userspace

2018-06-21 Thread Tycho Andersen
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 obviously don't want to load this untrusted code,