All of lore.kernel.org
 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] lib: add module is loaded check
Date: Wed, 14 Oct 2026 07:41:38 +0000	[thread overview]
Message-ID: <20261014074138.9547-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20261014061202.56362-2-li.wang@linux.dev>

Hi Li,

On 14 October 2026, Li Wang (Hieco) wrote:
> [PATCH 1/4] 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 API, including mod_name,
hyphen normalization, the return value, and how an unreadable
/proc/modules is handled.

--- [PATCH 2/4] ---

> diff --git a/lib/tst_kconfig.c b/lib/tst_kconfig.c
> +		tst_modprobe(loaded_modules[i], NULL);
> +	}
> +
> +	modules_loaded = true;

Medium: If one module loads and a later modprobe fails, cleanup sees
modules_loaded == false and leaves the successfully loaded module behind.
Track successful loads incrementally so cleanup also handles partial
failure.

> +		const char *const argv[] = { "modprobe", "-r",
> +						loaded_modules[i - 1], NULL };

High: modprobe -r also removes unused dependencies, including modules
that were loaded before the test; for example, removing can-raw can
also remove a pre-existing can module.
Snapshot the initial module state and unload only modules introduced
by the test, rather than recursively removing untracked dependencies.

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

> diff --git a/testcases/cve/cve-2025-21756.c b/testcases/cve/cve-2025-21756.c
> +static void restore_privileges(void)
> +{
> +	SAFE_SETEGID(0);
> +	SAFE_SETEUID(0);
> +}

Medium: When root starts with nonzero real/saved group IDs, setegid(0)
fails with permission denied after setup drops the effective uid, adding
a cleanup warning to an otherwise passing test.
Restore the effective uid first and restore the original effective gid,
not an assumed gid of 0.
Alternatively, omit this restoration: module unloading runs in the
still-root framework parent, not this test child.

> +	.needs_root = 1,

Low: Document the new root requirement in the test description: root
loads the modules, then the reproducer drops effective privileges.

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

  reply	other threads:[~2026-10-14  8:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14  6:11 [LTP] [PATCH v4 0/4] tst_kconfig: automatic module load/unload for CONFIG_*=m Li Wang
2026-10-14  6:11 ` [LTP] [PATCH v4 1/4] lib: add module is loaded check Li Wang
2026-10-14  7:41   ` linuxtestproject.agent [this message]
2026-10-14  6:12 ` [LTP] [PATCH v4 2/4] tst_kconfig: load and unload kernel modules for CONFIG_*=m Li Wang
2026-10-14  6:12 ` [LTP] [PATCH v4 3/4] tst_kconfig: add module mappings for vsock/vsock_loopback Li Wang
2026-10-14  6:12 ` [LTP] [PATCH v4 4/4] testcases: drop manual tst_modprobe() now handled by tst_kconfig Li Wang
2026-10-14  9:31   ` Wake Liu via ltp
  -- strict thread matches above, loose matches on Subject: below --
2026-10-10  3:36 [LTP] [PATCH v3 1/4] lib: add module is loaded check 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=20261014074138.9547-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.