Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2692379ybk; Mon, 18 May 2020 05:47:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdCoPbad6sE0+6BrvfQEDLcYiYpEYdFCyB7Zuvqqj+B5HV2Dtr1+93vKrYp5MLTjcJWY4q X-Received: by 2002:a05:6402:13d9:: with SMTP id a25mr13922572edx.9.1589806030041; Mon, 18 May 2020 05:47:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589806030; cv=none; d=google.com; s=arc-20160816; b=b0qoBIAt8yET6EmXqBW/iXqVvA72wm6C881iOodq6sxn8VtpNjI5rJeH5LIwSaJns2 quKELhP8GXwOPBx4t4Ybd8glZ3gfnUhZQigp4cFwxtGXl6CIglV7QMfPg2RC2ldnZgMR m4CfZOsh1/Tr7uX0zer+yXx7+5mFJSQ+1cYztUA6EHUpXBcjulAE3NaRKDntnAFFz2Kl 1aYk31GHPn5CHxKtk8km5u2+b/5lk3tzMzi0geOOpN+7ExMeu9McafRONghjqOj61X7S 5Y+SV43UsN8nqKv3Y8tesQ1xl7YR4nOkJtN8OQS8iI23rTOWlRVRBW4sgzQSs8kqKx/d nBVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=mV1LoUk5Q85S5fkD7awPEwJ4iB9eIn0wkfXNPDC9x4U=; b=IFvBLZcp6E+2yDRL96UJot6Ny5Or94FoDDG2KEhkerkEoqraB5FSmQnrfmNNwGow1j Ws0n54zjTbNx41tVxjYJ1q+na9ghXoIDbMYP9UTXo+kGcmPBj0wCxciudFz0DeuclWDv bm0haZ7ng3LR2AGr/+CyLAbhzzWDXf20Q6cuPUSN06eezHhWCx6uLKA1G7O9z5kDEHMq B96vJlhrobgellPBIK0IhyDECtVqIrUPa6RRTHZcJJ7Q3WSeoNtmSBfPu+KtEcvngR6l 52K7rNarjsJ3/gp/p6ddfH+xBKBqgJExbQxPYXaQAAZaab7386jf77r13SHjqV/KjwRy TuxA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gq26si6311576ejb.106.2020.05.18.05.46.47; Mon, 18 May 2020 05:47:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727898AbgERMpF (ORCPT + 99 others); Mon, 18 May 2020 08:45:05 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:59520 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726758AbgERMpE (ORCPT ); Mon, 18 May 2020 08:45:04 -0400 Received: from ip5f5af183.dynamic.kabel-deutschland.de ([95.90.241.131] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jaf8f-0004S1-7W; Mon, 18 May 2020 12:45:01 +0000 Date: Mon, 18 May 2020 14:45:00 +0200 From: Christian Brauner To: Sargun Dhillon Cc: Kees Cook , Tycho Andersen , linux-api@vger.kernel.org, containers@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] seccomp: Add group_leader pid to seccomp_notif Message-ID: <20200518124500.5cb7rtjitbiiw3mq@wittgenstein> References: <20200515234005.32370-1-sargun@sargun.me> <202005162344.74A02C2D@keescook> <20200517104701.bbn2d2rqaplwchdw@wittgenstein> <20200517112156.cphs2h33hx2wfcs4@yavin.dot.cyphar.com> <20200517142316.GA1996744@cisco> <20200517143311.fmxaf3pnopuaezl4@wittgenstein> <20200517144603.GD1996744@cisco> <20200517150215.GE1996744@cisco> <202005171428.68F30AA0@keescook> <20200518083224.GA16270@ircssh-2.c.rugged-nimbus-611.internal> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200518083224.GA16270@ircssh-2.c.rugged-nimbus-611.internal> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 18, 2020 at 08:32:25AM +0000, Sargun Dhillon wrote: > On Sun, May 17, 2020 at 02:30:57PM -0700, Kees Cook wrote: > > On Sun, May 17, 2020 at 09:02:15AM -0600, Tycho Andersen wrote: > > > > I'm going read this thread more carefully tomorrow, but I just wanted to > > mention that I'd *like* to extend seccomp_data for doing deep argument > > inspection of the new syscalls. I think it's the least bad of many > > designs, and I'll write that up in more detail. (I would *really* like > > to avoid extending seccomp's BPF language, and instead allow probing > > into the struct copied from userspace, etc.) > > > > Anyway, it's very related to this, so, yeah, probably we need a v2 of the > > notif API, but I'll try to get all the ideas here collected in one place. > I scratched together a proposal of what I think would make a not-terrible > V2 API. I'm sure there's bugs in this code, but I think it's workable -- > or at least a place to start. The biggest thing I think we should consider > is unrolling seccomp_data if we don't intend to add new BPF-accessible > fields. > > If also uses read(2), so we get to take advantage of read(2)'s ability > to pass a size along with the read, as opposed to doing ioctl tricks. > It also makes programming from against it slightly simpler. I can imagine > that the send API could be similar, in that it could support write, and > thus making it 100% usable from Go (and the like) without requiring > a separate OS-thread be spun up to interact with the listener. I don't have strong feelings about using read() and write() here but I think that Jann had reservations and that's why we didn't do it in the first version. But his reservations were specifically tied to fd passing which we never implemented: http://lkml.iu.edu/hypermail/linux/kernel/1806.2/05995.html But still, worth considering. Christian