[PATCH v2 3/4] selftests/landlock: Test namespace denial operations
Mickaël Salaün
mic at digikod.net
Wed Nov 18 16:32:51 UTC 2026
The namespace trace tests cover creation and entry denials, but only
creation exercises the quiet path. This leaves the new ENTER request
tag untested through quiet selection and trace dispatch when audit
logging is suppressed.
Add the missing quiet setns(2) case. Together with the existing cases,
this exercises all four combinations of CREATE and ENTER with logged and
quieted denials, including each exact namespace_op value.
Cc: Günther Noack <gnoack at google.com>
Signed-off-by: Mickaël Salaün <mic at digikod.net>
---
tools/testing/selftests/landlock/ns_test.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/tools/testing/selftests/landlock/ns_test.c b/tools/testing/selftests/landlock/ns_test.c
index d4a85cbebeae..52206ad94eca 100644
--- a/tools/testing/selftests/landlock/ns_test.c
+++ b/tools/testing/selftests/landlock/ns_test.c
@@ -2575,6 +2575,13 @@ TEST_F(ns_trace, deny_setns)
test_ns_trace_denial(_metadata, true, false);
}
+TEST_F(ns_trace, deny_setns_quiet)
+{
+ if (!self->tracefs_ok)
+ SKIP(return, "tracefs not available");
+ test_ns_trace_denial(_metadata, true, true);
+}
+
/* clang-format off */
FIXTURE(ns_proc_open) {
/* clang-format on */
--
2.56.0
More information about the Linux-security-module-archive
mailing list