From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754510AbbIIPzr (ORCPT ); Wed, 9 Sep 2015 11:55:47 -0400 Received: from mail-io0-f179.google.com ([209.85.223.179]:33139 "EHLO mail-io0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754354AbbIIPzp (ORCPT ); Wed, 9 Sep 2015 11:55:45 -0400 Date: Wed, 9 Sep 2015 09:55:43 -0600 From: Tycho Andersen To: Alexei Starovoitov Cc: Kees Cook , "Michael Kerrisk (man-pages)" , Linux API , Alexei Starovoitov , Will Drewry , Oleg Nesterov , Andy Lutomirski , Pavel Emelyanov , "Serge E. Hallyn" , Daniel Borkmann , LKML , Network Development Subject: Re: [PATCH 5/6] seccomp: add a way to attach a filter via eBPF fd Message-ID: <20150909155543.GB26679@smitten> References: <1441382664-17437-1-git-send-email-tycho.andersen@canonical.com> <1441382664-17437-6-git-send-email-tycho.andersen@canonical.com> <55EA95FE.7000006@gmail.com> <20150908134044.GV26679@smitten> <20150909144724.GZ26679@smitten> <20150909151402.GA3429@Alexeis-MBP-2.westell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150909151402.GA3429@Alexeis-MBP-2.westell.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(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 the same strategy as bpf() and > > checking for zeroes at the end), and keep the same signature for > > seccomp(); so: > > > > seccomp(SECCOMP_MODE_FILTER_EBPF, SECCOMP_ADD_BPF_FD, &union) > > > > Yes, I'll use this in the next version. > > actually bpf() has size as the last argument: > SYSCALL_DEFINE3(bpf, int, cmd, union bpf_attr __user *, uattr, unsigned int, size) > perf_event_open() doesn't and size is embedded as one of the fields. > Both approaches are equivally powerfull from extensitiblity > point of view. My preference was to keep size as an explicit > argument. Yep, sorry that was poorly written. I meant keeping the size as a member of the struct as Michael originally suggested, mostly to avoid having to change the signature of seccomp(). Tycho