[LTP] [PATCH 1/1] keyctl30: Check module is presented before loading
Petr Vorel
pvorel@suse.cz
Tue Sep 22 13:29:16 CEST 2026
> Hi!
> > This fixes test on the system without module:
> > modprobe: FATAL: Module pkcs8_key_parser not found in directory /usr/lib/modules/6.12.0-160100.5-azure
> > tst_cmd.c:112: TBROK: 'modprobe' exited with a non-zero code 1 at tst_cmd.c:112
> > With the fix it TCONF as expected:
> > tst_module.c:72: TCONF: Failed to find module 'pkcs8_key_parser'
> > Fixes: 1bb448ed9e ("keyctl30: Test KEYCTL_PKEY_QUERY on private key")
> > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > ---
> > FYI Cyril suggested to add into struct config_module_map:
> > {"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).
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
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).
> 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).
> > Although it does not harm this is IMHO just wrong function being used.
> That depends, if we decide to have the checks in the tst_kconfig.c then
> tst_modprobe() is the only function that should be used.
Sure, for distro modules. tst_module_load() is still needed for LTP specific
out-of-tree modules (again, we should teach the agent).
> Also looiks like the primary user of the tst_module_load() are tests
> that build modules in LTP tree, where it does make sense, since these
> may fail to build and be missing and there are no CONFIG_ variables for
> these. The rest of the tests seems to be using tst_modprobe().
Exactly.
Kind regards,
Petr
More information about the ltp
mailing list