Bug 1571591

Summary: sysadm_u cannot work with SCTP sockets
Product: Red Hat Enterprise Linux 7 Reporter: Milos Malik <mmalik>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.5CC: lvrabec, mgrepl, mmalik, plautrba, ssekidde
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: selinux-policy-3.13.1-205.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-30 10:03:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Milos Malik 2018-04-25 07:47:15 UTC
Description of problem:
 * the only confined user that should be able to work with SCTP sockets is sysadm_u

Version-Release number of selected component (if applicable):

How reproducible:
 * always

Steps to Reproduce:
1. get a RHEL-7.5 machine (targeted policy is active)
2. create a sysadm_u user (useradd -Z sysadm_u ...)
3. log in as the user via ssh
4. run checksctp tool

Actual results (enforcing mode):
type=PROCTITLE msg=audit(04/25/2018 03:36:27.694:445) : proctitle=/usr/bin/checksctp 
type=SYSCALL msg=audit(04/25/2018 03:36:27.694:445) : arch=x86_64 syscall=socket success=no exit=EACCES(Permission denied) a0=inet a1=SOCK_STREAM a2=sctp a3=0x7ffe8aab9460 items=0 ppid=15267 pid=15268 auid=unknown(1000) uid=unknown(1000) gid=unknown(1000) euid=unknown(1000) suid=unknown(1000) fsuid=unknown(1000) egid=unknown(1000) sgid=unknown(1000) fsgid=unknown(1000) tty=pts2 ses=8 comm=checksctp exe=/usr/bin/checksctp subj=sysadm_u:sysadm_r:sysadm_t:s0-s0:c0.c1023 key=(null) 
type=AVC msg=audit(04/25/2018 03:36:27.694:445) : avc:  denied  { create } for  pid=15268 comm=checksctp scontext=sysadm_u:sysadm_r:sysadm_t:s0-s0:c0.c1023 tcontext=sysadm_u:sysadm_r:sysadm_t:s0-s0:c0.c1023 tclass=rawip_socket 

Expected results:
 * no SELinux denials

Comment 2 Milos Malik 2018-06-26 09:12:20 UTC
# rpm -qa selinux\*
# ausearch -m avc -m user_avc -m selinux_err -m user_selinux_err -i -ts recent
type=PROCTITLE msg=audit(06/26/2018 11:08:00.149:133) : proctitle=checksctp 
type=SYSCALL msg=audit(06/26/2018 11:08:00.149:133) : arch=x86_64 syscall=socket success=no exit=EACCES(Permission denied) a0=inet a1=SOCK_STREAM a2=sctp a3=0x7ffe6f394560 items=0 ppid=1498 pid=1545 auid=sysadm-user uid=sysadm-user gid=sysadm-user euid=sysadm-user suid=sysadm-user fsuid=sysadm-user egid=sysadm-user sgid=sysadm-user fsgid=sysadm-user tty=tty1 ses=3 comm=checksctp exe=/usr/bin/checksctp subj=sysadm_u:sysadm_r:sysadm_t:s0-s0:c0.c1023 key=(null) 
type=AVC msg=audit(06/26/2018 11:08:00.149:133) : avc:  denied  { create } for  pid=1545 comm=checksctp scontext=sysadm_u:sysadm_r:sysadm_t:s0-s0:c0.c1023 tcontext=sysadm_u:sysadm_r:sysadm_t:s0-s0:c0.c1023 tclass=sctp_socket permissive=0 

The issue is not fixed:

# sesearch -s sysadm_t -t sysadm_t -c sctp_socket -A -C -D
Found 3 semantic av rules:
   allow sysadm_t domain : sctp_socket getattr ; 
   dontaudit sysadm_t domain : sctp_socket getattr ; 
   dontaudit domain domain : sctp_socket { read write } ; 

Comment 8 errata-xmlrpc 2018-10-30 10:03:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.