From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79B24C433DF for ; Tue, 16 Jun 2020 16:04:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4DE91207C4 for ; Tue, 16 Jun 2020 16:04:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="OllvnLop" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731719AbgFPQD7 (ORCPT ); Tue, 16 Jun 2020 12:03:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733055AbgFPQDy (ORCPT ); Tue, 16 Jun 2020 12:03:54 -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 F1E99C0613ED for ; Tue, 16 Jun 2020 09:03:53 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id y17so8587865plb.8 for ; Tue, 16 Jun 2020 09:03:53 -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=zKc/JpLrFA5C9B00OW//vjJ8ZMv5QimUc3F5i8rvet4=; b=OllvnLopOjSAVN/rCkHGWJ500Le3/6Ku5c3o8ZlC+gP2RzGDWdyhUX0XwzoK6KZlXi oVUvlUOsEvATG+ldK1KcrhLOS061oY8IpfnuZkqmEEiYnuh+gmbZps73C0AZ9cOBaHq1 exTGM1g9ghl69TYphlzSAJ8R2IcP6MK/Wv63w= 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=zKc/JpLrFA5C9B00OW//vjJ8ZMv5QimUc3F5i8rvet4=; b=HTNXbODKteyk6zSe0J9UP1fUnns/OdrzSwU0eBGQQO7FeXgVHr9vP5YW0wY+gEo7+H Z54fF3CG8SVdpOUPMQKa9HKkHbwe7q7JRldj6Kd/f3PZ9/tWgGxZLLlfAyGgAZ2FW0J7 ZsnkJaWkS+OPtjCOPJVornV6/Ot2qeKo8fSM8jh46lsPA16BrTUgG/6DWqDtWcnAGVK/ 6fwSxrMOjNMYUHXVYbE0YZtDcxnF2SdoLnUVVpB4x6f5WY/zfFZK/cKn7km+dsoZaFle /GiGeYHqa9XUEv/rNcaPH8AFabCi9ah6wCf8ANM3M6yOi+KDtQuw69LOXFrjIOkiGaGB tP8w== X-Gm-Message-State: AOAM5331iKcffc397ogdXSRUNw7eBfoOaCN2oLQrBpVylfevbMPL8hJ4 91b+dnyuHPvYLlzlyU86I1wNhw== X-Google-Smtp-Source: ABdhPJwVjALfzLCAM/XOMQlngQM0/cTr6VlDaTe0C2TtJc/aiEyzOtzkrH1NE78arH20bNJ9zx2lfA== X-Received: by 2002:a17:902:e901:: with SMTP id k1mr2665677pld.92.1592323433244; Tue, 16 Jun 2020 09:03:53 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id a14sm17059842pfc.133.2020.06.16.09.03.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 09:03:52 -0700 (PDT) Date: Tue, 16 Jun 2020 09:03:51 -0700 From: Kees Cook To: Tycho Andersen Cc: linux-kernel@vger.kernel.org, Sargun Dhillon , Christian Brauner , "David S. Miller" , Christoph Hellwig , Jakub Kicinski , Alexander Viro , Aleksa Sarai , Matt Denton , Jann Horn , Chris Palmer , Robert Sesek , Giuseppe Scrivano , Greg Kroah-Hartman , Andy Lutomirski , Will Drewry , Shuah Khan , netdev@vger.kernel.org, containers@lists.linux-foundation.org, linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v4 08/11] selftests/seccomp: Make kcmp() less required Message-ID: <202006160902.E331FF1917@keescook> References: <20200616032524.460144-1-keescook@chromium.org> <20200616032524.460144-9-keescook@chromium.org> <20200616145725.GJ2893648@cisco> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200616145725.GJ2893648@cisco> Sender: linux-api-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-api@vger.kernel.org On Tue, Jun 16, 2020 at 08:57:25AM -0600, Tycho Andersen wrote: > On Mon, Jun 15, 2020 at 08:25:21PM -0700, Kees Cook wrote: > > The seccomp tests are a bit noisy without CONFIG_CHECKPOINT_RESTORE (due > > to missing the kcmp() syscall). The seccomp tests are more accurate with > > kcmp(), but it's not strictly required. Refactor the tests to use > > alternatives (comparing fd numbers), and provide a central test for > > kcmp() so there is a single XFAIL instead of many. Continue to produce > > warnings for the other tests, though. > > > > Additionally adds some more bad flag EINVAL tests to the addfd selftest. > > > > Signed-off-by: Kees Cook > > This looks fine, but I wonder if this is enough motivation for taking > kcmp() out of CONFIG_CHECKPOINT_RESTORE guards? Do you mean in the kernel? I'd rather not -- it's a relatively powerful primitive. Maybe if there were other users needing it, but there doesn't seem to have been much demand. -- Kees Cook