Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp238455iob; Mon, 2 May 2022 18:09:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFOcI7nNn5lt4z1DceV6ZcM7/RRvV8xXHxjnvKEkKFnF3MipUo76ZRO5RgEqFNXgVQ/aId X-Received: by 2002:a17:902:d2d1:b0:15e:9b06:28b3 with SMTP id n17-20020a170902d2d100b0015e9b0628b3mr10111257plc.148.1651540152511; Mon, 02 May 2022 18:09:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651540152; cv=none; d=google.com; s=arc-20160816; b=jqr1+KzyRA4+y5Djtoqkuyprd9bajzDaDF5lBmTUx7DAaX8P8ByeLqE5H3ZE2n9WBn SfEPXJMUyR7ruJQqgvTrkYJD+pgq2bV1oNWIJ6IXgnIQumJuw27pO+ACRZ7NQO1ads0K mIOjD2mAE64SgWU9sTlwx02a3od78QBsDq5FeiWf/BK7rmO67Km9RtNXmf9fi63kQbGF vOTiHGHs8wHrQQRrCJdoZ7UWsqhK/prdw4qWYE284tsy5fyVTHE/bSTfGP3xgZ5wWP/U QPy8gaZsda9DQsIkyigze/vpBi4Q3Fg0F88d3MbE5ono0cRkjmU02Tr+2pkPiM6tkOUM d7Ew== 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=++0tXB8r6fqAoAWO0zn58LBjR0GxZ8Ui8yI9kV7Ql6c=; b=vUNfgzXG9+XKrFR7AsCgv+LyHjdqAAXRLVeKGfJjdXbXdhdVUYSoLZVRC0NfhS6C4G LfxptaqdML1Pki7H5JwkLNbHfa7wf5omXeueIvyLnMgGX4x9SNPpFAJsVSWoK/hQByCF kAEHjc806ncWM4W3MQrFU8mzHmEcVmfY9R4NvWOYf2CL9P3IpJi8fI0D1kHcgWv9jW2z d0rq7Vl4BL97gErSyutE/hL2efS0VFoKF93gsteiO4eI1g47lkgdnZk+AVzedliHYpV0 PwE14cHc0FtOYCTEs/YGrmMvkvvz9xuN23yaXNDlod3djUZqa9chMWGlVkXh90Gz4EZw p8GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=5Bvm25+p; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id j192-20020a638bc9000000b003821d32f04csi15023861pge.116.2022.05.02.18.09.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 18:09:12 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=5Bvm25+p; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 15DCE5A597; Mon, 2 May 2022 17:51:18 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353662AbiEAS2C (ORCPT + 99 others); Sun, 1 May 2022 14:28:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234718AbiEAS16 (ORCPT ); Sun, 1 May 2022 14:27:58 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09E0B56403; Sun, 1 May 2022 11:24:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=++0tXB8r6fqAoAWO0zn58LBjR0GxZ8Ui8yI9kV7Ql6c=; b=5Bvm25+pkmeLL5rMNrxHfplM7s uKg935xXJmaVLLztQS7lAaaumcfTsInHq0U3fp0FT/49AU/iugvoMPp7Ea3qOHNOyCfdpoH3vR0EC f2YSrPcQciYHpVw6Ms4xCNFi3SDZg2dGg3No6LR98z+5DajXjeQlFPOpno0chVBe7ChAk0qntgBFB 6PpCt0ZbB1//y4zNnHabMq4ZeZnWZv29LszwS5klex7qmCWYQJ/hmQULdZRG30COu18Z4lbWo/WIA 73Dfy97TxkjyMZaJeYaYl0NW0lqSv4ZbGKSERZqAsmCARqz+d+ccDFcYoUcux6UOKFd/KOq7BBh+N RJUiABXg==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nlEFA-00Gh9I-PL; Sun, 01 May 2022 18:24:28 +0000 Date: Sun, 1 May 2022 11:24:28 -0700 From: Luis Chamberlain To: David Gow , Shuah Khan , Lucas De Marchi , Aaron Tomlin , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org Cc: Brendan Higgins , Andy Shevchenko , Jonathan Corbet , Andrew Morton , Kees Cook , Greg KH , "Guilherme G . Piccoli" , Sebastian Reichel , John Ogness , Joe Fradley , Daniel Latypov , kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Jani Nikula Subject: Re: [PATCH v2] kunit: Taint kernel if any tests run Message-ID: References: <20220429043913.626647-1-davidgow@google.com> <20220430030019.803481-1-davidgow@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Luis Chamberlain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 01, 2022 at 11:22:38AM -0700, Luis Chamberlain wrote: > On Sat, Apr 30, 2022 at 11:00:19AM +0800, David Gow wrote: > > KUnit tests are not supposed to run on production systems: they may do > > deliberately illegal things to trigger errors, and have security > > implications (assertions will often deliberately leak kernel addresses). > > > > Add a new taint type, TAINT_KUNIT to signal that a KUnit test has been > > run. This will be printed as 'N' (for kuNit, as K, U and T were already > > taken). > > > > This should discourage people from running KUnit tests on production > > systems, and to make it easier to tell if tests have been run > > accidentally (by loading the wrong configuration, etc.) > > > > Signed-off-by: David Gow > > There is no reason to distinguish kunit from selftests if the result is > the same: really make the kernel try really insane stupid things which > may crash it or put it into a bad state. > > So no, this should be renamed to "TEST_BREAK" as I think outside of > selftest and kunit we may grow the kernel to do stupid things outside > of that domain and this gives us the flexilibilty to use that in other > places as well. > > It begs the question if we *should* allow userspace to volunterally say > "hey, we are doing really insane things, brace yourself." Why ? Well > because selftest has tons of modules. We either then define a macro > that adds the taint for them and wrap the module declaration for it, > or we expose a syctl to let userspace volunteer to opt-in to seggest > we are about to try something stupid with the kernel including loading > some dangeerous modules which may not have macros which taint the kernel. > That would let selftest taint on *any* selftest. Because we can run all > selftests or run one selftest. > > Then, if such sysctl is exposed, maybe we should then also use this for > example for blktests, fstests, fio tests, etc. For got to expand to fsdevel and linux-block. Luis