All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Wang <li.wang@linux.dev>
To: ltp@lists.linux.it
Subject: [LTP] [Patch v2 3/4] tst_kconfig: add module mappings for vsock/vsock_loopback
Date: Thu,  8 Oct 2026 13:21:40 +0800	[thread overview]
Message-ID: <20261008052141.129763-4-li.wang@linux.dev> (raw)
In-Reply-To: <20261008052141.129763-1-li.wang@linux.dev>

Map CONFIG_VSOCKETS and CONFIG_VSOCKETS_LOOPBACK to their kernel
modules (vsock, vsock_loopback), so that tst_kconfig can load them
automatically when the test declares the matching configs.

cve-2025-21756 binds to VMADDR_CID_LOCAL, which requires the
vsock_loopback module. When the module is present but not loaded,
bind() fails with EADDRNOTAVAIL and the test aborts with TBROK
instead of exercising the CVE, so declare both configs in the test's
needs_kconfigs.

The test also needs root to load the modules and to run as the
vsock_loopback transport is not available from an unprivileged user
namespace.

Signed-off-by: Li Wang <li.wang@linux.dev>
---
 lib/tst_kconfig.c              | 2 ++
 testcases/cve/cve-2025-21756.c | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/lib/tst_kconfig.c b/lib/tst_kconfig.c
index fc03966ba..b267c5f30 100644
--- a/lib/tst_kconfig.c
+++ b/lib/tst_kconfig.c
@@ -174,6 +174,8 @@ static struct config_module_map {
 	{"CONFIG_NET_ACT_PEDIT", "act_pedit"},
 	{"CONFIG_PKCS8_PRIVATE_KEY_PARSER", "pkcs8_key_parser"},
 	{"CONFIG_X509_CERTIFICATE_PARSER", "x509_key_parser"},
+	{"CONFIG_VSOCKETS", "vsock"},
+	{"CONFIG_VSOCKETS_LOOPBACK", "vsock_loopback"},
 	{}
 };
 
diff --git a/testcases/cve/cve-2025-21756.c b/testcases/cve/cve-2025-21756.c
index 4245a4c95..1df8545c9 100644
--- a/testcases/cve/cve-2025-21756.c
+++ b/testcases/cve/cve-2025-21756.c
@@ -85,8 +85,14 @@ static void run(void)
 }
 
 static struct tst_test test = {
+	.needs_root = 1,
 	.test_all = run,
 	.taint_check = TST_TAINT_W | TST_TAINT_D,
+	.needs_kconfigs = (const char *const[]) {
+		"CONFIG_VSOCKETS",
+		"CONFIG_VSOCKETS_LOOPBACK",
+		NULL
+	},
 	.tags = (const struct tst_tag[]) {
 		{"linux-git", "fcdd2242c0231032fc84e1404315c245ae56322a"},
 		{"CVE", "2025-21756"},
-- 
2.56.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  parent reply	other threads:[~2026-10-08  5:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-08  5:21 [LTP] [Patch v2 0/4] tst_kconfig: automatic module load/unload for CONFIG_*=m Li Wang
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
2026-10-08  5:21 ` [LTP] [Patch v2 2/4] tst_kconfig: load and unload kernel modules for CONFIG_*=m Li Wang
2026-10-08  5:21 ` Li Wang [this message]
2026-10-08  5:21 ` [LTP] [Patch v2 4/4] 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=20261008052141.129763-4-li.wang@linux.dev \
    --to=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.