Bug 1465031

Summary: init denied to read modprobe.d
Product: Red Hat Enterprise Linux 7 Reporter: Karel Volný <kvolny>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED DUPLICATE QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.4CC: aloughla, atragler, baumanmo, egarver, iptables-maint-list, kvolny, lvrabec, mgrepl, mmalik, plautrba, psutter, rkhan, ssekidde, sukulkar, todoleza, trevor.hemsley
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-09-07 16:33:41 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:
Bug Depends On:    
Bug Blocks: 1470965, 1472751    

Description Karel Volný 2017-06-26 12:56:37 UTC
Filed from caserun https://tcms.engineering.redhat.com/run/309346/#caserun_15657288

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

Steps to Reproduce: 
run the test


Actual results: 
type=PROCTITLE msg=audit(1498229041.232:88): proctitle=2F62696E2F62617368002F7573722F6C6962657865632F69707461626C65732F6970367461626C65732E696E6974007374617274
type=SYSCALL msg=audit(1498229041.232:88): arch=c00000b7 syscall=56 success=no exit=-13 a0=ffffffffffffff9c a1=235460a0 a2=84800 a3=0 items=0 ppid=1 pid=19208 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="ip6tables.init" exe="/usr/bin/bash" subj=system_u:system_r:iptables_t:s0 key=(null)
type=AVC msg=audit(1498229041.232:88): avc:  denied  { read } for  pid=19208 comm="ip6tables.init" name="modprobe.d" dev="dm-0" ino=100912890 scontext=system_u:system_r:iptables_t:s0 tcontext=system_u:object_r:modules_conf_t:s0 tclass=dir permissive=0

Expected results:

Comment 2 Thomas Woerner 2017-07-06 15:41:08 UTC
Have you tried to relabel modprobe.d with "restorecon -rvF /etc/modprobe.d"?

Comment 4 Tomas Dolezal 2017-08-08 09:40:54 UTC
granting qa_ack for 7.5; RPL

Comment 5 Trevor Hemsley 2017-08-30 13:42:12 UTC
I am also seeing this - on each reboot I get 6 selinux denials logged in my audit.log - one for each file in /etc/modprobe.d/*.conf. The code in question comes from line 212 in /usr/libexec/iptables/iptables.init where it is trying to determine if ipv6 has been disabled.

Files in /etc/modprobe.d/*.conf look correctly labeled to me and restorecon -RvF /etc/modprobe.d returns no output showing that it made no changes - thus answering the question about trying the relabel.

type=AVC msg=audit(1504094765.370:28): avc:  denied  { read } for  pid=661 comm="grep" name="blacklist-iscsi.conf" dev="dm-0" ino=782889 scontext=system_u:system_r:iptables_t:s0 tcontext=system_u:object_r:modules_conf_t:s0 tclass=file

Problem only happens when iptables.service is started by systemd as part of the boot. If you run systemctl restart iptables then nothing is logged. Running the AVCs through audit2allow generates:

require {
        type iptables_t;
        type modules_conf_t;
        class file read;
}

#============= iptables_t ==============
allow iptables_t modules_conf_t:file read;

Comment 6 Phil Sutter 2017-09-07 12:05:40 UTC
So this seems like just a case of missing selinux policy, therefore moving this ticket to selinux-policy component.

Comment 8 Milos Malik 2017-09-07 13:53:44 UTC
I believe this bug is a duplicate of BZ#1438937.

Comment 9 Phil Sutter 2017-09-07 16:33:41 UTC
(In reply to Milos Malik from comment #8)
> I believe this bug is a duplicate of BZ#1438937.

Yes, indeed. Thanks for spotting it!

*** This bug has been marked as a duplicate of bug 1438937 ***