Received: by 2002:ac0:cd04:0:0:0:0:0 with SMTP id w4csp501256imn; Fri, 1 Jul 2022 22:06:06 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vvSLm69rveNAJs4d/9lm3X+ZxReaLE1nAxepSd73TcLCxlpojxuhCxWvNx1WfuB7NhIeDW X-Received: by 2002:aa7:cd66:0:b0:435:74d5:2d58 with SMTP id ca6-20020aa7cd66000000b0043574d52d58mr23693134edb.34.1656738365993; Fri, 01 Jul 2022 22:06:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656738365; cv=none; d=google.com; s=arc-20160816; b=cMpCCJQ2KXWaFkMIfklKCdPghNVVP5sHqN0s3UC+fV2wRcMfAgOvbrGqhdv3BtbSae DW5whsICE/HpeXw7C6gqusGdqC1lzYwl5yZIURrLLfagltEGO0WD0LsAH3raL4YvbbUb 8F4N695ZHAIETjO6mgD2OKDhytx6MVR55K9WzOFkW0r1z/r86Jd3Cemb3wvf2LK+12he 2kpk+ijk0fcQq7J+qp2/TxfeEsnv7xElCsjC0dTP9c6TzxTFQ0c2DfSvAsdS1SioGqfh pyT0CGsSoWibil4oYw+mIJKtqVtkqZYtraf0EIiMiYTrPgmPcQGzzBjrppV7uaZxwCU2 fWSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=pXg+vZg8j7w9D8rfVozvYVHxyGCA3VQTZKpqo5oZTaQ=; b=Tvmbu/Qjf71qF9NC6WQgM5/ZGR8cHPWkJio0a4AZvAzGVbyE8DUsJ4S70mBFV7+mVf gfBJgzIk1/OcTsrI/ZNX0yfHQDUnoNrIFM1QjBhEZMTa3gGocFqIjjcTQ0S7pB5I9b5b /9UoQyKqZ/zWNAOlR3qYVZ3VvyASCX2kF0MExhwqPzimH+efOdSnT47RVUmVGtutm2q8 dOAQcX0b0uIKiL5rWTqMLmgfzh2zzBcPD0uJWdG8fvhrLnyNpMKjWko0lq1klOSNfswV SRJ+2N2qkZ3ZiKSxYDbLHYJGUyzSoH0BE0QnxRrIR8j4H2/PJosj9/mKOkhBbbS/qs1Q DQlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=j7MIUbH6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds19-20020a170907725300b00722ded3416esi31126967ejc.355.2022.07.01.22.05.29; Fri, 01 Jul 2022 22:06:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=j7MIUbH6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231901AbiGBEp1 (ORCPT + 99 others); Sat, 2 Jul 2022 00:45:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230289AbiGBEp0 (ORCPT ); Sat, 2 Jul 2022 00:45:26 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60804205FB for ; Fri, 1 Jul 2022 21:45:24 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id h14-20020a1ccc0e000000b0039eff745c53so2600392wmb.5 for ; Fri, 01 Jul 2022 21:45:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pXg+vZg8j7w9D8rfVozvYVHxyGCA3VQTZKpqo5oZTaQ=; b=j7MIUbH64+8BgmTtkm5C3MIjzQSjZRtaOg0CjUxbYTfrJ9In5el0z4Bv3GJJjCJ4+P 6aBXGKYzyDc9iJRZav0JGwcQD0GXHzxA8a3q0MwHO3fhr7k33sv8ibioxa6B/yLN8Pva m79GePmaU9MKzg7aV/nUN/eQ1Qtc3alCMfkWdtx4j5BGDM+KUAuJQyrgyw+oPQTd4q0O s1FfyOYUPSOpIHCdrtQMbWUwajnslTcnDgXJFyWnCmKEXCUm6sdIENdlxSdp7EtdoVxT zo5ofZQkj4oUKJ5Ylw5NF/1D9JTRmWkFSq8Jp5se/kPykR0WPb0MkASw2YG3DQNaKN0Q vAiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pXg+vZg8j7w9D8rfVozvYVHxyGCA3VQTZKpqo5oZTaQ=; b=YqAI67th8C9Qifa/vOS/m9kqp/38VO7uuF0pYwYtvDhq+RzRpzPRv78ymYP8bdvuPR Tqg+M7GNttj2BOcbdRDAEt0bGeffX447Wr853jlHJ9qJE1P8WnC7OPsvUoLuu6I9OwV+ S57/cSlF4mtzvWP21L5W8Venv9lRKiZ2kSqyHH0KQyAYIO5LWstBBsknZdxEvj1AMkht fxgPDpxQ9y0bqr6yWsFu1a5IJJqu6yoo33MG5+vghWqgN9mWjteSC8o55n2Jgop08qZQ PjRRQ3pit7h2AtlkuibsDKD4CyEPb0QnOAJ4oBQuYMlD9KMbl+9bwRB4grUm2DPXcfYF X6lQ== X-Gm-Message-State: AJIora/r3qm5OYCVw3DUpOpm/ojEpM4/8+vYOlvUml8+Xai3/OrK1IXp 2cZzWMy7/MiMv2XdXnxQThCaXq1+pJxDSJ6vFBtUuQ== X-Received: by 2002:a05:600c:34ce:b0:3a0:3b4b:9022 with SMTP id d14-20020a05600c34ce00b003a03b4b9022mr20217035wmq.66.1656737122786; Fri, 01 Jul 2022 21:45:22 -0700 (PDT) MIME-Version: 1.0 References: <20220702040959.3232874-1-davidgow@google.com> <20220702040959.3232874-2-davidgow@google.com> In-Reply-To: <20220702040959.3232874-2-davidgow@google.com> From: David Gow Date: Sat, 2 Jul 2022 12:45:11 +0800 Message-ID: Subject: Re: [PATCH v5 2/4] module: panic: Taint the kernel when selftest modules load To: Brendan Higgins , Andy Shevchenko , Jonathan Corbet , Andrew Morton , Kees Cook , Shuah Khan , Greg KH , Luis Chamberlain , Masahiro Yamada Cc: "Guilherme G . Piccoli" , Sebastian Reichel , John Ogness , Joe Fradley , Daniel Latypov , KUnit Development , "open list:KERNEL SELFTEST FRAMEWORK" , "open list:DOCUMENTATION" , Linux Kernel Mailing List , Jani Nikula , Lucas De Marchi , Aaron Tomlin , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, Michal Marek , Nick Desaulniers , Linux Kbuild mailing list Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="000000000000b5485405e2cb2b10" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham 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 --000000000000b5485405e2cb2b10 Content-Type: text/plain; charset="UTF-8" On Sat, Jul 2, 2022 at 12:10 PM David Gow wrote: > > Taint the kernel with TAINT_TEST whenever a test module loads, by adding > a new "TEST" module property, and setting it for all modules in the > tools/testing directory. This property can also be set manually, for > tests which live outside the tools/testing directory with: > MODULE_INFO(test, "Y"); > > Reviewed-by: Luis Chamberlain > Signed-off-by: David Gow > --- I forgot the changelogs here. The only significant difference from v4 is the change from pr_warn() to pr_warn_once(). Changes since v4: https://lore.kernel.org/linux-kselftest/20220701084744.3002019-2-davidgow@google.com/ - Use pr_warn_once() to only log a warning the first time a module taints the kernel with TAINT_TEST - Loading lots of test modules is a common usecase, and this would otherwise spam the logs too much. - Thanks Luis. - Remove a superfluous newline (Thanks Greg) - Add Luis' Reviewed-by tag. This patch was new in v4 of the series. --000000000000b5485405e2cb2b10 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIIPnwYJKoZIhvcNAQcCoIIPkDCCD4wCAQExDzANBglghkgBZQMEAgEFADALBgkqhkiG9w0BBwGg ggz5MIIEtjCCA56gAwIBAgIQeAMYYHb81ngUVR0WyMTzqzANBgkqhkiG9w0BAQsFADBMMSAwHgYD VQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UE AxMKR2xvYmFsU2lnbjAeFw0yMDA3MjgwMDAwMDBaFw0yOTAzMTgwMDAwMDBaMFQxCzAJBgNVBAYT AkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMSowKAYDVQQDEyFHbG9iYWxTaWduIEF0bGFz IFIzIFNNSU1FIENBIDIwMjAwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvLe9xPU9W dpiHLAvX7kFnaFZPuJLey7LYaMO8P/xSngB9IN73mVc7YiLov12Fekdtn5kL8PjmDBEvTYmWsuQS 6VBo3vdlqqXZ0M9eMkjcKqij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