Bug 1000641 - SELinux is preventing /usr/bin/qemu-system-x86_64 from 'getattr' accesses on the filesystem /run/media/derekm/LIVE.
SELinux is preventing /usr/bin/qemu-system-x86_64 from 'getattr' accesses on ...
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2013-08-23 19:25 EDT by Derek P. Moore
Modified: 2013-09-09 09:38 EDT (History)
4 users (show)

See Also:
Fixed In Version: selinux-policy-3.12.1-74.1.fc19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-09-07 20:36:00 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Derek P. Moore 2013-08-23 19:25:32 EDT
Description of problem:
Used GNOME Boxes to create a VM with installation ISO on USB media.
SELinux is preventing /usr/bin/qemu-system-x86_64 from 'getattr' accesses on the filesystem /run/media/derekm/LIVE.

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

If you believe that qemu-system-x86_64 should be allowed getattr access on the LIVE filesystem by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
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:system_r:svirt_t:s0:c530,c772
Target Context                system_u:object_r:dosfs_t:s0
Target Objects                /run/media/derekm/LIVE [ filesystem ]
Source                        qemu-system-x86
Source Path                   /usr/bin/qemu-system-x86_64
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           qemu-system-x86-1.4.2-7.fc19.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-71.fc19.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.10.9-200.fc19.x86_64 #1 SMP Wed
                              Aug 21 19:27:58 UTC 2013 x86_64 x86_64
Alert Count                   1
First Seen                    2013-08-23 11:18:40 CDT
Last Seen                     2013-08-23 11:18:40 CDT
Local ID                      829e88de-e54e-4e68-ac6c-d9f0e86f6938

Raw Audit Messages
type=AVC msg=audit(1377274720.61:578): avc:  denied  { getattr } for  pid=7875 comm="qemu-system-x86" name="/" dev="sdb1" ino=1 scontext=unconfined_u:system_r:svirt_t:s0:c530,c772 tcontext=system_u:object_r:dosfs_t:s0 tclass=filesystem

type=SYSCALL msg=audit(1377274720.61:578): arch=x86_64 syscall=fstatfs success=no exit=EACCES a0=10 a1=7fffda9a6a50 a2=0 a3=1 items=0 ppid=1 pid=7875 auid=1000 uid=1000 gid=1000 euid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 ses=1 tty=(none) comm=qemu-system-x86 exe=/usr/bin/qemu-system-x86_64 subj=unconfined_u:system_r:svirt_t:s0:c530,c772 key=(null)

Hash: qemu-system-x86,svirt_t,dosfs_t,filesystem,getattr

Additional info:
reporter:       libreport-2.1.6
hashmarkername: setroubleshoot
kernel:         3.10.9-200.fc19.x86_64
type:           libreport
Comment 1 Derek P. Moore 2013-08-23 19:28:03 EDT
Also, libreport does not detect GNOME 3 system-wide proxy settings for submitting bug reports to Bugzilla. :) I should probably enter that as a new bug.
Comment 2 Daniel Walsh 2013-08-26 16:04:41 EDT
So you image is installed on a fat file system?
Comment 3 Derek P. Moore 2013-08-26 18:07:01 EDT
Sure enough:
/dev/sdb1 on /run/media/derekm/LIVE type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=437,iocharset=ascii,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)

File is "en_windows_7_ultimate_with_sp1_x64_dvd_u_677332.iso"
Comment 4 Daniel Walsh 2013-08-28 13:45:11 EDT
Do you have the virt_use_usb boolean turned on?
Comment 5 Daniel Walsh 2013-08-28 13:45:35 EDT
ff1e3933b46537f258292e95708b5cd78ec7ba74 fixes this in git.
Comment 6 Derek P. Moore 2013-08-28 14:00:31 EDT
No, I haven't explicitly set anything with setsebool. This install is brand new and pretty much virgin/stock.
Comment 7 Daniel Walsh 2013-08-28 16:15:39 EDT
Ok turn that boolean on and see if everything works.

It will still have a the AVC, but I want to know if you see any other problems.

# setsebool -P virt_use_usb 1
Comment 8 Miroslav Grepl 2013-08-29 04:58:22 EDT
Back ported.
Comment 9 Fedora Update System 2013-09-03 15:56:37 EDT
selinux-policy-3.12.1-74.1.fc19 has been submitted as an update for Fedora 19.
Comment 10 Fedora Update System 2013-09-04 21:38:00 EDT
Package selinux-policy-3.12.1-74.1.fc19:
* should fix your issue,
* was pushed to the Fedora 19 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.12.1-74.1.fc19'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
Comment 11 Fedora Update System 2013-09-07 20:36:00 EDT
selinux-policy-3.12.1-74.1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 12 Derek P. Moore 2013-09-09 09:33:10 EDT
I saw the update come thru so I tested the "setsebool -P virt_use_usb 1" solution prior to update, it did not work, still got the getattr error.

Undid bool operation with "setsebool -P virt_use_usb 0" and installed new selinux-policy-3.12.1-74.1.fc19.noarch, ejected and reinserted USB thumbdrive, reopened GNOME Boxes, and now I get 'Connection to "_name_of_vm_" failed'.

Do I need to reboot/relabel or something?

Comment 13 Derek P. Moore 2013-09-09 09:38:07 EDT
Sorry, I reset "setsebool -P virt_use_usb 1" and now it appears to be working without the getattr warning.

I don't know whether virt_use_usb defaults to 0 or 1, but with it set to 0 it was failing on "open", with it set to 1 there is no longer an issue with "getattr".

Thanks again!

Note You need to log in before you can comment on or make changes to this bug.