Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5088285imm; Tue, 9 Oct 2018 09:30:12 -0700 (PDT) X-Google-Smtp-Source: ACcGV61LG0pVBEMJb3CmWHf7SWt/wyem3EM3C1Y2v98rmD0RBg1vicHrPFgsOTaCwlo+xOcGK7jj X-Received: by 2002:a63:525c:: with SMTP id s28-v6mr25939324pgl.78.1539102612776; Tue, 09 Oct 2018 09:30:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539102612; cv=none; d=google.com; s=arc-20160816; b=a0FJq9wTaw5qiKasTmFkYDBpYkcmX3KX2sCxQpf4oVpk9Fo+rLaVtFOj2aayhBWOpX 0DpfFALepo4gn40Jm8uM1wW5Qfn7z5KEnHJFRfcC8EgVuTvQUCQGkki9BFfrw63JLUDP yAkCKJHluSic+pEfVHtN3bbYmYcxWeEU/x0LgU0i8YmfPaXStpWG3X5UQm/gML6IRzUm Znwcre3q1VXG5TasuJtfegGpXkdBvGy8NdIsS5GU3wr7QyBZMLV0/vG/B1zGZYM45hRh 8cOKKmIFiFMrkEvNyIaAA5DhPrMllEBTxhoXwXNBeQ6ueJlZ2FbHHyO4UMnZnBmertae xDPQ== 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:dkim-signature; bh=RNstUzfEbz55EHxXYMN4aHHdg69U4mVv+Cd5JPL43Ic=; b=Ze+DrBEW5hGRCMlBjoO9vhauBmPir6XmljoeVdUOuqYJoj1MON0arv/SsjN/UICmBK 6x+l/kWq5rVZPBfjDlYKBhmlqTjFhqv9dGuoqgAA/EwgWcgKssYmuzez/rg7iJ2ZGSkX vT9ANSzBQizarh+G3NHOUQ2mT5p9zVV/KCXxda1tImTQFQlQlH+WOwKR13wEB8xIo2VI 56REe2wgi8i58sD/oVg2MX7AgfYn2XYHjlCEu+IYmuOKXw1xhV0IDVJJrjTbqaldwv20 4vHqqd69QOGGLChJw86RIeILNU+sTkKoxUGW4ONp+7UbZTQCgXxUYYFVNwt8Vg5LYX7G 9psQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tycho-ws.20150623.gappssmtp.com header.s=20150623 header.b="VEzklw7/"; 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 8-v6si19042439pgr.205.2018.10.09.09.29.57; Tue, 09 Oct 2018 09:30:12 -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; dkim=pass header.i=@tycho-ws.20150623.gappssmtp.com header.s=20150623 header.b="VEzklw7/"; 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 S1727654AbeJIXrK (ORCPT + 99 others); Tue, 9 Oct 2018 19:47:10 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:43664 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727640AbeJIXrJ (ORCPT ); Tue, 9 Oct 2018 19:47:09 -0400 Received: by mail-pl1-f195.google.com with SMTP id 30-v6so1077191plb.10 for ; Tue, 09 Oct 2018 09:29:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tycho-ws.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=RNstUzfEbz55EHxXYMN4aHHdg69U4mVv+Cd5JPL43Ic=; b=VEzklw7/zS5eC4TEvXYSARE6mzfWv72nr+sM9CrMEuphdQsX2LxhgHXWUt5UtM7/Ty /wgMmHtKQuIkKLwgkmQTptROuCQqax619VBy06rbIPLVb6xDb4+xnA9ONqWNzM9BUtW/ Y3VIlxnuY5SAIBJ0Qo/nuCCWjfoGYBYeME37nlrXuw0V2+5Gs7k37F3MHo6jmEK2Gw9n ilV+5bZCafLU8bJJQuCzX4bcwJFTCe0ZZ9joh3kxunTo+GUIFqfVjLWi+Kks1nXTTjTT e7gqJj5MB30jIa6efGdkDO+mKPKNNAVOSEqd4wYTu0e3ajmnTfjdZ6xvXtIf0MuvY18f +Nqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=RNstUzfEbz55EHxXYMN4aHHdg69U4mVv+Cd5JPL43Ic=; b=iZL+mz5QhC1Pet45FQkeWzZgyu+h/hOnXteDY6jnh5M3PLT7pBOwYylb4VH7XrHCR7 Okz3xSm3TAFn9lANOd5SduUezDlWBBtlf732rV0X46Kn5w3ewupbr/FCqItoWykIPp84 9Q7p3VBAYNuShrzBCLwCYaWNYC4omnYPOL8edt5U+sq1WjGVLGZi4u3zRzKf5jpxfiJM AgMFc5jNWBYUnVHdqlWtFnWbeG1ADDWEJhTwJap5igY22ZAbq32rSu6pswRgUsnthdUN wOxTXfp2n3jWXljVDDtfYdv2FQ+4wxIEDwn4x1c1T6kVz/BqXpqCoXxu1YRnrjlabA0i 4S7Q== X-Gm-Message-State: ABuFfoin4bRhSqcrSvHlV3YpAqj4Cci+T+xjv20kk0Hlgz6U8c744mVc 0387cmgGB4qnbxOLRfadAqH2vQ== X-Received: by 2002:a17:902:24a5:: with SMTP id w34-v6mr9546907pla.73.1539102563837; Tue, 09 Oct 2018 09:29:23 -0700 (PDT) Received: from cisco ([2001:420:28e:1260:c7c:88c5:50e7:459f]) by smtp.gmail.com with ESMTPSA id f25-v6sm25090803pfn.177.2018.10.09.09.29.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Oct 2018 09:29:22 -0700 (PDT) Date: Tue, 9 Oct 2018 09:29:21 -0700 From: Tycho Andersen To: Christian Brauner Cc: Kees Cook , Jann Horn , Linux API , Linux Containers , Akihiro Suda , Oleg Nesterov , LKML , "Eric W . Biederman" , "linux-fsdevel@vger.kernel.org" , Christian Brauner , Andy Lutomirski Subject: Re: [PATCH v7 1/6] seccomp: add a return code to trap to userspace Message-ID: <20181009162921.GC10149@cisco> References: <20180927151119.9989-1-tycho@tycho.ws> <20180927151119.9989-2-tycho@tycho.ws> <20180927224839.GF15491@cisco.cisco.com> <20181008145803.ycawjwhc3mwkdogf@brauner.io> <20181009142833.GA10149@cisco> <20181009162413.sry5hnplvvpjggd4@brauner.io> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181009162413.sry5hnplvvpjggd4@brauner.io> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 09, 2018 at 06:24:14PM +0200, Christian Brauner wrote: > On Tue, Oct 09, 2018 at 07:28:33AM -0700, Tycho Andersen wrote: > > On Mon, Oct 08, 2018 at 04:58:05PM +0200, Christian Brauner wrote: > > > On Thu, Sep 27, 2018 at 04:48:39PM -0600, Tycho Andersen wrote: > > > > On Thu, Sep 27, 2018 at 02:31:24PM -0700, Kees Cook wrote: > > > > > I have to say, I'm vaguely nervous about changing the semantics here > > > > > for passing back the fd as the return code from the seccomp() syscall. > > > > > Alternatives seem less appealing, though: changing the meaning of the > > > > > uargs parameter when SECCOMP_FILTER_FLAG_NEW_LISTENER is set, for > > > > > example. Hmm. > > > > > > > > From my perspective we can drop this whole thing. The only thing I'll > > > > ever use is the ptrace version. Someone at some point (I don't > > > > remember who, maybe stgraber) suggested this version would be useful > > > > as well. > > > > > > So I think we want to have the ability to get an fd via seccomp(). > > > Especially, if we all we worry about are weird semantics. When we > > > discussed this we knew the whole patchset was going to be weird. :) > > > > > > This is a seccomp feature so seccomp should - if feasible - equip you > > > with everything to use it in a meaningful way without having to go > > > through a different kernel api. I know ptrace and seccomp are > > > already connected but I still find this cleaner. :) > > > > > > Another thing is that the container itself might be traced for some > > > reason while you still might want to get an fd out. > > > > Sure, I don't see the problem here. > > How'd you to PTRACE_ATTACH in that case? Oh, you mean if someone has *ptrace*'d the task, and a third party wants to get a seccomp fd? I think "too bad" is the answer; I don't really mind not supporting this case. > Anyway, the whole point is as we've discusses in the other thread we > really want a one-syscall-only, purely-seccomp() based way of getting > the fd. There are multiple options to get the fd even when you block > sendmsg()/socket() whatever and there's no good reason to only be able > to get the fd via a three-syscall-ptrace dance. :) Ok, I'll leave these bits in then for v8. Tycho