Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp49039ybm; Wed, 27 May 2020 18:55:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzvgm/eJ19kLAxBDyHHdoUu9jYB/kzOSYRTmp9l3L8bFozgU6U2tX97zzPIO0+9qhvdioa X-Received: by 2002:aa7:cd4e:: with SMTP id v14mr835229edw.297.1590630942593; Wed, 27 May 2020 18:55:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590630942; cv=none; d=google.com; s=arc-20160816; b=uNCkjnOlRKyorg4SdSZZ8DgpgYnxLa32E/Q89Q3txj/ktjB1cw80G+v2M5KVGRx9Xc GUKg4LVz21GacamXB75Hbv4rwAo+NgrvNZ7V9UP3yxUbXK385InQLCchdRQggil+tLUR 4GUqph8jicTZiaQ5iWASiUOh7XFWoaPx8nYTl0lD+UrQ49zywLKRjTZfGRubFcRUPhLA L65AQHMDgHpDKVCYHsfNg3rCHYjnZj2SZBEStobR3RgSXHpAOsHj1TLz88gl+3hHpUSa 7hZyW5FNZL0lPnkAzTgSKCUrYNDQCJ1OtoOPTQL9LFCxtHjSTiMLm66klsNU/JcQQNDO btcw== 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=foNaBO5M0gttX4Deanmv+4MV7YTgTH1Dw1Ba0mJEKI0=; b=YhnG9fv9EzYoViylpgqTjFECrnH/dF5t56jMI5kJlZEK9Aub0Sq5Lo0IvPkFrPA3vs 5UNsF2A+e1HlLtgzmv35Pk0peWt/P2qtv1c9tkhe2Bf/ORAvQXmCfNsxk4JjPJLiJGfr 3LcnqtBTu0rihmnbFzQFv6z1wqmdy4SBsRwt1Kb0tqw3agqy52X5XeF7NNsQpwSUpieu vpfweTMe9NF8NSxnZZ+55t7gCrx78dZXnm241iU9/9O7cJ8UrmLejJYQ5BPKpm908wHu pmuh9uSIc9S6Op960BK26N38hy7ha3K8wbTC9G6AfrfUsuGxBdrIaTS9m6FIuSVxsD1s ETgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=TEUWhQ66; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n24si2719667ejd.648.2020.05.27.18.55.15; Wed, 27 May 2020 18:55:42 -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=@chromium.org header.s=google header.b=TEUWhQ66; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726718AbgE1Bu7 (ORCPT + 99 others); Wed, 27 May 2020 21:50:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725294AbgE1Bu7 (ORCPT ); Wed, 27 May 2020 21:50:59 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B0C8C05BD1E for ; Wed, 27 May 2020 18:50:59 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id z64so8179326pfb.1 for ; Wed, 27 May 2020 18:50:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=foNaBO5M0gttX4Deanmv+4MV7YTgTH1Dw1Ba0mJEKI0=; b=TEUWhQ66EouoTP5oSr4b2i8yoee/soXAhlKcpyhLTdH3zwczQQljamxh19Q/EO8Z7R wtFS863YLckwd3vINecEHk21qkGl7hT/irUImImnwJNynasmUBmPojoiJL0m9zHLzhYT XM3QwJCFCSS3Mu6CKkyteS14OQ2dYGFUuhBXM= 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=foNaBO5M0gttX4Deanmv+4MV7YTgTH1Dw1Ba0mJEKI0=; b=tR5Fq6FiI1J+9TBvxwNc73VCwpSHvWrPuMuRcr0qTNVvVcfaExqrulTynHqqDNvWO6 ENX/FZf175MVmbZsR8bvwid8buGUgHJLKORQQnekWD1rZvSk0xhyhSHAAxdJkeTpqAZ7 DXVUBWaxO7CcSznQCLxpcNYPvaJicxl6efwszlkti1m2fl+USi5iRRJIv7q3iTRfmS7h fS6XVi9BVPe5IMX24xf8RStHyqlEuzTbDUjHN6npyYpl47VmtDTKn80mVkbDDob8edzQ AzuDJesxUXN7bTGP0MFupOH/NdQOErww4ci0Qp+1bBYsIVf5QspVW9eQFCHVqNKfSEpj i9Tw== X-Gm-Message-State: AOAM531o+5cJ+gJCWbohOBYG3bzmgOl9+kDqhQ0aq7XDkxqAvq4UjO39 kN2vXt3hz2hFILVqYgf5N5+nDg== X-Received: by 2002:a63:4504:: with SMTP id s4mr593083pga.175.1590630658485; Wed, 27 May 2020 18:50:58 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id b74sm2984800pga.31.2020.05.27.18.50.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2020 18:50:57 -0700 (PDT) Date: Wed, 27 May 2020 18:50:56 -0700 From: Kees Cook To: Tycho Andersen 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: <202005271849.F34CE6A@keescook> References: <20200527111902.163213-1-christian.brauner@ubuntu.com> <202005271408.58F806514@keescook> <20200527215203.GE4153131@cisco> <202005271457.CF4BBB47@keescook> <20200527225600.GF4153131@cisco> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200527225600.GF4153131@cisco> 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 04:56:00PM -0600, Tycho Andersen wrote: > 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. Okay, sounds good. It just seems seccomp continues to grow "layers", so I'm eyeing this aspect of user_notif. i.e. what if systemd decides to add a user_notif for something and now suddenly the containers can't use it. Or if some complex thing inside a container tries to use user_notif and it can't because the container manager is doing it, etc. Future work! :) -- Kees Cook