Message ID | a89cb0eae953f534011d3a655fa70feb01fb2b73.1682510075.git.geert@linux-m68k.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp200825vqo; Wed, 26 Apr 2023 05:25:46 -0700 (PDT) X-Google-Smtp-Source: AKy350YBuj7uT4MO3ELwdDuUoYN2zIwbmY4ZY/WvZWhmIke9D82Aot2gvhMJpPfsgZbNA+RCzls3 X-Received: by 2002:a05:6a20:ad89:b0:de:526b:f292 with SMTP id dd9-20020a056a20ad8900b000de526bf292mr23044954pzb.19.1682511946472; Wed, 26 Apr 2023 05:25:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682511946; cv=none; d=google.com; s=arc-20160816; b=ToTdFD6nUxHF1P7YfQ4FLHMnMCrtiGliMR2uf8/dwpdnEbEI8rO+t3SOQA6RRSvYHI RBrxpXpGcbGTBNJMX0ejRinNJXMCxZUHy2QPliB6ia+GOhH0Ha3zIfoJ7CoyWohspiZk frB4RQRi7y74hsXr1oAJsXYxPzQwTwapVHb18PIq6oifGzwO3iPW9+u9yvYypOQ8lbpQ dZ9ipm4Zl4+jbZzoBZEarVJbOXfN2aCUUMP9ovlzaRdZ/CRbcR1EM3PwgZnIE2r4QlOW mnvRN58pHa1IGsz+9+DBtyH8PoFbO7oZk18Uj5t8ER7Ae750byNsKhB1Xyiz+3mgMAjk Nsaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=+8SlqLjU1XeNkltU6SwvDnR7X67Xp8/uUbZfY5LB80E=; b=JXsQfY8+6dYMtJlKpxhGJV9AH+dR6v9edVFahDI+k85rLjKMckKLgHpf52i0RUU/nD uge8kBC/PSg0v7tOQ81pJ2Y9pKFyUpCLXsZ5MBUCo/vgDxQo4oKFVPtXkjb5XUcw1ET6 yneTb9ft47R85mqG9owLmVjY+OMRt1HGSWWmLE7lkqheKlSLSivvxpPRfP9qoKX+F4hX LYykMR+78D3Uk7UrVnTthHS48C34VuIDx7WZaKkHNTB7WaEijznOk0LsMVKcHqAJvJZY i+N44EqMowFCL+kOoGr497QnmjxYydrDPBYgG6gUE2ruNywj95hhklbFEy2rZg8d74ps XkSw== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a7-20020a624d07000000b00627e8781dbfsi16009047pfb.266.2023.04.26.05.25.32; Wed, 26 Apr 2023 05:25:46 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240727AbjDZMBO (ORCPT <rfc822;zxc52fgh@gmail.com> + 99 others); Wed, 26 Apr 2023 08:01:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240555AbjDZMBL (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 26 Apr 2023 08:01:11 -0400 Received: from michel.telenet-ops.be (michel.telenet-ops.be [IPv6:2a02:1800:110:4::f00:18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 683044EC0 for <linux-kernel@vger.kernel.org>; Wed, 26 Apr 2023 05:01:10 -0700 (PDT) Received: from ramsan.of.borg ([84.195.187.55]) by michel.telenet-ops.be with bizsmtp id pQ18290091C8whw06Q18Q8; Wed, 26 Apr 2023 14:01:08 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from <geert@linux-m68k.org>) id 1prdlL-000VzI-W4; Wed, 26 Apr 2023 13:56:46 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from <geert@linux-m68k.org>) id 1prdlO-0001kr-2K; Wed, 26 Apr 2023 13:56:46 +0200 From: Geert Uytterhoeven <geert@linux-m68k.org> To: Mark Brown <broonie@kernel.org>, David Gow <davidgow@google.com>, Brendan Higgins <brendanhiggins@google.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, "Rafael J . Wysocki" <rafael@kernel.org>, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, Geert Uytterhoeven <geert@linux-m68k.org> Subject: [PATCH] regmap: REGMAP_KUNIT must not select REGMAP Date: Wed, 26 Apr 2023 13:56:44 +0200 Message-Id: <a89cb0eae953f534011d3a655fa70feb01fb2b73.1682510075.git.geert@linux-m68k.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764241646682435781?= X-GMAIL-MSGID: =?utf-8?q?1764241646682435781?= |
Series |
regmap: REGMAP_KUNIT must not select REGMAP
|
|
Commit Message
Geert Uytterhoeven
April 26, 2023, 11:56 a.m. UTC
Enabling a (modular) test must not silently enable additional kernel
functionality, as that may increase the attack vector of a product.
Fix this by making REGMAP_KUNIT depend on REGMAP instead.
Fixes: 2238959b6ad27040 ("regmap: Add some basic kunit tests")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/base/regmap/Kconfig | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Comments
On Wed, Apr 26, 2023 at 01:56:44PM +0200, Geert Uytterhoeven wrote: > Enabling a (modular) test must not silently enable additional kernel > functionality, as that may increase the attack vector of a product. > > Fix this by making REGMAP_KUNIT depend on REGMAP instead. This doesn't work since regmap is a selected library so there's no way to directly enable regmap other than by enabling something that uses it and it is very likely that the virtual configurations people often use with KUnit will not have any physical hardware and therefore will not need regmap. It seems a lot more likely that someone would want to run the tests on a platform that doesn't otherwise use regmap than that someone would end up building in regmap on a production kernel that wouldn't otherwise have enabled it.
Hi Mark, On Wed, Apr 26, 2023 at 2:42 PM Mark Brown <broonie@kernel.org> wrote: > On Wed, Apr 26, 2023 at 01:56:44PM +0200, Geert Uytterhoeven wrote: > > Enabling a (modular) test must not silently enable additional kernel > > functionality, as that may increase the attack vector of a product. > > > > Fix this by making REGMAP_KUNIT depend on REGMAP instead. > > This doesn't work since regmap is a selected library so there's no way > to directly enable regmap other than by enabling something that uses it > and it is very likely that the virtual configurations people often use > with KUnit will not have any physical hardware and therefore will not > need regmap. It seems a lot more likely that someone would want to run > the tests on a platform that doesn't otherwise use regmap than that > someone would end up building in regmap on a production kernel that > wouldn't otherwise have enabled it. Thanks, I had missed that. Will send a v2... Gr{oetje,eeting}s, Geert
diff --git a/drivers/base/regmap/Kconfig b/drivers/base/regmap/Kconfig index 33a8366e22a584a5..20327c15cbce5d8c 100644 --- a/drivers/base/regmap/Kconfig +++ b/drivers/base/regmap/Kconfig @@ -11,9 +11,8 @@ config REGMAP config REGMAP_KUNIT tristate "KUnit tests for regmap" - depends on KUNIT + depends on KUNIT && REGMAP default KUNIT_ALL_TESTS - select REGMAP select REGMAP_RAM config REGMAP_AC97