Re: [PATCH RFC v10 22/22] mm: Add basic tests for kpkeys_hardened_pgtables

From: Mark Brown

Date: Wed Nov 11 2026 - 11:22:26 EST


On Wed, Nov 11, 2026 at 04:29:02PM +0100, Kevin Brodsky wrote:
> On 10/11/2026 12:24, Mark Brown wrote:
> > On Tue, Nov 10, 2026 at 10:01:36AM +0100, Kevin Brodsky wrote:

> >> Do you mean adding the dependency KPKEYS_HARDENED_PGTABLES=y to

> > Yes, or something like that - unfortunately KUnit checks to see if the
> > config options appear in the configuration so something that vanishes on
> > other architectures causes issues.

> Alright, I guess there's not much we can do then, short of creating
> arch-specific fragments.

Or my suggestion below, or come up with some generic option that could
always be there and would in turn select hardening things. There's
probably a case for having something given that the hardening features
will tend to catch some kinds of test error but that feels more config
fragment like. Another idea would be to teach KUnit about the idea that
it should try turning on some config options but not worry if they're
not selected.

> > Perhaps the default for the config
> > option ought to depend on KUNIT_ALL_TESTS?

> Not sure I'm following, the config already has default KUNIT_ALL_TESTS?

The config for the test does, but KPKEYS_HARDENED_PGTABLES which the
test depends on does not so unless the underlying defconfig turns that
on the test won't be enabled. I was suggesting also adding a default
for testing.

Attachment: signature.asc
Description: PGP signature