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: Thu, 15 Oct 2026 09:01:47 +0000 [thread overview]
Message-ID: <20261015090147.9591-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20261015075812.184811-2-li.wang@linux.dev>
Hi Li,
On 15 October 2026, Li Wang (Hieco) wrote:
> lib: add module is loaded check
--- [PATCH 1/4] ---
> diff --git a/include/tst_module.h b/include/tst_module.h
> +bool tst_module_is_loaded(const char *mod_name);
Low: Add kernel-doc for this new public helper, documenting mod_name,
hyphen/underscore normalization, and its return semantics, including
built-in modules and failure to open /proc/modules.
--- [PATCH 2/4] ---
> diff --git a/lib/tst_kconfig.c b/lib/tst_kconfig.c
> + for (i = 0; i < loaded_module_count; i++) {
> + tst_res(TDEBUG, "Loading module '%s'", loaded_modules[i]);
> + tst_modprobe(loaded_modules[i], NULL);
> + }
> +
> + modules_loaded = true;
High: If a later tst_modprobe() aborts, modules_loaded is still false, so
do_cleanup() skips unloading earlier successfully loaded modules. Track
successful loads incrementally and make that prefix eligible for cleanup
before attempting the next load.
> + const char *const argv[] = { "modprobe", "-r",
> + loaded_modules[i - 1], NULL };
High: modprobe -r also removes unused dependencies, including pre-existing
ones: if can is already loaded and this run loads can-raw, cleanup can
remove both. Track ownership of dependencies and use targeted removal so
cleanup preserves modules that were loaded before the test.
> diff --git a/include/tst_kconfig.h b/include/tst_kconfig.h
> + * Called from do_test_cleanup() so that the modules are released when
Low: The call is in do_cleanup() in the library parent, not
do_test_cleanup() in the test child. Correct this comment and the same
statement in the commit message.
--- [PATCH 3/4] ---
> diff --git a/testcases/cve/cve-2025-21756.c b/testcases/cve/cve-2025-21756.c
> + .needs_root = 1,
> + .setup = setup,
Low: Document the new root requirement in the test's description block:
root preloads the vsock modules, then setup drops privileges before running
the reproducer.
--- [PATCH 4/4] ---
> diff --git a/testcases/kernel/syscalls/keyctl/keyctl23.c b/testcases/kernel/syscalls/keyctl/keyctl23.c
> - * Requires root (CAP_SYS_MODULE) to load the ``x509_key_parser`` module.
> - *
Low: Remove keyctl23's remaining .needs_root = 1 alongside this explanation
and the load call. Its CONFIG_X509_CERTIFICATE_PARSER=y requirement means
the automatic loader has no parser module to load, and the remaining
operations act on the caller's own keyrings.
> All four tests already declare the matching configs in
Low: The list and diff contain five tests, not four.
Verdict - Needs revision
---
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-10-15 9:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 7:58 [LTP] [PATCH v5 0/4] tst_kconfig: automatic module load/unload for CONFIG_*=m Li Wang
2026-10-15 7:58 ` [LTP] [PATCH v5 1/4] lib: add module is loaded check Li Wang
2026-10-15 9:01 ` linuxtestproject.agent [this message]
2026-10-15 7:58 ` [LTP] [PATCH v5 2/4] tst_kconfig: load and unload kernel modules for CONFIG_*=m Li Wang
2026-10-15 7:58 ` [LTP] [PATCH v5 3/4] tst_kconfig: add module mappings for vsock/vsock_loopback Li Wang
2026-10-15 7:58 ` [LTP] [PATCH v5 4/4] testcases: drop manual tst_modprobe() now handled by tst_kconfig Li Wang
-- strict thread matches above, loose matches on Subject: below --
2026-10-14 6:11 [LTP] [PATCH v4 1/4] lib: add module is loaded check 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=20261015090147.9591-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox