From: linuxtestproject.agent@gmail.com
To: Li Wang <li.wang@linux.dev>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] lib: add module is loaded check
Date: Tue, 3 Nov 2026 10:19:38 +0000 [thread overview]
Message-ID: <20261103101938.4207-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20261103075722.181317-2-li.wang@linux.dev>
Hi Li,
On Mon Apr 13 15:25:17 2026 +0800, Li Wang <liwang@redhat.com> wrote:
> lib: add module is loaded check
--- [PATCH 1/4] ---
> diff --git a/include/tst_module.h b/include/tst_module.h
> index e55321d19..9b789e289 100644
> --- a/include/tst_module.h
> +++ b/include/tst_module.h
> @@ -49,5 +49,6 @@ static inline void tst_requires_module_signature_disabled(void)
>
> void tst_modprobe(const char *mod_name, char *const argv[]);
> void tst_module_reload(const char *mod_name, char *const argv[]);
> +bool tst_module_is_loaded(const char *mod_name);
New public library functions in include/ should have a kernel-doc
(/** ... */) comment describing @mod_name and Return:.
--- [PATCH 3/4] ---
> diff --git a/testcases/cve/cve-2025-21756.c b/testcases/cve/cve-2025-21756.c
> index 4245a4c95..b49950045 100644
> --- a/testcases/cve/cve-2025-21756.c
> +++ b/testcases/cve/cve-2025-21756.c
> @@ -85,8 +95,15 @@ static void run(void)
> }
>
> static struct tst_test test = {
> + .needs_root = 1,
> + .setup = setup,
The reason .needs_root = 1 is required (loading the vsock and
vsock_loopback modules before dropping privileges in setup()) should also
be documented in the test's /*\ ... */ doc comment.
--- [PATCH 4/4] ---
> diff --git a/testcases/kernel/syscalls/keyctl/keyctl23.c b/testcases/kernel/syscalls/keyctl/keyctl23.c
> index cf90210d2..adfb1197a 100644
> --- a/testcases/kernel/syscalls/keyctl/keyctl23.c
> +++ b/testcases/kernel/syscalls/keyctl/keyctl23.c
> @@ -6,7 +6,8 @@
> /*\
> * Test ``KEYCTL_RESTRICT_KEYRING`` builtin_trusted of :manpage:`keyctl(2)`.
> *
> - * Requires root (CAP_SYS_MODULE) to load the ``x509_key_parser`` module.
> + * Requires root (CAP_SYS_MODULE) so that the test library can load the
> + * ``x509_key_parser`` module.
> *
> * [Algorithm]
> *
> @@ -89,8 +89,6 @@ static void setup(void)
> {
> SAFE_KEYCTL(KEYCTL_JOIN_SESSION_KEYRING, 0, 0, 0, 0);
>
> - tst_modprobe("x509_key_parser", NULL);
> -
> ring_builtin = SAFE_NEW_RING("ltpkeyctl23_builtin");
keyctl23.c still has "CONFIG_X509_CERTIFICATE_PARSER=y" in .needs_kconfigs
instead of "CONFIG_X509_CERTIFICATE_PARSER", so tst_kconfig_check() aborts
with TCONF when the option is =m before tst_kconfig_module_load() is
called, and never loads a module when it is =y. Drop =y from
"CONFIG_X509_CERTIFICATE_PARSER=y" in .needs_kconfigs (matching keyctl29.c)
so CONFIG_X509_CERTIFICATE_PARSER=m is accepted and x509_key_parser is
loaded automatically.
Verdict - Needs revision
Pre-existing issues:
- testcases/cve/sctphantom.c: the doc comment at lines 46-48 still says the
test reports TCONF if the sctp module is not loaded ("run modprobe sctp
first"), and the sysctls saved via tst_sys_conf_save() in setup() could
now use .save_restore in struct tst_test since do_setup() loads the module
before .save_restore and do_cleanup() unloads it after
tst_sys_conf_restore().
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-11-03 10:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 7:57 [LTP] [PATCH v7 0/4] tst_kconfig: automatic module load/unload for CONFIG_*=m Li Wang (Hieco)
2026-11-03 7:57 ` [LTP] [PATCH v7 1/4] lib: add module is loaded check Li Wang (Hieco)
2026-11-03 10:19 ` linuxtestproject.agent [this message]
2026-11-06 12:42 ` Cyril Hrubis
2026-11-03 7:57 ` [LTP] [PATCH v7 2/4] tst_kconfig: load and unload kernel modules for CONFIG_*=m Li Wang (Hieco)
2026-11-06 12:50 ` Cyril Hrubis
2026-11-03 7:57 ` [LTP] [PATCH v7 3/4] tst_kconfig: add module mappings for vsock/vsock_loopback Li Wang (Hieco)
2026-11-03 7:57 ` [LTP] [PATCH v7 4/4] testcases: drop manual tst_modprobe() now handled by tst_kconfig Li Wang (Hieco)
-- strict thread matches above, loose matches on Subject: below --
2026-11-02 2:43 [LTP] [PATCH v6 1/4] lib: add module is loaded check Li Wang (Hieco)
2026-11-02 8:26 ` [LTP] " linuxtestproject.agent
2026-10-15 7:58 [LTP] [PATCH v5 1/4] " Li Wang
2026-10-15 9:01 ` [LTP] " linuxtestproject.agent
2026-10-14 6:11 [LTP] [PATCH v4 1/4] " Li Wang
2026-10-14 7:41 ` [LTP] " linuxtestproject.agent
2026-10-10 3:36 [LTP] [PATCH v3 1/4] " Li Wang
2026-10-10 9:38 ` [LTP] " linuxtestproject.agent
2026-10-08 5:21 [LTP] [Patch v2 1/4] " Li Wang
2026-10-08 10:14 ` [LTP] " linuxtestproject.agent
2026-10-10 1:43 ` Li Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261103101938.4207-1-linuxtestproject.agent@gmail.com \
--to=linuxtestproject.agent@gmail.com \
--cc=li.wang@linux.dev \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.