From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933262AbbI3Sgg (ORCPT ); Wed, 30 Sep 2015 14:36:36 -0400 Received: from mail-io0-f182.google.com ([209.85.223.182]:35625 "EHLO mail-io0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932679AbbI3Sge (ORCPT ); Wed, 30 Sep 2015 14:36:34 -0400 Date: Wed, 30 Sep 2015 12:36:32 -0600 From: Tycho Andersen To: Andy Lutomirski Cc: Kees Cook , Alexei Starovoitov , Will Drewry , Oleg Nesterov , Pavel Emelyanov , "Serge E. Hallyn" , Daniel Borkmann , "linux-kernel@vger.kernel.org" , Network Development , Linux API Subject: Re: [PATCH v3 2/5] seccomp: add the concept of a seccomp filter FD Message-ID: <20150930183632.GA23065@smitten> References: <1443636820-17083-1-git-send-email-tycho.andersen@canonical.com> <1443636820-17083-3-git-send-email-tycho.andersen@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 30, 2015 at 11:27:34AM -0700, Andy Lutomirski wrote: > On Wed, Sep 30, 2015 at 11:13 AM, Tycho Andersen > wrote: > > This patch introduces the concept of a seccomp fd, with a similar interface > > and usage to ebpf fds. Initially, one is allowed to create, install, and > > dump these fds. Any manipulation of seccomp fds requires users to be root > > in their own user namespace, matching the checks done for > > SECCOMP_SET_MODE_FILTER. > > > > Installing a filterfd has some gotchas, though. Andy mentioned previously > > that we should restrict installation to filter fds whose parent is already > > in the filter tree. This doesn't quite work in the case of created seccomp > > fds, since once you install a filter fd, you can't install any other filter > > fd since it has no parent and there is no way to "pre-chain" filters before > > installing them. > > ISTM, if we like the seccomp fd approach, we should have them be > created with a parent already set. IOW the default should be that > their parent is the creator's seccomp fd and, if needed, creators > could specify a different parent. Allowing people doing SECCOMP_FD_NEW to specify a parent fd would work. Then we can disallow installing a seccomp fd if its parent is not the current filter, and get rid of the whole mess with prev locking and all that. Tycho