Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp1083987ybm; Wed, 27 May 2020 16:00:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw91iPEFmQ1uoiCAUzWwMz4u0GJWXeHVWHrUuRujc6zQuyBqi4OPTsialmzTRqHQU7UgwMG X-Received: by 2002:a17:906:8514:: with SMTP id i20mr523088ejx.298.1590620431381; Wed, 27 May 2020 16:00:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590620431; cv=none; d=google.com; s=arc-20160816; b=NQH+XJT2h+2EKIECFjyOlUZ/ZSXFHaPmn08qwV/zvlxPrEO+sD9U8+SOEMLyEcNT+F bRrmF1KvV0YdEDPj2zeuFhrFr9+Qx0JeiamUYo3notBP2QGcuMrv3T7CHSO49q17gcG7 pj8JQSCaIH01n6ICdh2Sp7SBixYfsTYT7nNrg66LsrUfdJ9f1OJg+BOBianc7ft5at2U CbyDAttSfu9aHMJyADsTfTIauV4V6ti63Gzf649s3OoxZFLs419nWOy7lxGh/t7Lz+fn thZVllANDcVzyCL54BuqGA6VReX4yxbPDlkoLpWyrFVEWYvzwZv9iY3t+IweHoD3pxJ8 4e+g== 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 :dkim-signature; bh=PI2C96+3H6gIr9QJOVWp15+V0aH+BRuKNRaFs+DeBrE=; b=BGyS56uhb2VWi7OV/aDYz6/RBOm+KmvRS685rqsQRmg7BTQC4uZW1TrN/bIZllTsm1 b/Kepw7i4MDZHHDDFnFYdjEHVti7ktrmgzlSg486Jf++M9SdhqYLR+syFHnOgyOBYpdt Jn7CZH9wyqpX4r1gGaSCNYfpa2WEZOY4Jx3waUWZ+AyBS+LCRKIPeV9hLSj7lIC5S4H2 XAevJTx+Z4U4f8uOyXg7m4pUzoeK+UicYinyq6x+DHWNQk/JhjwZbM4ZppWzPvUlGkKc hFMzoWLRkN1Ous2I8BOjat1wOpXfRLyvrNQt0KACSOYd3w+CIe2NqmZij5IROCNNlJUP zz5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tycho-ws.20150623.gappssmtp.com header.s=20150623 header.b=XVLU5JS4; 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 g12si2702483ejw.143.2020.05.27.16.00.07; Wed, 27 May 2020 16:00:31 -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; dkim=pass header.i=@tycho-ws.20150623.gappssmtp.com header.s=20150623 header.b=XVLU5JS4; 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 S1725801AbgE0W4B (ORCPT + 99 others); Wed, 27 May 2020 18:56:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725267AbgE0W4A (ORCPT ); Wed, 27 May 2020 18:56:00 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BEA68C05BD1E for ; Wed, 27 May 2020 15:56:00 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id cx22so2239314pjb.1 for ; Wed, 27 May 2020 15:56:00 -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; bh=PI2C96+3H6gIr9QJOVWp15+V0aH+BRuKNRaFs+DeBrE=; b=XVLU5JS4PFZ1+641xJQKCy+0a8KVBDdRwl4Dbp9YR4WGmAjr3Ni+MyKkpE5whw2SHY iPduvkSjiJe1YZ3ssvpu4kaGT857K4A1OBHBWd+VWmlOnJbQJYfx7RKSN4nQRAtbz4zd 1wkp+drkbkadfk+Cl18tryoukg/3NQhWhi9Bhl17hL7M4j7e0GmLUEQL7KXPNAGK+VMA EqSJRZMN3qf5nw6ryczH8SmA1EYaetP+eQOSuOh5pWF6otfHvDItD9JtpPxzgEvCbnhT TrpwS5AtbcB7zKEY+ETAUpTUT+3FywPbYYOLWw1IJ9tepUgZBp+jjjn3vBKlpvrDZFRb eASg== 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; bh=PI2C96+3H6gIr9QJOVWp15+V0aH+BRuKNRaFs+DeBrE=; b=AIGIzVYlclpkPtYBmbwMAeziUCxQme0LoD2aaq6l6TOcTUWuxIUd0m2QTQAYA1FcGZ NFBaLVAbGgcmbH93p06w0wovF5SSOpTuJu5zc0fJ6+iRRnqJnliR3AIb2qXI9VBU5Wl8 DokSbJVt4hAfWu9fPINs15xiKRyITt1j8aT/8APnrtS9xlOMVRnz+sK4uzEVyxDbmCsl L1eMEnNqwJe5V84P7Iviwvwy/dl//IeHoG5xtzphX+8gQ4tF0y4zJWiy3tHVK7cAyQce t2HmEHyPO6D54PYUM5BeB93ZIYNTjxMse/mJZRfoO5tMhyltQpKV4j48j8LS1YLKLaPP sEEA== X-Gm-Message-State: AOAM530Fitqwc90srxxr52vK+vXTSjqCYOnZf8knS5sfMKfbjU+PD2F+ op1kFMW9uGIDNdTQPF8/Z1/DdA== X-Received: by 2002:a17:90a:db0f:: with SMTP id g15mr715025pjv.8.1590620160180; Wed, 27 May 2020 15:56:00 -0700 (PDT) Received: from cisco ([2001:420:c0c8:1003::948]) by smtp.gmail.com with ESMTPSA id q4sm3048352pfu.42.2020.05.27.15.55.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2020 15:55:59 -0700 (PDT) Date: Wed, 27 May 2020 16:56:00 -0600 From: Tycho Andersen To: Kees Cook Cc: Christian Brauner , linux-kernel@vger.kernel.org, Andy Lutomirski , Matt Denton , Sargun Dhillon , Jann Horn , Chris Palmer , Aleksa Sarai , Robert Sesek , Jeffrey Vander Stoep , Linux Containers Subject: Re: [PATCH 1/2] seccomp: notify user trap about unused filter Message-ID: <20200527225600.GF4153131@cisco> References: <20200527111902.163213-1-christian.brauner@ubuntu.com> <202005271408.58F806514@keescook> <20200527215203.GE4153131@cisco> <202005271457.CF4BBB47@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202005271457.CF4BBB47@keescook> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 27, 2020 at 03:36:09PM -0700, Kees Cook wrote: > On Wed, May 27, 2020 at 03:52:03PM -0600, Tycho Andersen wrote: > > On Wed, May 27, 2020 at 02:43:49PM -0700, Kees Cook wrote: > > > (While I'm here -- why can there be only one listener per task? The > > > notifications are filter-specific, not task-specific?) > > > > Not sure what you mean here? > > tatic struct file *init_listener(struct seccomp_filter *filter) > { > struct file *ret = ERR_PTR(-EBUSY); > struct seccomp_filter *cur; > > for (cur = current->seccomp.filter; cur; cur = cur->prev) { > if (cur->notif) > goto out; > } > > ... > > /* Installing a second listener in the chain should EBUSY */ > EXPECT_EQ(user_trap_syscall(__NR_getpid, > SECCOMP_FILTER_FLAG_NEW_LISTENER), > -1); > EXPECT_EQ(errno, EBUSY); > > > Why does this limit exist? Since the fd is tied to a specific filter, > I don't see conflicts about having multiple USER_NOTIF filters on one > task -- the monitor's response will either fake it or continue it, so > there is no "composition" needed? I must be missing something. It exists because Andy asked for it :) I agree that there's no technical reason for it to be there. I think it's just that the semantics were potentially confusing, and it wasn't a requirement anyone had to have multiples attached. Tycho