Skip to contentSkip to conversation

test_policy.if: use term_use_all_ptys() instead of unconfined_devpts_t

PATCH In review Stephen Smalley 2 participants 2 messages May 12, 2020 SELinux security module

lore
Share & tools
lore

Stephen Smalley

author maintainer
#0 lore raw

PATCH v5 7/15 test_policy.if: use term_use_all_ptys() instead of unconfined_devpts_t

refpolicy does not define an unconfined_devpts_t type instead assigning user_devpts_t to unconfined ptys. Switch to using the refpolicy term_use_all_ptys() interface in the test policy to provide compatibility across both refpolicy and Fedora.

---
v5 switches from direct use of ptynode to term_use_all_ptys().

 policy/test_policy.if | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
policy/test_policy.if +1 -2
index cefc8fb..e3c01c8 100644
@@ -29,7 +29,6 @@
 interface(`unconfined_runs_test',`
 	gen_require(`
 		type unconfined_t;
-               type unconfined_devpts_t;
 		role unconfined_r;
 	')
 
@@ -38,7 +37,7 @@ interface(`unconfined_runs_test',`
 	role unconfined_r types $1;
       # Report back from the test domain to the caller.
       allow $1 unconfined_t:fd use;
-      allow $1 unconfined_devpts_t:chr_file { read write ioctl getattr };
+      term_use_all_ptys($1)
       allow $1 unconfined_t:fifo_file { read write ioctl getattr };
       allow $1 unconfined_t:process { sigchld };
 
Signature · 1 line
2.23.3
Acked-by on v5 7/15
#1 lore raw
Quoted 34 lines · Stephen Smalley

refpolicy does not define an unconfined_devpts_t type instead assigning user_devpts_t to unconfined ptys. Switch to using the refpolicy term_use_all_ptys() interface in the test policy to provide compatibility across both refpolicy and Fedora.

---
v5 switches from direct use of ptynode to term_use_all_ptys().

 policy/test_policy.if | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
policy/test_policy.if +1 -3
index cefc8fb..e3c01c8 100644
@@ -29,7 +29,6 @@
 interface(`unconfined_runs_test',`
        gen_require(`
                type unconfined_t;
-               type unconfined_devpts_t;
                role unconfined_r;
        ')
 
@@ -38,7 +37,7 @@ interface(`unconfined_runs_test',`
        role unconfined_r types $1;
       # Report back from the test domain to the caller.
       allow $1 unconfined_t:fd use;
-      allow $1 unconfined_devpts_t:chr_file { read write ioctl getattr };
+      term_use_all_ptys($1)
       allow $1 unconfined_t:fifo_file { read write ioctl getattr };
       allow $1 unconfined_t:process { sigchld };
 
--
Quoted 2 lines

2.23.3

Thanks!

Signature · 3 lines
Ondrej Mosnacek <omosnace at redhat dot com>
Software Engineer, Security Technologies
Red Hat, Inc.