Linux Test Project
 help / color / mirror / Atom feed
From: linuxtestproject.agent@gmail.com
To: Li Wang <li.wang@linux.dev>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] tst_kconfig: load and unload kernel modules for CONFIG_*=m
Date: Wed,  7 Oct 2026 14:17:58 +0000	[thread overview]
Message-ID: <20261007141758.9828-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20261007105730.94492-2-li.wang@linux.dev>

Hi Li,

On Wed, 7 Oct 2026, Li Wang wrote:
> tst_kconfig: load and unload kernel modules for CONFIG_*=m

--- [PATCH 1/3] ---

> diff --git a/lib/tst_kconfig.c b/lib/tst_kconfig.c
> +	if (loaded_module_count < MAX_LOADED_MODULES)
> +		loaded_modules[loaded_module_count++] = mod;

High: This records config matches, not modules newly loaded by the test,
so cleanup can remove an unused module that was already loaded beforehand.
A read-only tst_kconfig_read() during a callback also adds unload targets
without loading them. Separate config discovery from ownership tracking
and unload only modules successfully added by this test.

> diff --git a/lib/tst_test.c b/lib/tst_test.c
> +	tst_kconfig_module_unload_all();

High: Loading happens once in the library parent, but this cleanup runs
in each test child. Setup aborts and killed children leak modules, later
variants can lose modules removed by the first child, and cve-2026-46331
cannot unload after dropping initial-user-namespace privileges. Move
unloading to parent do_cleanup(), after all variants and resource teardown.

> diff --git a/lib/tst_kconfig.c b/lib/tst_kconfig.c
> +		tst_modprobe(loaded_modules[i], NULL);
> +		const char *const argv[] = { "rmmod", loaded_modules[i - 1], NULL };

Medium: modprobe also inserts dependencies that this list never records;
with both initially absent, loading can-raw inserts can, but cleanup only
removes can-raw and leaves can loaded. Track newly inserted dependencies
relative to the initial module state and remove owned modules in
dependency order.

> diff --git a/include/tst_kconfig.h b/include/tst_kconfig.h
> +/*
> + * tst_kconfig_module_load() - Load kernel modules for CONFIG_*=m entries.

Low: Both new public API comments use /* rather than /** and are omitted
from the generated kernel-doc reference. Use kernel-doc comment openers
for both declarations.

--- [PATCH 2/3] ---

> Map CONFIG_VSOCKETS and CONFIG_VSOCKETS_LOOPBACK to their kernel
> modules (vsock, vsock_loopback).

Low: The body only restates the mappings and does not explain the new
config and privilege gates in cve-2025-21756. Explain the missing-loopback
bind failure and why the test now requires root.

> diff --git a/testcases/cve/cve-2025-21756.c b/testcases/cve/cve-2025-21756.c
> +	.needs_root = 1,

Low: Document this new root requirement in the test's high-level
description, identifying module loading as the privileged operation.

--- [PATCH 3/3] ---

> diff --git a/testcases/kernel/syscalls/keyctl/keyctl29.c b/testcases/kernel/syscalls/keyctl/keyctl29.c
> -	tst_modprobe("x509_key_parser", NULL);
> diff --git a/testcases/kernel/syscalls/keyctl/keyctl30.c b/testcases/kernel/syscalls/keyctl/keyctl30.c
> -	tst_modprobe("pkcs8_key_parser", NULL);

Medium: With KCONFIG_SKIP_CHECK=1, tst_kconfig_check() returns before
recording modules, leaving these removed loads without a replacement.
When parser modules are installed but unloaded, keyctl29/keyctl30 now
skip with EBADMSG instead of executing their checks. Preserve module
setup independently of config validation, or retain the explicit loads.

Verdict - Needs revision

Pre-existing issue (not introduced by this series):

Medium: sctphantom saves its SCTP sysctls in the test child's private
tst_sys_conf list, but only the library parent calls tst_sys_conf_restore()
and cannot see those saved values. Use parent-side .save_restore after
module loading, or explicitly restore them in the test child's cleanup.

---
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

  reply	other threads:[~2026-10-07 14:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-07 10:57 [LTP] [PATCH 0/3] tst_kconfig: automatic module load/unload for CONFIG_*=m Li Wang
2026-10-07 10:57 ` [LTP] [PATCH 1/3] tst_kconfig: load and unload kernel modules " Li Wang
2026-10-07 14:17   ` linuxtestproject.agent [this message]
2026-10-08  5:09     ` [LTP] " Li Wang
2026-10-07 10:57 ` [LTP] [PATCH 2/3] tst_kconfig: add module mappings for vsock/vsock_loopback Li Wang
2026-10-07 10:57 ` [LTP] [PATCH 3/3] testcases: drop manual tst_modprobe() now handled by tst_kconfig 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=20261007141758.9828-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