[LTP] [Patch v2 3/4] tst_kconfig: add module mappings for vsock/vsock_loopback
Li Wang
li.wang@linux.dev
Thu Oct 8 07:21:40 CEST 2026
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
More information about the ltp
mailing list