Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp907752ybt; Fri, 10 Jul 2020 15:53:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwioF4fkoprNaezm2l/RCZWxvx7nmbUDABKUo/jfoW7mHGwgemdxPVlcZfVu/jAzPS0UuLg X-Received: by 2002:a17:906:70d5:: with SMTP id g21mr44836422ejk.340.1594421594770; Fri, 10 Jul 2020 15:53:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594421594; cv=none; d=google.com; s=arc-20160816; b=f5sMwE+AWnFmt9R1Skr7Xl84xUNI9bqmSFgvVWhvL0Zm1+lGHVYO+Cpk7kNBSuXuo/ pXqSwmL2oM/oz33t3B5fffWOqkNqVlEsErFioXs1b/LvP/mHPeclZsR51Le2p5kBnZPs ummW8CfUJilSLqO2rf8VyP0Yb5uZWXh6l/mOMFmxOMyvwkRYSY6I1WTmty+F6etLq6xt hL1/yiYMnDFJgd9K3uYeF0MsPM25sbvEftdayAveQU/CyY3AMPxAeRFLF62YggEzoQov YFxRd1imvoFZ5/E/kX4rApHscBa2uPY3CxzkXYWeqyzK166Emf2HtrIoZJFc9CvGlRv8 uw3g== 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=gX6YgcMfSykw3J9R6ZTzJu/j6sgShmyRfXIsXkOHBlY=; b=f49Z5srbH63fVIRlezUllEEhPBop7mDB/maq16GDAcX7vUXoG6cN524l8mFagXRQxl C5Wq+DEFPhDnztIpGJYFrpSL0AFSJerxyjsfpNlRnyMs6mkDQggdvA2lwPYb4eUyhl34 t946EkyjZ+4D6QGFvASuJxKSIy6xm3YSMtT0HF0VlXJgaY1f1djUFERFLZqBx/6P3UEM FPcA5bwZO/HzpSb3OstM9iZeiRUOk250hTFQsrX5BRyxE3q2xIG9LJUY8hflZxo4IEVt oPvwofVETRLKajBF1XD8/PajXEFjl0vYk4Y9aFeJ0yGffxpFNoAM1H0IJJ74cS70G9AG gbxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=FjiqjH9k; 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 a66si5977835edf.398.2020.07.10.15.52.50; Fri, 10 Jul 2020 15:53:14 -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=FjiqjH9k; 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 S1726523AbgGJWwl (ORCPT + 99 others); Fri, 10 Jul 2020 18:52:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726262AbgGJWwl (ORCPT ); Fri, 10 Jul 2020 18:52:41 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 814D7C08C5DC for ; Fri, 10 Jul 2020 15:52:41 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id x8so2830753plm.10 for ; Fri, 10 Jul 2020 15:52:41 -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=gX6YgcMfSykw3J9R6ZTzJu/j6sgShmyRfXIsXkOHBlY=; b=FjiqjH9k77nNIvYx9JltNxNXqW1sklSIL+l3o/ZEJWxqMRU22TIW5BUVRtBVPVWYO0 ZpIEamJ/+0PlfnjjMLwhgX+EGHduhPTT4EawVUVRNNpCyc4jGxS7RiaXGoEHef8Xwbqn cSDqyCEeHG6PNgkWHan8+RKDP6XgPY2cGnGGI= 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=gX6YgcMfSykw3J9R6ZTzJu/j6sgShmyRfXIsXkOHBlY=; b=e6QTtxWcq0R+KJWcv/o7AlYOLTT/8crYZSgP/s0aFi9wzTmljviRLWN2YK65GfNLsi WykkkkSqIpXuCbs5b5RQ9EJCuRwW65nPuxTrx6zIWzEjjNb6AzoF2gGzukKuuCssalSb NBOooTrn0JmBckylopP9Y++/S35eCAOAO9BOs4M+PE6FUNQEM89vlsdR681d3ULzM48F wOC8Y8MfqpljP7A98Qa2HBPZ2tveyOxhUcb3a5ER985vhc78Ldq88KtZ+8i+0W7ZLXZt EjmYUKzzGF1OHByNG2OuoQE57qdXY6pq2R0Lvy4g+Zo8bJA1a9cLZRPpuMhAZ3tJrU4D GTfQ== X-Gm-Message-State: AOAM531hTo37T2NnzWS960HHBr4ytX/MacL85hi0LP/1rCxHXB2ifSCO TO/29rgihoZtKPcoRJk2dVxsZg== X-Received: by 2002:a17:902:6b87:: with SMTP id p7mr56254761plk.275.1594421561099; Fri, 10 Jul 2020 15:52:41 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id f207sm7340205pfa.107.2020.07.10.15.52.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2020 15:52:39 -0700 (PDT) Date: Fri, 10 Jul 2020 15:52:38 -0700 From: Kees Cook To: Tycho Andersen Cc: Will Deacon , linux-kernel@vger.kernel.org Subject: Re: [PATCH for-next/seccomp 1/2] selftests/seccomp: Add SKIPs for failed unshare() Message-ID: <202007101551.E001F7B1CE@keescook> References: <20200710185156.2437687-1-keescook@chromium.org> <20200710185156.2437687-2-keescook@chromium.org> <20200710191023.GA2700617@cisco> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200710191023.GA2700617@cisco> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 10, 2020 at 01:10:23PM -0600, Tycho Andersen wrote: > On Fri, Jul 10, 2020 at 11:51:55AM -0700, Kees Cook wrote: > > Running the seccomp tests as a regular user shouldn't just fail tests > > that require CAP_SYS_ADMIN (for getting a PID namespace). Instead, > > detect those cases and SKIP them. > > But if we unshare NEWUSER at the same time as NEWPID, shouldn't we > always be ns_capable(CAP_SYS_ADMIN)? Oh! Yes, you're quite right. :) Instead I guess I should actually check for EINVAL if CONFIG_USER_NS is missing. -- Kees Cook