Bug 694256

Summary: SELinux is preventing /sbin/iscsid from 'create' accesses on the directory iscsi.
Product: [Fedora] Fedora Reporter: Sandro Mathys <sandro>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 15CC: awilliam, dwalsh, mgrepl, sandro
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:a24aa0a6700071b850691e166e2994bbcf564bb4677e1b63b2f1b06fdc877c85 AcceptedBlocker
Fixed In Version: selinux-policy-3.9.16-15.fc15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-04-15 21:33:05 UTC Type: ---
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: 617261    

Description Sandro Mathys 2011-04-06 19:55:52 UTC
SELinux is preventing /sbin/iscsid from 'create' accesses on the directory iscsi.

*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that iscsid should be allowed create access on the iscsi directory by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep iscsid /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:iscsid_t:s0
Target Context                system_u:object_r:var_lock_t:s0
Target Objects                iscsi [ dir ]
Source                        iscsid
Source Path                   /sbin/iscsid
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           iscsi-initiator-utils-6.2.0.872-9.fc15
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-10.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 2.6.38.2-9.fc15.x86_64 #1 SMP
                              Wed Mar 30 16:55:57 UTC 2011 x86_64 x86_64
Alert Count                   1
First Seen                    Wed 06 Apr 2011 09:54:42 PM CEST
Last Seen                     Wed 06 Apr 2011 09:54:42 PM CEST
Local ID                      f71d47fc-4aac-4c4c-aa5d-6cfb3e62f9d2

Raw Audit Messages
type=AVC msg=audit(1302119682.331:168): avc:  denied  { create } for  pid=11685 comm="iscsid" name="iscsi" scontext=system_u:system_r:iscsid_t:s0 tcontext=system_u:object_r:var_lock_t:s0 tclass=dir


type=SYSCALL msg=audit(1302119682.331:168): arch=x86_64 syscall=mkdir success=no exit=EACCES a0=448ee3 a1=1b0 a2=2 a3=0 items=0 ppid=1 pid=11685 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=iscsid exe=/sbin/iscsid subj=system_u:system_r:iscsid_t:s0 key=(null)

Hash: iscsid,iscsid_t,var_lock_t,dir,create

audit2allow

#============= iscsid_t ==============
allow iscsid_t var_lock_t:dir create;

audit2allow -R

#============= iscsid_t ==============
allow iscsid_t var_lock_t:dir create;

Comment 1 Sandro Mathys 2011-04-06 20:04:05 UTC
So during installation, I set up my /home on an iscsi device. After the installation, /home was never mounted (and systemd is actually stuck with activating RAID/LVM/etc during bootup so I had to remove /home from fstab).

Now I checked the config and everything seems fine so I did a service iscsid restart and oops, setroubleshootd shows the above message.

Due to this SELinux denial I see the following behaviour in my syslog:
Apr  6 21:54:43 zalem iscsid: transport class version 2.0-870. iscsid version 2.0-872
Apr  6 21:54:43 zalem iscsid: iSCSI daemon with pid=11685 started!
Apr  6 21:54:43 zalem iscsid: Could not open /var/lock/iscsi. Exiting
Apr  6 21:54:43 zalem iscsid: Could not read discovery record for 192.168.0.11:3260.

So it seems that SELinux indeed breaks this use case:
http://fedoraproject.org/wiki/QA:Testcase_Anaconda_ISCSI_No_Authentication

Particularly, this expected result can't be verified:
"4. The installed system boots with all filesystems on the iSCSI device mounted."

Therefore I propose this a beta blocker.

Comment 2 Daniel Walsh 2011-04-06 20:12:40 UTC
/var/lock/iscsi should be labeled iscsid_lock_t.
Since it is no longer created by the rpm, I need to add policy to create it
Fixed in selinux-policy-3.9.16-13.fc15

Comment 3 Adam Williamson 2011-04-06 20:43:46 UTC
iscsi is Final stuff, not Beta. if that test case is labelled beta it should be changed to final.

from Final criteria - "The installer must be able to complete an installation using IDE, SATA, SCSI and iSCSI storage devices "

Comment 4 Sandro Mathys 2011-04-06 20:47:04 UTC
That's right, it's final not beta - my bad, didn't look straight. Good catch, Adam.

Comment 5 Fedora Update System 2011-04-11 20:38:14 UTC
selinux-policy-3.9.16-14.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/selinux-policy-3.9.16-14.fc15

Comment 6 Fedora Update System 2011-04-13 04:53:38 UTC
Package selinux-policy-3.9.16-14.fc15:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.9.16-14.fc15'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/selinux-policy-3.9.16-14.fc15
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2011-04-13 19:48:16 UTC
selinux-policy-3.9.16-15.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/selinux-policy-3.9.16-15.fc15

Comment 8 Adam Williamson 2011-04-15 20:00:24 UTC
Discussed at 2011-04-15 blocker review meeting, accepted as a blocker per criterion "# The installer must be able to complete an installation using IDE, SATA, SCSI and iSCSI storage devices ". Sandro, can you test the fix?



-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 9 Fedora Update System 2011-04-15 21:31:41 UTC
selinux-policy-3.9.16-15.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Sandro Mathys 2011-04-15 21:59:35 UTC
Fix confirmed, thanks.