Bug 1705684 - GNOME Boxes fail to 3D accelerate: SELinux is preventing qemu-system-x86 from using the 'execmem' accesses on a process.
Summary: GNOME Boxes fail to 3D accelerate: SELinux is preventing qemu-system-x86 from...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: gnome-boxes
Version: 30
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Christophe Fergeau
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:ac65e9d2c4559f1e3eef8263e1e...
: 1714847 1740926 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-05-02 18:32 UTC by Braden McDaniel
Modified: 2020-05-26 14:29 UTC (History)
24 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-26 14:29:21 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Braden McDaniel 2019-05-02 18:32:57 UTC
Description of problem:
Tried to start VM in GNOME Boxes.
SELinux is preventing qemu-system-x86 from using the 'execmem' accesses on a process.

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

If you want to allow virt to use execmem
Then you must tell SELinux about this by enabling the 'virt_use_execmem' boolean.

Do
setsebool -P virt_use_execmem 1

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

If you believe that qemu-system-x86 should be allowed execmem access on processes labeled svirt_t 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:
# ausearch -c 'qemu-system-x86' --raw | audit2allow -M my-qemusystemx86
# semodule -X 300 -i my-qemusystemx86.pp

Additional Information:
Source Context                unconfined_u:unconfined_r:svirt_t:s0:c414,c589
Target Context                unconfined_u:unconfined_r:svirt_t:s0:c414,c589
Target Objects                Unknown [ process ]
Source                        qemu-system-x86
Source Path                   qemu-system-x86
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.14.3-32.fc30.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 5.0.9-301.fc30.x86_64 #1 SMP Tue
                              Apr 23 23:57:35 UTC 2019 x86_64 x86_64
Alert Count                   6
First Seen                    2019-05-02 14:31:19 EDT
Last Seen                     2019-05-02 14:31:40 EDT
Local ID                      2c4a6e54-b93d-4559-8263-35bb9f7251b0

Raw Audit Messages
type=AVC msg=audit(1556821900.466:362): avc:  denied  { execmem } for  pid=8492 comm="qemu-system-x86" scontext=unconfined_u:unconfined_r:svirt_t:s0:c414,c589 tcontext=unconfined_u:unconfined_r:svirt_t:s0:c414,c589 tclass=process permissive=0


Hash: qemu-system-x86,svirt_t,svirt_t,process,execmem

Version-Release number of selected component:
selinux-policy-3.14.3-32.fc30.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.10.0
hashmarkername: setroubleshoot
kernel:         5.0.9-301.fc30.x86_64
type:           libreport

Potential duplicate: bug 1159823

Comment 1 Zdenek Pytela 2019-05-03 07:00:26 UTC
Hi,

Thank you for reporting the issue. The execmem permission is required for mapping a memory region as executable which is not common and is possibly insecure so it is disabled by default. It can be turned on for virtualization domains using the virt_use_execmem boolean:

# semanage boolean -l | grep virt_use_execmem
virt_use_execmem               (off  ,  off)  Allow confined virtual guests to use executable memory and executable stack

However, before doing that you should investigate on the root cause as this permission should not be required. We do not have any direct clue, but given the data in bz 1705685, we can conclude you are using nvidia with proprietary drivers which may require this permission. Please check with the drivers vendor for next recommended steps, it can be done by design as well as a result of a bug in the code.

One of other possible solutions may be using svirt_tcg_t domain. You can also consider using default Xorg drivers which do not require this permission.

Closing as NOTABUG. Feel free to reopen the bugzilla if the issue turns out to have a different root cause.

Comment 2 Akarshan Biswas 2019-05-07 13:42:21 UTC
Description of problem:
Happens whenever I start vm with GPU acceleration on.

Version-Release number of selected component:
selinux-policy-3.14.3-32.fc30.noarch

Additional info:
reporter:       libreport-2.10.0
hashmarkername: setroubleshoot
kernel:         5.0.10-300.fc30.x86_64
type:           libreport

Comment 3 Kim 2019-05-31 17:30:47 UTC
Description of problem:
Starrted Boxes

Version-Release number of selected component:
selinux-policy-3.14.3-37.fc30.noarch

Additional info:
reporter:       libreport-2.10.0
hashmarkername: setroubleshoot
kernel:         5.0.17-300.fc30.x86_64
type:           libreport

Comment 4 Jakub Pisarczyk 2019-07-25 20:49:27 UTC
Description of problem:
I try to create new machine in Boxes 

Version-Release number of selected component:
selinux-policy-3.14.3-41.fc30.noarch

Additional info:
reporter:       libreport-2.10.1
hashmarkername: setroubleshoot
kernel:         5.1.18-300.fc30.x86_64
type:           libreport

Comment 5 Miro Hrončok 2019-07-26 09:33:53 UTC
Let me repurpose this bug.

I am having those AVC denials when running any Fedora in GNOME Boxes.


gnome-boxes-3.32.1-2.fc30.x86_64
ipxe-roms-qemu-20190125-1.git36a4c85f.fc30.noarch
libvirt-daemon-config-network-5.1.0-9.fc30.x86_64
libvirt-daemon-driver-interface-5.1.0-9.fc30.x86_64
libvirt-daemon-driver-network-5.1.0-9.fc30.x86_64
libvirt-daemon-driver-nodedev-5.1.0-9.fc30.x86_64
libvirt-daemon-driver-nwfilter-5.1.0-9.fc30.x86_64
libvirt-daemon-driver-qemu-5.1.0-9.fc30.x86_64
libvirt-daemon-driver-secret-5.1.0-9.fc30.x86_64
libvirt-daemon-driver-storage-core-5.1.0-9.fc30.x86_64
libvirt-daemon-driver-storage-disk-5.1.0-9.fc30.x86_64
libvirt-daemon-driver-storage-gluster-5.1.0-9.fc30.x86_64
libvirt-daemon-driver-storage-iscsi-direct-5.1.0-9.fc30.x86_64
libvirt-daemon-driver-storage-iscsi-5.1.0-9.fc30.x86_64
libvirt-daemon-driver-storage-logical-5.1.0-9.fc30.x86_64
libvirt-daemon-driver-storage-mpath-5.1.0-9.fc30.x86_64
libvirt-daemon-driver-storage-rbd-5.1.0-9.fc30.x86_64
libvirt-daemon-driver-storage-scsi-5.1.0-9.fc30.x86_64
libvirt-daemon-driver-storage-sheepdog-5.1.0-9.fc30.x86_64
libvirt-daemon-driver-storage-zfs-5.1.0-9.fc30.x86_64
libvirt-daemon-driver-storage-5.1.0-9.fc30.x86_64
libvirt-daemon-kvm-5.1.0-9.fc30.x86_64
libvirt-daemon-5.1.0-9.fc30.x86_64
libvirt-gconfig-2.0.0-3.fc30.x86_64
libvirt-glib-2.0.0-3.fc30.x86_64
libvirt-gobject-2.0.0-3.fc30.x86_64
libvirt-libs-5.1.0-9.fc30.x86_64
qemu-audio-alsa-3.1.0-9.fc30.x86_64
qemu-audio-oss-3.1.0-9.fc30.x86_64
qemu-audio-pa-3.1.0-9.fc30.x86_64
qemu-audio-sdl-3.1.0-9.fc30.x86_64
qemu-block-curl-3.1.0-9.fc30.x86_64
qemu-block-dmg-3.1.0-9.fc30.x86_64
qemu-block-iscsi-3.1.0-9.fc30.x86_64
qemu-block-nfs-3.1.0-9.fc30.x86_64
qemu-block-rbd-3.1.0-9.fc30.x86_64
qemu-block-ssh-3.1.0-9.fc30.x86_64
qemu-common-3.1.0-9.fc30.x86_64
qemu-guest-agent-3.1.0-9.fc30.x86_64
qemu-img-3.1.0-9.fc30.x86_64
qemu-kvm-3.1.0-9.fc30.x86_64
qemu-system-x86-core-3.1.0-9.fc30.x86_64
qemu-system-x86-3.1.0-9.fc30.x86_64
qemu-ui-curses-3.1.0-9.fc30.x86_64
qemu-ui-gtk-3.1.0-9.fc30.x86_64
qemu-ui-sdl-3.1.0-9.fc30.x86_64
rubygem-fog-libvirt-0.5.0-3.fc30.noarch
rubygem-ruby-libvirt-0.7.1-5.fc30.x86_64
vagrant-libvirt-0.0.45-1.fc30.noarch


1. Add a new machine
2. Select any Fedora
3. Start

During the GRUB menu, the window is somewhat "ugly" transparent.

GNOME Boxes asks: Experiencing graphics problems? Disable 3D acceleration.
AVC Denial popup.

Here is everything on a video: https://www.youtube.com/watch?v=JaxQhjAtIgE

According to SELinux maintainers, "this permission should not be required".

BTW I'm not using nvidia drivers (I have Intel graphics).

Comment 6 Lukas Vrabec 2019-07-29 12:27:01 UTC
*** Bug 1714847 has been marked as a duplicate of this bug. ***

Comment 7 redhat 2019-08-02 12:56:29 UTC
Description of problem:
1. I open Gnome Boxes
2. I let gnome boxes download and run the Fedora Workstation 30 image
3. During the start I got some SELinux denials including this one.

When checking the issue, I ran `sudo restorecon -Rv ~/.cache/gnome-boxes` but since it didn't "restore" any context labels, this appears not to be a problem from my setup.

Version-Release number of selected component:
selinux-policy-3.14.3-42.fc30.noarch

Additional info:
reporter:       libreport-2.10.1
hashmarkername: setroubleshoot
kernel:         5.1.19-300.fc30.x86_64
type:           libreport

Comment 8 Chris Sharp 2019-08-12 14:25:26 UTC
Description of problem:
I started a Windows 10 guest in gnome-boxes

Version-Release number of selected component:
selinux-policy-3.14.3-42.fc30.noarch

Additional info:
reporter:       libreport-2.10.1
hashmarkername: setroubleshoot
kernel:         5.1.20-300.fc30.x86_64
type:           libreport

Comment 9 Lukas Vrabec 2019-08-15 15:39:51 UTC
*** Bug 1740926 has been marked as a duplicate of this bug. ***

Comment 10 jcallaha 2019-09-06 21:19:18 UTC
Description of problem:
Previously working fine. However, now whenever I try to start this VM, using boxes, I get terrible graphics issues and multiple avc denials.

Version-Release number of selected component:
selinux-policy-3.14.3-45.fc30.noarch

Additional info:
reporter:       libreport-2.10.1
hashmarkername: setroubleshoot
kernel:         5.2.11-200.fc30.x86_64
type:           libreport

Comment 11 jcallaha 2019-09-06 21:22:33 UTC
Interestingly enough, this doesn't happen on my vm that is a RHEL 8 snapshot.

Comment 12 jcallaha 2019-09-09 15:16:35 UTC
Reverting that vm to a previous snapshot fixed the issue.

Comment 13 Kamil Páral 2019-09-13 12:33:03 UTC
Description of problem:
This happens when I enable 3D acceleration in virt-manager (using spice+qxl).

Version-Release number of selected component:
selinux-policy-3.14.3-45.fc30.noarch

Additional info:
reporter:       libreport-2.10.1
hashmarkername: setroubleshoot
kernel:         5.2.14-200.fc30.x86_64
type:           libreport

Comment 14 dani 2019-09-19 09:41:22 UTC
Description of problem:
Using virt-manager to setup and start a new guest vm in kvm/qemu connection.

Version-Release number of selected component:
selinux-policy-3.14.3-45.fc30.noarch

Additional info:
reporter:       libreport-2.10.1
hashmarkername: setroubleshoot
kernel:         5.2.14-200.fc30.x86_64
type:           libreport

Comment 15 Ben Cotton 2020-04-30 21:02:35 UTC
This message is a reminder that Fedora 30 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 30 on 2020-05-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 '30'.

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 30 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 16 Ben Cotton 2020-05-26 14:29:21 UTC
Fedora 30 changed to end-of-life (EOL) status on 2020-05-26. Fedora 30 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.


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