Re: [PATCH 5/6] seccomp: add a way to attach a filter via eBPF fd

2015-09-09 Thread Tycho Andersen
On Wed, Sep 09, 2015 at 08:14:04AM -0700, Alexei Starovoitov wrote: > On Wed, Sep 09, 2015 at 08:47:24AM -0600, Tycho Andersen wrote: > > On Tue, Sep 08, 2015 at 05:07:03PM -0700, Kees Cook wrote: > > > > > > Yeah, bpf's union looks good. Let's add a "command" flag, though: > > > > > > seccomp(SEC

Re: [PATCH 5/6] seccomp: add a way to attach a filter via eBPF fd

2015-09-09 Thread Alexei Starovoitov
On Wed, Sep 09, 2015 at 08:47:24AM -0600, Tycho Andersen wrote: > On Tue, Sep 08, 2015 at 05:07:03PM -0700, Kees Cook wrote: > > > > Yeah, bpf's union looks good. Let's add a "command" flag, though: > > > > seccomp(SECCOMP_MODE_FILTER_EBPF, int cmd, union, size); > > > > And this cmd could be ADD

Re: [PATCH 5/6] seccomp: add a way to attach a filter via eBPF fd

2015-09-09 Thread Tycho Andersen
On Tue, Sep 08, 2015 at 05:07:03PM -0700, Kees Cook wrote: > > Yeah, bpf's union looks good. Let's add a "command" flag, though: > > seccomp(SECCOMP_MODE_FILTER_EBPF, int cmd, union, size); > > And this cmd could be ADD_FD or something? > > How's that look? I think we can drop the size (using t

Re: [PATCH 5/6] seccomp: add a way to attach a filter via eBPF fd

2015-09-08 Thread Kees Cook
On Tue, Sep 8, 2015 at 6:40 AM, Tycho Andersen wrote: > On Sat, Sep 05, 2015 at 09:13:02AM +0200, Michael Kerrisk (man-pages) wrote: >> On 09/04/2015 10:41 PM, Kees Cook wrote: >> > On Fri, Sep 4, 2015 at 9:04 AM, Tycho Andersen >> > wrote: >> >> This is the final bit needed to support seccomp fi

Re: [PATCH 5/6] seccomp: add a way to attach a filter via eBPF fd

2015-09-08 Thread Tycho Andersen
On Sat, Sep 05, 2015 at 09:13:02AM +0200, Michael Kerrisk (man-pages) wrote: > On 09/04/2015 10:41 PM, Kees Cook wrote: > > On Fri, Sep 4, 2015 at 9:04 AM, Tycho Andersen > > wrote: > >> This is the final bit needed to support seccomp filters created via the bpf > >> syscall. > > Hmm. Thanks Kees

Re: [PATCH 5/6] seccomp: add a way to attach a filter via eBPF fd

2015-09-05 Thread Michael Kerrisk (man-pages)
On 09/04/2015 10:41 PM, Kees Cook wrote: > On Fri, Sep 4, 2015 at 9:04 AM, Tycho Andersen > wrote: >> This is the final bit needed to support seccomp filters created via the bpf >> syscall. Hmm. Thanks Kees, for CCinf linux-api@. That really should have been done at the outset. Tycho, where's th

Re: [PATCH 5/6] seccomp: add a way to attach a filter via eBPF fd

2015-09-04 Thread Kees Cook
On Fri, Sep 4, 2015 at 9:04 AM, Tycho Andersen wrote: > This is the final bit needed to support seccomp filters created via the bpf > syscall. > > One concern with this patch is exactly what the interface should look like > for users, since seccomp()'s second argument is a pointer, we could ask >

Re: [PATCH 5/6] seccomp: add a way to attach a filter via eBPF fd

2015-09-04 Thread Alexei Starovoitov
On Fri, Sep 04, 2015 at 10:04:23AM -0600, Tycho Andersen wrote: > This is the final bit needed to support seccomp filters created via the bpf > syscall. > > One concern with this patch is exactly what the interface should look like > for users, since seccomp()'s second argument is a pointer, we co

[PATCH 5/6] seccomp: add a way to attach a filter via eBPF fd

2015-09-04 Thread Tycho Andersen
This is the final bit needed to support seccomp filters created via the bpf syscall. One concern with this patch is exactly what the interface should look like for users, since seccomp()'s second argument is a pointer, we could ask people to pass a pointer to the fd, but implies we might write to