Received: by 10.213.65.68 with SMTP id h4csp74389imn; Thu, 15 Mar 2018 09:57:58 -0700 (PDT) X-Google-Smtp-Source: AG47ELtjl9SxQKJQKfNbeFbbwaFVCB7rxy4Z3N0Bc14IzOoY9rARCEhagAaNnMIzOZ/vX1kiZepd X-Received: by 2002:a17:902:3303:: with SMTP id a3-v6mr8767932plc.399.1521133078757; Thu, 15 Mar 2018 09:57:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521133078; cv=none; d=google.com; s=arc-20160816; b=bbIuu2sdHPKVhkjbxsPeD8cLFYVYZj0ajgf8xYfBl1b51C9RKyHJvJUnDvWcy3t4Ys ji3uo93TwheOA9iU23E1ALqKFa0SxIKLEW72eeUGoyTI0YBKUvpg5kVl2nsGosXXVIzl 3vFmC1BdWXrArZVWrAHb+KdwT5i6rW/7s0XF1vBtrc2Ho14Nz11ZrxGtYBqeNj6zUpQC gBZIxl3LlbtzIxKzP4EkzHQjz1gitVu2hqyeERd+hUbIbTCt8a2gffEHyrDsfF/Jsrj8 7BTZUmyYhBYVTU5cUDe8Lbwy6U6LpOXDj4LU64k0+xG6aUqekf6i/fOnRXAXM83ZqyCu KdMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dmarc-filter :arc-authentication-results; bh=fUXlvmyhP8GGaMS/mjw0wb6rLDdWQ4jOgnIL+1stZBc=; b=ntWLwSDnNhw48rIcZnCJTgjfWdQFUW2haPpd7sYVVC371KU7wr4TFcvID+s8bSsUet 0rVUkr2YB/CDJJVMrwey/bB1dISVAn6v2uDtukb3F2Mu7O4YkJOZarWVxnC/x/4WlccT oJWJ8JoQcb8RxybVFVu/E1hd+Ip1NUttFnenGYFQUkHH6i3uA0CEQNRAtiKJoLOV0Wkn UeNRVURHiqurrKyIYsSuuX4jQAKF5B0xr9bWWQ1ZZbOA4SuDeOPRfDna/aJ2G3CuDiS9 Wn7+rOZ754l1X5ZqcvUdOHStYu4YKe/DVG86nxykB8nu62gzOb04xN2jSN94VjtyVtNq Z1vQ== 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 u6-v6si4522961plz.64.2018.03.15.09.57.43; Thu, 15 Mar 2018 09:57:58 -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 S1751943AbeCOQ4g (ORCPT + 99 others); Thu, 15 Mar 2018 12:56:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:42980 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751828AbeCOQ4e (ORCPT ); Thu, 15 Mar 2018 12:56:34 -0400 Received: from mail-it0-f46.google.com (mail-it0-f46.google.com [209.85.214.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AF6A020779 for ; Thu, 15 Mar 2018 16:56:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF6A020779 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=luto@kernel.org Received: by mail-it0-f46.google.com with SMTP id e98-v6so4741606itd.4 for ; Thu, 15 Mar 2018 09:56:33 -0700 (PDT) X-Gm-Message-State: AElRT7GZlqsPTLYF13GUtsyhf7CNUnzmKmLlGDaMTrQQs2z1UxFROmvt uMqYQWIQ0sqVtKLModBQmRVDhycblz/yyAtUv/mkqA== X-Received: by 2002:a24:4c54:: with SMTP id a81-v6mr7227596itb.55.1521132993091; Thu, 15 Mar 2018 09:56:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.2.137.101 with HTTP; Thu, 15 Mar 2018 09:56:12 -0700 (PDT) In-Reply-To: <20180315160924.GA12744@gmail.com> References: <20180204104946.25559-1-tycho@tycho.ws> <20180315160924.GA12744@gmail.com> From: Andy Lutomirski Date: Thu, 15 Mar 2018 16:56:12 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC 0/3] seccomp trap to userspace To: Christian Brauner Cc: Tycho Andersen , LKML , Linux Containers , Kees Cook , Oleg Nesterov , "Eric W . Biederman" , "Serge E . Hallyn" , Christian Brauner , Tyler Hicks , Akihiro Suda Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.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.