Bug 1116519 - SELinux is preventing /usr/bin/qemu-system-x86_64 from using the 'execstack' accesses on a process.
Summary: SELinux is preventing /usr/bin/qemu-system-x86_64 from using the 'execstack' ...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: rawhide
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:ad121b522416f89af33defa195c...
: 1131908 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-05 18:44 UTC by Joachim Frieben
Modified: 2014-08-25 14:10 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-07-08 15:25:22 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Joachim Frieben 2014-07-05 18:44:51 UTC
Description of problem:
SELinux is preventing /usr/bin/qemu-system-x86_64 from using the 'execstack' 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.
You can read 'None' man page for more details.
Do
setsebool -P virt_use_execmem 1

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

If you believe that qemu-system-x86_64 should be allowed execstack 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:
# 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:c66,c720
Target Context                unconfined_u:unconfined_r:svirt_t:s0:c66,c720
Target Objects                Unknown [ process ]
Source                        qemu-system-x86
Source Path                   /usr/bin/qemu-system-x86_64
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           qemu-system-x86-2.1.0-0.1.rc0.fc21.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-63.fc21.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.16.0-0.rc3.git3.1.fc21.x86_64 #1
                              SMP Fri Jul 4 15:23:59 UTC 2014 x86_64 x86_64
Alert Count                   1
First Seen                    2014-07-05 20:42:38 CEST
Last Seen                     2014-07-05 20:42:38 CEST
Local ID                      3f44cb9d-0949-4e4a-954f-754d5308c673

Raw Audit Messages
type=AVC msg=audit(1404585758.224:940): avc:  denied  { execstack } for  pid=8296 comm="qemu-system-x86" scontext=unconfined_u:unconfined_r:svirt_t:s0:c66,c720 tcontext=unconfined_u:unconfined_r:svirt_t:s0:c66,c720 tclass=process permissive=0


type=SYSCALL msg=audit(1404585758.224:940): arch=x86_64 syscall=mprotect success=no exit=EACCES a0=7fffeeab2000 a1=1000 a2=1000007 a3=7f4508f03a60 items=0 ppid=1 pid=8296 auid=1001 uid=1001 gid=100 euid=1001 suid=1001 fsuid=1001 egid=100 sgid=100 fsgid=100 tty=(none) ses=10 comm=qemu-system-x86 exe=/usr/bin/qemu-system-x86_64 subj=unconfined_u:unconfined_r:svirt_t:s0:c66,c720 key=(null)

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

Version-Release number of selected component:
selinux-policy-3.13.1-63.fc21.noarch

Additional info:
reporter:       libreport-2.2.2
hashmarkername: setroubleshoot
kernel:         3.16.0-0.rc3.git3.1.fc21.x86_64
type:           libreport

Comment 1 Daniel Walsh 2014-07-08 15:25:22 UTC
Either you have a bad library on your disk or you need to set the virt_use_execmem boolean on.


*****  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.
You can read 'None' man page for more details.
Do
setsebool -P virt_use_execmem 1

Comment 2 Miroslav Grepl 2014-08-20 12:55:48 UTC
*** Bug 1131908 has been marked as a duplicate of this bug. ***

Comment 3 Mikhail 2014-08-22 15:42:09 UTC
Don't understand why it occurs today with me.

Comment 4 Daniel Walsh 2014-08-22 20:13:27 UTC
So this was working and today it broke?

Comment 5 Mikhail 2014-08-23 06:31:23 UTC
Yes, right. I have not seen this alert earlier. Today, the alert started to steadily appear each time you start the virtual machine.

Demonstration: https://drive.google.com/file/d/0B0nwzlfiB4aQcl8zY2xFOE9pTjg/edit?usp=sharing

Comment 6 Mikhail 2014-08-23 09:17:04 UTC
Very strange, today I receive selinux-policy 3.12.1-181 and after reboot I don't see this alert again. What happens?

Comment 7 Daniel Walsh 2014-08-24 11:15:06 UTC
getsebool virt_use_execmem

Comment 8 Mikhail 2014-08-24 11:16:49 UTC
[root@localhost ~]# getsebool virt_use_execmem
virt_use_execmem --> off

Comment 9 Daniel Walsh 2014-08-25 13:13:09 UTC
Are your vms running with qemu-system or with qemu-kvm?

Comment 10 Mikhail 2014-08-25 13:15:55 UTC
(In reply to Daniel Walsh from comment #9)
> Are your vms running with qemu-system or with qemu-kvm?
qemu-system

Comment 11 Miroslav Grepl 2014-08-25 13:17:39 UTC
Any chance there was a qemu update?

Comment 12 Mikhail 2014-08-25 14:10:08 UTC
(In reply to Miroslav Grepl from comment #11)
> Any chance there was a qemu update?

[root@localhost ~]# cat /var/log/dnf.log | grep qemu | tail
 qemu-kvm                                                    x86_64                             2:1.6.2-7.fc20                                                   updates-testing                              44 k
 qemu-guest-agent                                            x86_64                             2:1.6.2-7.fc20                                                   updates-testing                             141 k
 qemu-img                                                    x86_64                             2:1.6.2-7.fc20                                                   updates-testing                             485 k
Jul 19 15:15:53 SUBDEBUG /var/cache/dnf/x86_64/20/updates-testing/packages/qemu-common-1.6.2-7.fc20.x86_64.rpm removed
Jul 19 15:15:53 SUBDEBUG /var/cache/dnf/x86_64/20/updates-testing/packages/qemu-system-x86-1.6.2-7.fc20.x86_64.rpm removed
Jul 19 15:15:53 SUBDEBUG /var/cache/dnf/x86_64/20/updates-testing/packages/qemu-img-1.6.2-7.fc20.x86_64.rpm removed
Jul 19 15:15:53 SUBDEBUG /var/cache/dnf/x86_64/20/updates-testing/packages/qemu-guest-agent-1.6.2-7.fc20.x86_64.rpm removed
Jul 19 15:15:53 SUBDEBUG /var/cache/dnf/x86_64/20/updates-testing/packages/qemu-kvm-1.6.2-7.fc20.x86_64.rpm removed
  qemu-common.x86_64 2:1.6.2-7.fc20                                    qemu-system-x86.x86_64 2:1.6.2-7.fc20                                 qemu-kvm.x86_64 2:1.6.2-7.fc20                                        
  qemu-guest-agent.x86_64 2:1.6.2-7.fc20                               qemu-img.x86_64 2:1.6.2-7.fc20                                        qt.x86_64 1:4.8.6-9.fc20.1


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