Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4759415iob; Mon, 9 May 2022 00:30:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJ+YyxXwLb2fdFZQN2qWwgLrcr71qQnQCcbdP0u0fpIAuBZiMx1OGzH+vyBve5S4lni8nj X-Received: by 2002:a62:15d1:0:b0:50d:3db1:babd with SMTP id 200-20020a6215d1000000b0050d3db1babdmr14890935pfv.19.1652081432678; Mon, 09 May 2022 00:30:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652081432; cv=none; d=google.com; s=arc-20160816; b=jM03JC4BGsz2FFiJ2m1XsqNQbLiAxOIHaMMVxiVtkpZyvnUxUgWRC1jzQW3IbClRH7 eh2R9L6j8xfJTByc0quwiiSTU1L3zv+PSBb5Z4gHWd3CpB52bncQ1uNkLGOenKGWmK5g 11Q2w9QR0EGhgf2Vnln0Nj4X50O2AdaLDhiNOorGXiPzXNMXvJBzjfH9oHA4T+MVzxxF AL7m0gP5qCSTCOf7GoISzRhYI4VmNV5Do3WoYJXo+0sJZ/o+AwYpCLPwdFmz2MeKzWtj jJmEch1ezUi8baXwaM8ap44IzzsigBUFnUKIMufMadbhxYqsHgpYVUX/aANyk5BuWnZ3 A9eQ== 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=0RNEm5+NEN7w925eokqd3iQQhIS/p5lgAQiqOzj0AqU=; b=ly046vcYasSIjwmmiEMYyk3mkIriubT8133BK69uAxmyQCYIYxm/dWBBbL4NKnS6Aj 8vQ2JdSpvfeE+ScqvCdFFO4H2mBRp9LRAhknrOjkq6bWQFBvSV3lngFlTT5chjts6yox kq2pcIFWj8/OVUQ4P/huHfDCuW4Pm2k0aTJbVtWdox6HxLlvsGJt1/zlGkhly7mSthXw hglkHYDxRDTtcxOG4ScQ654yTkAU1xxTU01V6tBCaVwLtkdVGxpJR3DD/w6cvxaowvNT Ds4uwDg58ihEY2tTktqRK9civdFWAZ0z+bzPPDbk9gSS29nHk8PFS6G53rYMepSZVjnF 2FGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=bpPQHauP; 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 z19-20020aa791d3000000b0050a73701075si12534565pfa.159.2022.05.09.00.30.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 00:30:32 -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=bpPQHauP; 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 F39BE8DDC9; Mon, 9 May 2022 00:26:02 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243969AbiEEGAt (ORCPT + 99 others); Thu, 5 May 2022 02:00:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230024AbiEEGAq (ORCPT ); Thu, 5 May 2022 02:00:46 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 495F629C86; Wed, 4 May 2022 22:57:07 -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=0RNEm5+NEN7w925eokqd3iQQhIS/p5lgAQiqOzj0AqU=; b=bpPQHauP0GZlNt0nhaYRYMQd3o CKwArj2r5bWsVVV9QTcAiG640anvOGmiyynASSWVxl3B6LE3yjbdxrni2KF08ELfEiIU9p+fd2jhQ 1uNxD6vkdcF0lNf9uZnIqkV41MItkS79TmI1DpdTe91eW9whq3bJiO84G7oWQhAaerHBwaouRZ0PW A3N/Ebz6NiCFh77/rTSM+cA1+fXt6IYH7WR2bKL6ingkU6mjQs3ayUmt2/uSOtxjx5GQTLFKr1jIv KJjHmEbxT1y81iSSe7ucdPTSF8sYqHUp4rFia8UxOMbMcSQVx+gFtsN2noS6D3Tw1B6bRT50i3mPS Pnh6VbXA==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmUU0-00E7Vg-Tl; Thu, 05 May 2022 05:57:00 +0000 Date: Wed, 4 May 2022 22:57:00 -0700 From: Luis Chamberlain To: Daniel Latypov , Shuah Khan Cc: David Gow , Lucas De Marchi , Aaron Tomlin , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, Brendan Higgins , Andy Shevchenko , Jonathan Corbet , Andrew Morton , Kees Cook , Greg KH , "Guilherme G . Piccoli" , Sebastian Reichel , John Ogness , Joe Fradley , 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 Wed, May 04, 2022 at 02:12:30PM -0700, Luis Chamberlain wrote: > On Wed, May 04, 2022 at 02:19:59PM -0500, Daniel Latypov wrote: > > On Wed, May 4, 2022 at 1:46 PM Luis Chamberlain wrote: > > > OK so, we can just skip tainting considerations for selftests which > > > don't use modules for now. There may be selftests which do wonky > > > things in userspace but indeed I agree the userspace taint would > > > be better for those but I don't think it may be worth bother > > > worrying about those at this point in time. > > > > > > But my point in that sharing a taint between kunit / selftests modules > > > does make sense and is easily possible. The unfortunate aspect is just > > > > Yes, I 100% agree that we should share a taint for kernelspace testing > > from both kunit/kselftest. > > Someone running the system won't care what framework was used. > > OK do you mind doing the nasty work of manually adding the new > MODULE_TAINT() to the selftests as part of your effort? > > *Alternatively*, if we *moved* all sefltests modules to a new > lib/debug/selftests/ directory or something like that then t would > seem modpost *could* add the taint flag automagically for us without > having to edit or require it on new drivers. We have similar type of > taint for staging, see add_staging_flag(). > > I would *highly* prefer this approach, event though it is more work, > because I think this is a step we should take anyway. > > However, I just checked modules on lib/ and well, some of them are > already in their own directory, like lib/math/test_div64.c. So not > sure, maybe just move a few modules which are just in lib/*.c for now > and then just sprinkle the MODULE_TAINT() to the others? I *think* we could just pull this off with a much easier approach, simply looking for the substrings in the module name in modpost.c: * "_test." || "-test." * ^"test_" || ^"test-" An issue with this of course is a vendor $FOO with an out of tree test driver may end up with the taint. Perhaps we don't care. That means moving selftests to its own directory is not needed at this point in time. Luis