Bug 1312572 - selinux avcs when starting virt-manager + libguestfs
selinux avcs when starting virt-manager + libguestfs
Status: NEW
Product: Fedora
Classification: Fedora
Component: libvirt (Show other bugs)
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Libvirt Maintainers
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2016-02-27 07:44 EST by Frank Büttner
Modified: 2017-01-06 09:50 EST (History)
16 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
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 Frank Büttner 2016-02-27 07:44:16 EST
Description of problem:
SELinux is preventing /usr/bin/qemu-system-x86_64 from 'read' accesses on the file spacewalk.qcow2.

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

If sie denken, dass es qemu-system-x86_64 standardmässig erlaubt sein sollte, read Zugriff auf spacewalk.qcow2 file zu erhalten.
Then sie sollten dies als Fehler melden.
Um diesen Zugriff zu erlauben, können Sie ein lokales Richtlinien-Modul erstellen.
zugriff jetzt erlauben, indem Sie die nachfolgenden Befehle ausführen:
# 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:c665,c995
Target Context                system_u:object_r:virt_image_t:s0
Target Objects                spacewalk.qcow2 [ file ]
Source                        qemu-system-x86
Source Path                   /usr/bin/qemu-system-x86_64
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           qemu-system-x86-2.4.1-7.fc23.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-158.7.fc23.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.3.5-300.fc23.x86_64 #1 SMP Mon
                              Feb 1 03:18:41 UTC 2016 x86_64 x86_64
Alert Count                   3
First Seen                    2016-02-27 13:42:45 CET
Last Seen                     2016-02-27 13:42:45 CET
Local ID                      fa42b97b-f826-43e4-8d8a-d84ec3f3f260

Raw Audit Messages
type=AVC msg=audit(1456576965.738:467): avc:  denied  { read } for  pid=24257 comm="qemu-system-x86" name="spacewalk.qcow2" dev="dm-1" ino=88343067 scontext=unconfined_u:unconfined_r:svirt_t:s0:c665,c995 tcontext=system_u:object_r:virt_image_t:s0 tclass=file permissive=0

type=SYSCALL msg=audit(1456576965.738:467): arch=x86_64 syscall=open success=no exit=EACCES a0=55fbb565d770 a1=80000 a2=0 a3=55fbb62aa000 items=0 ppid=1 pid=24257 auid=1000 uid=1000 gid=1000 euid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 tty=(none) ses=1 comm=qemu-system-x86 exe=/usr/bin/qemu-system-x86_64 subj=unconfined_u:unconfined_r:svirt_t:s0:c665,c995 key=(null)

Hash: qemu-system-x86,svirt_t,virt_image_t,file,read

Version-Release number of selected component:

Additional info:
reporter:       libreport-2.6.4
hashmarkername: setroubleshoot
kernel:         4.3.5-300.fc23.x86_64
type:           libreport

Potential duplicate: bug 984122
Comment 1 Cole Robinson 2016-03-16 19:29:29 EDT
Can you describe what was going on when you hit this?
Is it reproducible?
Comment 2 Frank Büttner 2016-03-17 13:31:50 EDT
As far I can say. it will occur when some vm's not running and virt-manager are started. Then the not running VM have another context.
like this example:
cd /var/lib/libvirt/images/
ll -Z
-rw-rwx---+ 1 qemu qemu system_u:object_r:svirt_image_t:s0:c631,c653   956170240 17. Mär 17:04 bacula_DB.img
-rw-rwx---+ 1 qemu qemu system_u:object_r:svirt_image_t:s0:c631,c653  3143106560 17. Mär 18:25 bacula_System.img
-rw-r--r--. 1 qemu qemu system_u:object_r:virt_image_t:s0             9665380352 17. Okt 18:41 c7test.qcow2
-rw-r--r--. 1 qemu qemu system_u:object_r:virt_image_t:s0             9665380352 17. Okt 17:39 C7test.qcow2

the bacula files will be for an running VM an the den c7test files are from one, which is not running.

I think, when virt-manger starts, then it will try to discover the os and installed packages. To do this, it will use guestfs. But this work only with running vm's because they are in other context.
Comment 3 Cole Robinson 2016-03-17 17:11:58 EDT
Okay I think I follow: so you hit this when just starting virt-manager with libguestfs is installed? not when starting a VM?
Comment 4 Frank Büttner 2016-03-18 11:06:26 EDT
Comment 5 Fedora End Of Life 2016-11-24 10:47:42 EST
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 6 Frank Büttner 2016-11-24 10:49:43 EST
Same on F25
Comment 7 Frank Büttner 2017-01-06 09:50:49 EST
Description of problem:
When the virt-manger try to inspect the images files of the vm's

Version-Release number of selected component:

Additional info:
reporter:       libreport-2.8.0
hashmarkername: setroubleshoot
kernel:         4.8.15-300.fc25.x86_64
type:           libreport

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