[LTP] [PATCH 1/1] keyctl30: Check module is presented before loading

Cyril Hrubis chrubis@suse.cz
Tue Sep 22 14:50:31 CEST 2026


Hi!
> > >  	{"CONFIG_NET_SCH_INGRESS", "sch_ingress"},
> > >  	{"CONFIG_NET_CLS_MATCHALL", "cls_matchall"},
> > >  	{"CONFIG_NET_ACT_PEDIT", "act_pedit"},
> > > +	{"CONFIG_PKCS8_PRIVATE_KEY_PARSER", "pcks8_key_parser"},
> 
> > I think that this is still cleaner, this way we skip the test even
> > before we start running it.
> 
> Yeah, exit early + having it in the metadata is better - feel free to post the
> above as a patch and we refuse this patch.
> 
> After release thinking:
> Thinking it twice having a separate metadata for "direct" module loading was
> good (the functionality we replaced by kconfig). Why? Now we need to
> 1) load module manually in the test
> 2) manual module loading is hidden in metadata behind kernel config (tester see
> that in the test output, but it's not obvious in the metadata).

It's more subtle than this, in most cases kernel actually loads the
module automatically when the functionality is used (e.g. you create a
socket and kernel loads the module with the particular socket support).
The cases where the module needs to be loaded are quite rare. It's never
unloaded though, so maybe we should attempt that too (if it wasn't
loaded and was loaded because of the test).

> Sure, we don't want to revert that whole big patchset. But maybe we could
> consider to
> 1) call tst_module_load() based on config_module_map() instead doing it
> in the test

We can do that, but I would only do so if it's actually needed, so that
the module autoload is tested as well. For that we would probably need
to add a needs_load to the config to module mapping table.

> 2) print this mapping in the metadata (that would require struct config_module_map
> being accessible also by metadata/metaparse.c.
>
> > Maybe we should attempt to auto-generate the
> > table for all CONFIG_* variables used in LTP.
> 
> Sure, that's a good idea. Useful would be some script similar to updating
> sycalls numbers. With the only exception: don't delete old modules (modules can
> be deleted, but still used by supported kernels).

As long as we have complete list of CONFIG_* variables from the tests,
which can be easily extracted from the test, we know which modules we
need mapping for. No need to keep anything that isn't in that set.

> > Also keyctl23.c and keyctl29.c have tst_modprobe("x509_key_parser",
> > NULL); So we need fix/mappping for x509_key_parser too.
> 
> Yeah, I also noted that + cve-2026-46331.c (all Andrea's agent based code,
> we should teach agent about the differences).

There are also tests that do tst_cmd("modprobe", ...) these should be
fixed as well (git grep '"modprobe"').

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list