* [LTP] [PATCH] syscalls/lsm_list_modules02: Log unrecognized LSM IDs with TINFO instead of TBROK
@ 2026-07-02 4:25 Wake Liu via ltp
2026-07-02 7:34 ` [LTP] " linuxtestproject.agent
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Wake Liu via ltp @ 2026-07-02 4:25 UTC (permalink / raw)
To: ltp; +Cc: Wake Liu, r.kothari
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
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [LTP] syscalls/lsm_list_modules02: Log unrecognized LSM IDs with TINFO instead of TBROK
2026-07-02 4:25 [LTP] [PATCH] syscalls/lsm_list_modules02: Log unrecognized LSM IDs with TINFO instead of TBROK Wake Liu via ltp
@ 2026-07-02 7:34 ` linuxtestproject.agent
2026-07-02 7:37 ` [LTP] [PATCH] " Andrea Cervesato via ltp
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: linuxtestproject.agent @ 2026-07-02 7:34 UTC (permalink / raw)
To: Wake Liu; +Cc: ltp
Hi Wake,
On Thu, 2 Jul 2026 04:25:05 +0000, Wake Liu wrote:
> syscalls/lsm_list_modules02: Log unrecognized LSM IDs with TINFO instead of TBROK
Verdict - Reviewed
---
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
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [LTP] [PATCH] syscalls/lsm_list_modules02: Log unrecognized LSM IDs with TINFO instead of TBROK
2026-07-02 4:25 [LTP] [PATCH] syscalls/lsm_list_modules02: Log unrecognized LSM IDs with TINFO instead of TBROK Wake Liu via ltp
2026-07-02 7:34 ` [LTP] " linuxtestproject.agent
@ 2026-07-02 7:37 ` Andrea Cervesato via ltp
2026-07-02 12:05 ` Petr Vorel
2026-07-02 12:14 ` Andrea Cervesato via ltp
3 siblings, 0 replies; 6+ messages in thread
From: Andrea Cervesato via ltp @ 2026-07-02 7:37 UTC (permalink / raw)
To: Wake Liu; +Cc: Wake Liu, r.kothari, ltp
Reviewed-by: Andrea Cervesato <andrea.cervesato@suse.com>
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH] syscalls/lsm_list_modules02: Log unrecognized LSM IDs with TINFO instead of TBROK
2026-07-02 4:25 [LTP] [PATCH] syscalls/lsm_list_modules02: Log unrecognized LSM IDs with TINFO instead of TBROK Wake Liu via ltp
2026-07-02 7:34 ` [LTP] " 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
3 siblings, 1 reply; 6+ messages in thread
From: Petr Vorel @ 2026-07-02 12:05 UTC (permalink / raw)
To: Wake Liu; +Cc: r.kothari, ltp
Hi Wake,
> 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.
Thanks!
Reviewed-by: Petr Vorel <pvorel@suse.cz>
> 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",
How about changing this to TCONF? It would be more obvious something was
skipped. This can be done before merge.
Kind regards,
Petr
> + (unsigned long)ids[i]);
> + continue;
> + }
> for (counter = 0; counter < lsm_names_count; counter++) {
> if (!strcmp(name, lsm_names[counter].name)) {
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [LTP] [PATCH] syscalls/lsm_list_modules02: Log unrecognized LSM IDs with TINFO instead of TBROK
2026-07-02 4:25 [LTP] [PATCH] syscalls/lsm_list_modules02: Log unrecognized LSM IDs with TINFO instead of TBROK Wake Liu via ltp
` (2 preceding siblings ...)
2026-07-02 12:05 ` Petr Vorel
@ 2026-07-02 12:14 ` Andrea Cervesato via ltp
3 siblings, 0 replies; 6+ messages in thread
From: Andrea Cervesato via ltp @ 2026-07-02 12:14 UTC (permalink / raw)
To: Wake Liu; +Cc: Wake Liu, r.kothari, ltp
Merged, Thanks!
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-07-02 12:15 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-02 4:25 [LTP] [PATCH] syscalls/lsm_list_modules02: Log unrecognized LSM IDs with TINFO instead of TBROK Wake Liu via ltp
2026-07-02 7:34 ` [LTP] " 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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox