Received: by 10.213.65.68 with SMTP id h4csp80254imn; Thu, 15 Mar 2018 10:07:06 -0700 (PDT) X-Google-Smtp-Source: AG47ELuAbSfao2TMATTjVfQath+6LBm1MqWQknjW48lpE3IHC47Y04jz9/dqG/W19GOn2K14Eiwe X-Received: by 2002:a17:902:b943:: with SMTP id h3-v6mr4847885pls.1.1521133626464; Thu, 15 Mar 2018 10:07:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521133626; cv=none; d=google.com; s=arc-20160816; b=jyNqcwFyKd6q8dESlbj4e99ortSTN5xZJ0LxbYB19iVnkEgHQmf5pZ9J+6FNTcBc9R aYeaDQxvy8NV12SrcIKBA2zG8vwsJznhDTt0cZQHRDihpoM/PjDDPyXRUV+hbM474IOJ BX458DDNE1IA1j0gfHSHVUfbhEeEt6EbrpzsLI8dibqBoSJCruV2/YZRvFPNNov1mtLR CX5XzPa79gjP713M6kXRja4oHpDDpzmrjPDHui8sunnY+cd5+apKDyqzhVl4/Z84znu5 GLWwK7/X91HvQrgcNlbtWDyzj/mTMPnY7qC69UL+bm4O1lvE15RzHnN4oq6hkIMClSHC GExg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=OhHsc2/4eDmxGQhT5ddhVmrqmpvge6KIF71FXtQGnnE=; b=h136EW8s5eu16TmvpGnFT4kW6d1DoeycJu5Qg9dnhGb6gkUm7jLK1MyBnWkM9Zddr5 5GVx26xvMj+pCndZBMdx+h6tq1+N7447g0OpJbG4+sCEAA2yI2H86dy/jg5bGfXueqeD 3LNF3QJdiqaqnBhmWr5FXjgl64jy6tM4Nj9oTaz/H1SIm4d2RwcgwIqVJi+jmqv8wtv+ 8nSBeqj/9DNQW1dyaDij5xFP9aRDcn5PdudC/xZsvmuTP0VXmbOdyQSGNTiGdT0bHbgt bYL5+hVnJCnqnnUByraQEaAFCA+AK3ScA7+2QSWlBRVkMVwwDQidTw9xPq3D/K5gaHjO IKlg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d8si3630411pgc.553.2018.03.15.10.06.52; Thu, 15 Mar 2018 10:07:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752393AbeCORFO (ORCPT + 99 others); Thu, 15 Mar 2018 13:05:14 -0400 Received: from h2.hallyn.com ([78.46.35.8]:54854 "EHLO mail.hallyn.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752315AbeCORFM (ORCPT ); Thu, 15 Mar 2018 13:05:12 -0400 Received: by mail.hallyn.com (Postfix, from userid 1001) id CFD88120458; Thu, 15 Mar 2018 12:05:09 -0500 (CDT) Date: Thu, 15 Mar 2018 12:05:09 -0500 From: "Serge E. Hallyn" To: Andy Lutomirski Cc: Christian Brauner , Tycho Andersen , LKML , Linux Containers , Kees Cook , Oleg Nesterov , "Eric W . Biederman" , "Serge E . Hallyn" , Christian Brauner , Tyler Hicks , Akihiro Suda Subject: Re: [RFC 0/3] seccomp trap to userspace Message-ID: <20180315170509.GA32766@mail.hallyn.com> References: <20180204104946.25559-1-tycho@tycho.ws> <20180315160924.GA12744@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Andy Lutomirski (luto@kernel.org): > On Thu, Mar 15, 2018 at 4:09 PM, Christian Brauner > wrote: > > On Sun, Feb 04, 2018 at 11:49:43AM +0100, Tycho Andersen wrote: > >> Several months ago at Linux Plumber's, we had a discussion about adding a > >> feature to seccomp which would allow seccomp to trigger a notification for some > >> other process. Here's a draft of that feature. > >> > >> Patch 1 contains the bulk of it, patches 2 & 3 offer an alternative way to > >> acquire the fd that receives notifications via ptrace (the method in patch 1 > >> poses some problems). Other suggestions for how to acquire one of these fds > >> would be welcome. > >> > >> Take a close look at the synchronization. I think I've got it right, but I > >> probably don't :) > >> > >> Thanks! > >> > >> Tycho Andersen (3): > >> seccomp: add a return code to trap to userspace > >> seccomp: hoist out filter resolving logic > >> seccomp: add a way to get a listener fd from ptrace > >> > >> arch/Kconfig | 7 + > >> include/linux/seccomp.h | 14 +- > >> include/uapi/linux/ptrace.h | 1 + > >> include/uapi/linux/seccomp.h | 18 +- > >> kernel/ptrace.c | 4 + > >> kernel/seccomp.c | 467 ++++++++++++++++++++++++-- > >> tools/testing/selftests/seccomp/seccomp_bpf.c | 180 +++++++++- > >> 7 files changed, 653 insertions(+), 38 deletions(-) > > > > Hey, > > > > So, I've been following the discussion silently in the background and I > > see that it got sidetracked into seccomp + ebpf. While I can see that > > there is value in adding epbf support to seccomp I'd really like to see > > this decoupled from this patchset. Afaict, this patchset would just work > > fine without the ebpf portion (but I might be just have missed the > > point). So if possible I would like to see a second version of this with > > the comments accounted for and - if possible - have this up for merging > > independent of the ebpf patchset that's floating around. > > > > The issue is that it might be (and, then again, might not be) nicer to > to *synchronously* call out to the monitor in the filter. eBPF can do > that very cleanly, whereas classic BPF can't. Hm, synchronously - that brings to mind a thought... I should re-look at Tycho's patches first, but, if I'm in a container, start some syscall that gets trapped to userspace, then I hit ctrl-c. I'd like to be able to have the handler be interrupted and have it return -EINTR. Is that going to be possible with the synchronous approach?