From: Wake Liu via ltp <ltp@lists.linux.it>
To: ltp@lists.linux.it
Cc: Wake Liu <wakel@google.com>, r.kothari@samsung.corp-partner.google.com
Subject: [LTP] [PATCH] syscalls/lsm_list_modules02: Log unrecognized LSM IDs with TINFO instead of TBROK
Date: Thu, 2 Jul 2026 04:25:05 +0000 [thread overview]
Message-ID: <20260702042505.389515-1-wakel@google.com> (raw)
When running lsm_list_modules02 on systems with newer upstream kernels
containing newly introduced LSMs, or on vendor/OEM kernels with out-of-tree
security modules enabled, lsm_list_modules(ids, size, 0) returns valid LSM
IDs that might not yet be mapped in the hardcoded switch (ids[i]) table.
Currently, encountering any unrecognized LSM ID causes the test to immediately
terminate with tst_brk(TBROK, "Unsupported LSM: %lu", ids[i]). This prevents
testing of other well-known standard LSMs present on the system.
Downgrade the unrecognized LSM ID handling from TBROK to TINFO and continue
iterating over the remaining IDs. This improves test robustness across
various kernel configurations while maintaining rigorous verification for all
known standard LSM modules.
Signed-off-by: Wake Liu <wakel@google.com>
---
testcases/kernel/syscalls/lsm/lsm_list_modules02.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/testcases/kernel/syscalls/lsm/lsm_list_modules02.c b/testcases/kernel/syscalls/lsm/lsm_list_modules02.c
index 91e5b7fa2..ede89ee73 100644
--- a/testcases/kernel/syscalls/lsm/lsm_list_modules02.c
+++ b/testcases/kernel/syscalls/lsm/lsm_list_modules02.c
@@ -95,8 +95,11 @@ static void run(void)
break;
}
- if (!name)
- tst_brk(TBROK, "Unsupported LSM: %lu", ids[i]);
+ if (!name) {
+ tst_res(TINFO, "Skipping unrecognized LSM ID: %lu",
+ (unsigned long)ids[i]);
+ continue;
+ }
for (counter = 0; counter < lsm_names_count; counter++) {
if (!strcmp(name, lsm_names[counter].name)) {
--
2.55.0.rc0.799.gd6f94ed593-goog
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next reply other threads:[~2026-07-02 4:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-02 4:25 Wake Liu via ltp [this message]
2026-07-02 7:34 ` [LTP] syscalls/lsm_list_modules02: Log unrecognized LSM IDs with TINFO instead of TBROK linuxtestproject.agent
2026-07-02 7:37 ` [LTP] [PATCH] " Andrea Cervesato via ltp
2026-07-02 12:05 ` Petr Vorel
2026-07-02 12:11 ` Andrea Cervesato via ltp
2026-07-02 12:14 ` Andrea Cervesato via ltp
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=20260702042505.389515-1-wakel@google.com \
--to=ltp@lists.linux.it \
--cc=r.kothari@samsung.corp-partner.google.com \
--cc=wakel@google.com \
/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.