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: Sat, 10 Oct 2026 09:38:35 +0000 [thread overview]
Message-ID: <20261010093835.9399-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20261010033622.68927-2-li.wang@linux.dev>
Hi Li,
On 10 October 2026, Li Wang 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: The new public helper has no kernel-doc comment. Document mod_name,
hyphen normalization, return values, and whether built-in modules count
as loaded.
--- [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 modprobe fails, tst_modprobe() aborts before modules_loaded
becomes true, so cleanup skips modules already loaded successfully.
Track each successful load separately and make partial-load cleanup
available before invoking the next modprobe.
> + const char *const argv[] = { "modprobe", "-r",
> + loaded_modules[i - 1], NULL };
High: modprobe -r also removes unused dependencies, including modules
loaded before the test and excluded from this list. For example, removing
can-raw can remove a pre-existing can module; snapshot dependency ownership
and remove only modules loaded by this test.
> + tst_cmd(argv, "/dev/null", "/dev/null", TST_CMD_PASS_RETVAL);
> + }
> +
> + loaded_module_count = 0;
Medium: Every removal error is discarded, both output streams are
suppressed, and the ownership list is then cleared. Keep teardown nonfatal,
but report failed removals with TWARN and the module name instead of
silently leaving new modules loaded.
--- [PATCH 3/4] ---
> diff --git a/testcases/cve/cve-2025-21756.c b/testcases/cve/cve-2025-21756.c
> + .needs_root = 1,
Low: Document the new root requirement in the test description: root is
needed to load the VSOCK modules, while the reproducer runs as nobody.
The commit message explains this, but the exported test description does
not.
Verdict - Needs revision
Pre-existing issue (not a patch finding):
The description in testcases/cve/sctphantom.c says to run modprobe sctp
manually, although setup() already loaded it before this series.
---
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-10 9:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-10 3:36 [LTP] [PATCH v3 0/4] tst_kconfig: automatic module load/unload for CONFIG_*=m Li Wang
2026-10-10 3:36 ` [LTP] [PATCH v3 1/4] lib: add module is loaded check Li Wang
2026-10-10 9:38 ` linuxtestproject.agent [this message]
2026-10-12 15:48 ` Andrea Cervesato via ltp
2026-10-10 3:36 ` [LTP] [PATCH v3 2/4] tst_kconfig: load and unload kernel modules for CONFIG_*=m Li Wang
2026-10-12 16:09 ` Andrea Cervesato via ltp
2026-10-10 3:36 ` [LTP] [PATCH v3 3/4] tst_kconfig: add module mappings for vsock/vsock_loopback Li Wang
2026-10-12 15:51 ` Andrea Cervesato via ltp
2026-10-10 3:36 ` [LTP] [PATCH v3 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-08 5:21 [LTP] [Patch v2 1/4] lib: add module is loaded check 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=20261010093835.9399-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.