Bug 1505845

Summary: osm_dump_qmap_to_file: cannot create file '/var/log/opensm-subnet.lst
Product: Red Hat Enterprise Linux 7 Reporter: lejeczek <peljasz>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.3CC: lvrabec, mgrepl, mmalik, orion, peljasz, plautrba, ssekidde
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-3.13.1-176.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 12:44:59 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:
Embargoed:

Description lejeczek 2017-10-24 11:34:30 UTC
Description of problem:

I think opensm could use some built-in policy, I needed:

require {
  type var_log_t;
  type opensm_t;
  class file { write open };
}

#============= opensm_t ==============
allow opensm_t var_log_t:file { write open };


maybe more(?)
regards

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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Milos Malik 2017-10-24 12:30:25 UTC
Please attach relevant SELinux denials too:

# ausearch -m avc -m user_avc -m selinux_err -m user_selinux_err -i -ts today

Comment 3 lejeczek 2017-10-24 16:10:07 UTC
the system does dozen different things, a snippet:
type=SYSCALL msg=audit(24/10/17 11:59:13.001:3249) : arch=x86_64 syscall=open success=no exit=EACCES(Permission denied) a0=0x7f18b49ec8c0 a1=O_WRONLY|O_CREAT|O_TRUNC a2=0666 a3=0x24 items=0 ppid=59040 pid=59042 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=opensm exe=/usr/sbin/opensm subj=system_u:system_r:opensm_t:s0 key=(null) 
type=AVC msg=audit(24/10/17 11:59:13.001:3249) : avc:  denied  { open } for  pid=59042 comm=opensm path=/var/log/opensm-subnet.lst dev="dm-0" ino=538204637 scontext=system_u:system_r:opensm_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file 
type=PROCTITLE msg=audit(24/10/17 11:59:13.000:3248) : proctitle=/usr/sbin/opensm -p 1 -g 0x0008f104039a62a2 --subnet_prefix 0xfe80000000000001 
type=SYSCALL msg=audit(24/10/17 11:59:13.000:3248) : arch=x86_64 syscall=open success=no exit=EACCES(Permission denied) a0=0x7f8901aac8c0 a1=O_WRONLY|O_CREAT|O_TRUNC a2=0666 a3=0x24 items=0 ppid=59043 pid=59044 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=opensm exe=/usr/sbin/opensm subj=system_u:system_r:opensm_t:s0 key=(null) 
type=AVC msg=audit(24/10/17 11:59:13.000:3248) : avc:  denied  { open } for  pid=59044 comm=opensm path=/var/log/opensm-subnet.lst dev="dm-0" ino=538204637 scontext=system_u:system_r:opensm_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file 
type=PROCTITLE msg=audit(24/10/17 11:59:23.000:3262) : proctitle=/usr/sbin/opensm -p 1 -g 0x0008f104039a62a1 --subnet_prefix 0xfe80000000000000 
type=SYSCALL msg=audit(24/10/17 11:59:23.000:3262) : arch=x86_64 syscall=open success=no exit=EACCES(Permission denied) a0=0x7f18b49ec8c0 a1=O_WRONLY|O_CREAT|O_TRUNC a2=0666 a3=0x24 items=0 ppid=59040 pid=59042 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=opensm exe=/usr/sbin/opensm subj=system_u:system_r:opensm_t:s0 key=(null) 
type=AVC msg=audit(24/10/17 11:59:23.000:3262) : avc:  denied  { open } for  pid=59042 comm=opensm path=/var/log/opensm-subnet.lst dev="dm-0" ino=538204637 scontext=system_u:system_r:opensm_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file 
type=PROCTITLE msg=audit(24/10/17 11:59:23.000:3263) : proctitle=/usr/sbin/opensm -p 1 -g 0x0008f104039a62a2 --subnet_prefix 0xfe80000000000001 
type=SYSCALL msg=audit(24/10/17 11:59:23.000:3263) : arch=x86_64 syscall=open success=no exit=EACCES(Permission denied) a0=0x7f8901aac8c0 a1=O_WRONLY|O_CREAT|O_TRUNC a2=0666 a3=0x24 items=0 ppid=59043 pid=59044 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=opensm exe=/usr/sbin/opensm subj=system_u:system_r:opensm_t:s0 key=(null) 
type=AVC msg=audit(24/10/17 11:59:23.000:3263) : avc:  denied  { open } for  pid=59044 comm=opensm path=/var/log/opensm-subnet.lst dev="dm-0" ino=538204637 scontext=system_u:system_r:opensm_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file 
type=PROCTITLE msg=audit(24/10/17 11:59:33.004:3336) : proctitle=/usr/sbin/opensm -p 1 -g 0x0008f104039a62a1 --subnet_prefix 0xfe80000000000000 
type=SYSCALL msg=audit(24/10/17 11:59:33.004:3336) : arch=x86_64 syscall=open success=no exit=EACCES(Permission denied) a0=0x7f18b49ec8c0 a1=O_WRONLY|O_CREAT|O_TRUNC a2=0666 a3=0x24 items=0 ppid=59040 pid=59042 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=opensm exe=/usr/sbin/opensm subj=system_u:system_r:opensm_t:s0 key=(null) 
type=AVC msg=audit(24/10/17 11:59:33.004:3336) : avc:  denied  { open } for  pid=59042 comm=opensm path=/var/log/opensm-subnet.lst dev="dm-0" ino=538204637 scontext=system_u:system_r:opensm_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file 
type=PROCTITLE msg=audit(24/10/17 11:59:33.004:3337) : proctitle=/usr/sbin/opensm -p 1 -g 0x0008f104039a62a2 --subnet_prefix 0xfe80000000000001 
type=SYSCALL msg=audit(24/10/17 11:59:33.004:3337) : arch=x86_64 syscall=open success=no exit=EACCES(Permission denied) a0=0x7f8901aac8c0 a1=O_WRONLY|O_CREAT|O_TRUNC a2=0666 a3=0x24 items=0 ppid=59043 pid=59044 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=opensm exe=/usr/sbin/opensm subj=system_u:system_r:opensm_t:s0 key=(null) 
type=AVC msg=audit(24/10/17 11:59:33.004:3337) : avc:  denied  { open } for  pid=59044 comm=opensm path=/var/log/opensm-subnet.lst dev="dm-0" ino=538204637 scontext=system_u:system_r:opensm_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file 
type=PROCTITLE msg=audit(24/10/17 11:59:43.003:3339) : proctitle=/usr/sbin/opensm -p 1 -g 0x0008f104039a62a2 --subnet_prefix 0xfe80000000000001 
type=SYSCALL msg=audit(24/10/17 11:59:43.003:3339) : arch=x86_64 syscall=open success=no exit=EACCES(Permission denied) a0=0x7f8901aac8c0 a1=O_WRONLY|O_CREAT|O_TRUNC a2=0666 a3=0x24 items=0 ppid=59043 pid=59044 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=opensm exe=/usr/sbin/opensm subj=system_u:system_r:opensm_t:s0 key=(null) 
type=AVC msg=audit(24/10/17 11:59:43.003:3339) : avc:  denied  { open } for  pid=59044 comm=opensm path=/var/log/opensm-subnet.lst dev="dm-0" ino=538204637 scontext=system_u:system_r:opensm_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file 
type=PROCTITLE msg=audit(24/10/17 11:59:43.003:3338) : proctitle=/usr/sbin/opensm -p 1 -g 0x0008f104039a62a1 --subnet_prefix 0xfe80000000000000 
type=SYSCALL msg=audit(24/10/17 11:59:43.003:3338) : arch=x86_64 syscall=open success=no exit=EACCES(Permission denied) a0=0x7f18b49ec8c0 a1=O_WRONLY|O_CREAT|O_TRUNC a2=0666 a3=0x24 items=0 ppid=59040 pid=59042 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=opensm exe=/usr/sbin/opensm subj=system_u:system_r:opensm_t:s0 key=(null) 
type=AVC msg=audit(24/10/17 11:59:43.003:3338) : avc:  denied  { open } for  pid=59042 comm=opensm path=/var/log/opensm-subnet.lst dev="dm-0" ino=538204637 scontext=system_u:system_r:opensm_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file

Comment 9 errata-xmlrpc 2018-04-10 12:44:59 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.

https://access.redhat.com/errata/RHBA-2018:0763