mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] regmap: REGMAP_KUNIT must not select REGMAP
@ 2023-04-26 11:56 Geert Uytterhoeven
  2023-04-26 12:42 ` Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Geert Uytterhoeven @ 2023-04-26 11:56 UTC (permalink / raw)
  To: Mark Brown, David Gow, Brendan Higgins
  Cc: Greg Kroah-Hartman, Rafael J . Wysocki, linux-kselftest,
	kunit-dev, linux-kernel, Geert Uytterhoeven

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(-)

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
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] regmap: REGMAP_KUNIT must not select REGMAP
  2023-04-26 11:56 [PATCH] regmap: REGMAP_KUNIT must not select REGMAP Geert Uytterhoeven
@ 2023-04-26 12:42 ` Mark Brown
  2023-04-26 13:34   ` Geert Uytterhoeven
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2023-04-26 12:42 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: David Gow, Brendan Higgins, Greg Kroah-Hartman,
	Rafael J . Wysocki, linux-kselftest, kunit-dev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 815 bytes --]

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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] regmap: REGMAP_KUNIT must not select REGMAP
  2023-04-26 12:42 ` Mark Brown
@ 2023-04-26 13:34   ` Geert Uytterhoeven
  0 siblings, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2023-04-26 13:34 UTC (permalink / raw)
  To: Mark Brown
  Cc: David Gow, Brendan Higgins, Greg Kroah-Hartman,
	Rafael J . Wysocki, linux-kselftest, kunit-dev, linux-kernel

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

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-04-26 13:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-26 11:56 [PATCH] regmap: REGMAP_KUNIT must not select REGMAP Geert Uytterhoeven
2023-04-26 12:42 ` Mark Brown
2023-04-26 13:34   ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®