Bug 1284147

Summary: SELinux is preventing qemu-system-x86 from 'open' accesses on the file /media/casa.local/data/bodhi-3.1.1-64.iso.
Product: [Fedora] Fedora Reporter: Martín Cigorraga <martincigorraga>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 23CC: dominick.grift, dwalsh, lvrabec, mgrepl, plautrba
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:e5b3b7c6853b733233db9c11db87f092afc27bc644492ad3f083bf00ff998b8f;VARIANT_ID=workstation;
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-23 14:18:43 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:

Description Martín Cigorraga 2015-11-21 02:36:06 UTC
Description of problem:
SELinux is preventing qemu-system-x86 from 'open' accesses on the file /media/casa.local/data/bodhi-3.1.1-64.iso.

*****  Plugin catchall_boolean (89.3 confidence) suggests   ******************

If you want to allow virt to use samba
Then you must tell SELinux about this by enabling the 'virt_use_samba' boolean.
You can read 'None' man page for more details.
Do
setsebool -P virt_use_samba 1

*****  Plugin catchall (11.6 confidence) suggests   **************************

If you believe that qemu-system-x86 should be allowed open access on the bodhi-3.1.1-64.iso file 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 qemu-system-x86 /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                unconfined_u:unconfined_r:svirt_t:s0:c206,c782
Target Context                system_u:object_r:cifs_t:s0
Target Objects                /media/casa.local/data/bodhi-3.1.1-64.iso [ file ]
Source                        qemu-system-x86
Source Path                   qemu-system-x86
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-154.fc23.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.2.6-300.fc23.x86_64 #1 SMP Tue
                              Nov 10 19:32:21 UTC 2015 x86_64 x86_64
Alert Count                   3
First Seen                    2015-11-20 22:54:17 ART
Last Seen                     2015-11-20 22:54:17 ART
Local ID                      781cf199-aab7-4574-bf4e-dce8ca418b43

Raw Audit Messages
type=AVC msg=audit(1448070857.430:1199): avc:  denied  { open } for  pid=16644 comm="qemu-system-x86" path="/media/casa.local/data/bodhi-3.1.1-64.iso" dev="cifs" ino=251486 scontext=unconfined_u:unconfined_r:svirt_t:s0:c206,c782 tcontext=system_u:object_r:cifs_t:s0 tclass=file permissive=0


Hash: qemu-system-x86,svirt_t,cifs_t,file,open

Version-Release number of selected component:
selinux-policy-3.13.1-154.fc23.noarch

Additional info:
reporter:       libreport-2.6.3
hashmarkername: setroubleshoot
kernel:         4.2.6-300.fc23.x86_64
type:           libreport

Comment 1 Lukas Vrabec 2015-11-23 14:18:43 UTC
To fix this issue use: 
*****  Plugin catchall_boolean (89.3 confidence) suggests   ******************

If you want to allow virt to use samba
Then you must tell SELinux about this by enabling the 'virt_use_samba' boolean.
You can read 'None' man page for more details.
Do
setsebool -P virt_use_samba 1

Comment 2 Martín Cigorraga 2015-11-23 15:35:42 UTC
Hello Lukas,

Yes, that's what I did and everything now works as expected, thank you.