Bug 1312572 - selinux avcs when starting virt-manager + libguestfs
Summary: selinux avcs when starting virt-manager + libguestfs
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: 27
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:c34710df9ffd42dd946ac2ae188...
: 1515164 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-27 12:44 UTC by Frank Büttner
Modified: 2018-06-20 17:35 UTC (History)
17 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-06-20 17:35:30 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Frank Büttner 2016-02-27 12:44:16 UTC
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.
Do
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:
selinux-policy-3.13.1-158.7.fc23.noarch

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 23:29:29 UTC
Can you describe what was going on when you hit this?
Is it reproducible?

Comment 2 Frank Büttner 2016-03-17 17:31:50 UTC
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 21:11:58 UTC
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 15:06:26 UTC
Yes.

Comment 5 Fedora End Of Life 2016-11-24 15:47:42 UTC
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 15:49:43 UTC
Same on F25

Comment 7 Frank Büttner 2017-01-06 14:50:49 UTC
Description of problem:
When the virt-manger try to inspect the images files of the vm's

Version-Release number of selected component:
selinux-policy-3.13.1-225.3.fc25.noarch

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

Comment 8 Fedora End Of Life 2017-11-16 19:30:16 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. 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 '25'.

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 25 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 9 Fedora End Of Life 2017-12-12 11:02:25 UTC
Fedora 25 changed to end-of-life (EOL) status on 2017-12-12. Fedora 25 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 10 Frank Büttner 2017-12-12 16:16:00 UTC
Same on F26

Comment 11 Lukas Vrabec 2018-01-05 14:13:12 UTC
*** Bug 1515164 has been marked as a duplicate of this bug. ***

Comment 12 Fedora End Of Life 2018-05-03 08:18:28 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. 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 '26'.

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 26 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 13 Cole Robinson 2018-06-19 19:25:53 UTC
selinux maintainers set to post... can anyone still reproduce with latest updates?

Comment 14 Frank Büttner 2018-06-19 20:02:49 UTC
I have updated the system to F28.
Today this exception will not occur any more.


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