Skip to contentSkip to conversation

policy: allow testsuite caller domain to ptrace testsuite processes

PATCH In review Ondrej Mosnacek 2 participants 3 messages Nov 21, 2025 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 policy: allow testsuite caller domain to ptrace testsuite processes

While this is not required for the testsuite execution itself, it is useful when debugging by prepending commands with 'strace ...'. Testsuite domains outside domain_type() aren't allowed to be ptraced by other domains, so the permission needs to be allowed explicitly in the testsuite policy.

---
 policy/test_global.te | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
policy/test_global.te +3 -1
index 759353c..cb7d9c2 100644
@@ -69,7 +69,9 @@ optional_policy(`
 
 # Needed for domains outside domain_type()
 dontaudit testsuite_caller_domain testsuite_domain:process { noatsecure rlimitinh siginh };
-allow testsuite_caller_domain testsuite_domain:process sigkill;
+# ptrace - only needed for debugging (e.g. strace)
+# sigkill - needed for some tests to pass
+allow testsuite_caller_domain testsuite_domain:process { ptrace sigkill };
 
 # keys test may trigger search AVCs for root's keys
 dontaudit testsuite_domain testsuite_caller_domain:key { search };
Signature · 1 line
2.51.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Ondrej Mosnacek

While this is not required for the testsuite execution itself, it is useful when debugging by prepending commands with 'strace ...'. Testsuite domains outside domain_type() aren't allowed to be ptraced by other domains, so the permission needs to be allowed explicitly in the testsuite policy.

Quoted 23 lines
---
 policy/test_global.te | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
policy/test_global.te +3 -2
index 759353c..cb7d9c2 100644
@@ -69,7 +69,9 @@ optional_policy(`
 
 # Needed for domains outside domain_type()
 dontaudit testsuite_caller_domain testsuite_domain:process { noatsecure rlimitinh siginh };
-allow testsuite_caller_domain testsuite_domain:process sigkill;
+# ptrace - only needed for debugging (e.g. strace)
+# sigkill - needed for some tests to pass
+allow testsuite_caller_domain testsuite_domain:process { ptrace sigkill };
 
 # keys test may trigger search AVCs for root's keys
 dontaudit testsuite_domain testsuite_caller_domain:key { search };
--

2.51.1

author Applied
#2 lore raw
Quoted 9 lines · Stephen Smalley
Quoted 7 lines · Ondrej Mosnacek

While this is not required for the testsuite execution itself, it is useful when debugging by prepending commands with 'strace ...'. Testsuite domains outside domain_type() aren't allowed to be ptraced by other domains, so the permission needs to be allowed explicitly in the testsuite policy.

Quoted 3 lines
Quoted 1 line

Thanks, applied:
https://github.com/SELinuxProject/selinux-testsuite/commit/02f55421df28861a1f8292123e530303757329d0

Signature · 3 lines
Ondrej Mosnacek
Senior Software Engineer, Linux Security - SELinux kernel
Red Hat, Inc.