Bug 759927

Summary: SELinux is preventing /usr/libexec/kde4/kwin_opengl_test from using the 'execmem' accesses on a process.
Product: [Fedora] Fedora Reporter: Christopher Antila <christopher>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 15CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:3ea8d2073a6847a3514f1cb4f1f4c429758a050c5610c907c9d0ec656d48c78a
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-05 20:46:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Christopher Antila 2011-12-04 22:09:26 UTC
SELinux is preventing /usr/libexec/kde4/kwin_opengl_test from using the 'execmem' accesses on a process.

*****  Plugin catchall_boolean (47.5 confidence) suggests  *******************

If you want to allow unconfined executables to make their stack executable.  This should never, ever be necessary. Probably indicates a badly coded executable, but could indicate an attack. This executable should be reported in bugzilla
Then you must tell SELinux about this by enabling the 'allow_execstack' boolean.
Do
setsebool -P allow_execstack 1

*****  Plugin catchall_boolean (47.5 confidence) suggests  *******************

If you want to allow unconfined executables to map a memory region as both executable and writable, this is dangerous and the executable should be reported in bugzilla
Then you must tell SELinux about this by enabling the 'allow_execmem' boolean.
Do
setsebool -P allow_execmem 1

*****  Plugin catchall (6.38 confidence) suggests  ***************************

If you believe that kwin_opengl_test should be allowed execmem access on processes labeled unconfined_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 kwin_opengl_tes /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1
                              023
Target Context                unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1
                              023
Target Objects                Unknown [ process ]
Source                        kwin_opengl_tes
Source Path                   /usr/libexec/kde4/kwin_opengl_test
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           firefox-8.0-3.fc15
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-48.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed)
                              2.6.41.1-1.fc15.x86_64 #1 SMP Fri Nov 11 21:36:28
                              UTC 2011 x86_64 x86_64
Alert Count                   31
First Seen                    Sun 04 Dec 2011 05:01:50 PM EST
Last Seen                     Sun 04 Dec 2011 05:04:02 PM EST
Local ID                      617c519e-e50f-4e89-8bb1-9f460d74cf0c

Raw Audit Messages
type=AVC msg=audit(1323036242.571:264): avc:  denied  { execmem } for  pid=11839 comm="firefox" scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=process


type=SYSCALL msg=audit(1323036242.571:264): arch=x86_64 syscall=mmap success=no exit=EACCES a0=0 a1=10000 a2=7 a3=22 items=0 ppid=11491 pid=11839 auid=1000 uid=1000 gid=1000 euid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 tty=(none) ses=7 comm=firefox exe=/usr/lib64/firefox/firefox subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null)

Hash: kwin_opengl_tes,unconfined_t,unconfined_t,process,execmem

audit2allow

#============= unconfined_t ==============
#!!!! This avc is allowed in the current policy

allow unconfined_t self:process execmem;

audit2allow -R

#============= unconfined_t ==============
#!!!! This avc is allowed in the current policy

allow unconfined_t self:process execmem;

Comment 1 Christopher Antila 2011-12-04 22:13:46 UTC
This report specifies Firefox, but kwin_opengl_test must happen for other reasons. I had this error in the Troubleshooter *before* I opened Firefox to, as it happens, search for a pre-existing version of this bug.

Comment 2 Daniel Walsh 2011-12-05 20:46:54 UTC
It looks like it is allowed for now.

# setsebool -P allow_execmem 1

To make sure.