Bug 1192698 - SElinux is preventing /usr/bin/motion from using the execstack access on a process
Summary: SElinux is preventing /usr/bin/motion from using the execstack access on a pr...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted
Version: 21
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-14 11:30 UTC by zimon
Modified: 2015-12-02 17:26 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-12-02 09:03:15 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description zimon 2015-02-14 11:30:22 UTC
Description of problem:
motion (web camera motion triggered recording) won't run.

Version-Release number of selected component (if applicable):
motion-3.3.0.trunkREV557-10.fc21.x86_64

How reproducible:
Always

Steps to Reproduce:
1. systemctl start motion

Actual results:
Feb 14 13:24:56 localhost systemd[1]: motion.service: main process exited, code=exited, status=127/n/a
Feb 14 13:24:56 localhost systemd[1]: Unit motion.service entered failed state.
Feb 14 13:24:56 localhost systemd[1]: motion.service failed.


Expected results:
Started working motion (web camera motion triggered recording service)

I don't understand yet why motion would need execstack access though. Maybe bug in a motion rather than in Fedora SElinux labels(?).

Additional info:
$ sealert -l xxx

SELinux is preventing /usr/bin/motion from using the execstack access on a process.

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

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


Additional Information:
Source Context                system_u:system_r:motion_t:s0
Target Context                system_u:system_r:motion_t:s0
Target Objects                Unknown [ process ]
Source                        motion
Source Path                   /usr/bin/motion
Port                          <Unknown>
Host                          localhost
Source RPM Packages           motion-3.3.0.trunkREV557-10.fc21.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-105.3.fc21.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     localhost
Platform                      Linux localhost 3.18.6-200.fc21.x86_64 #1 SMP Fri Feb
                              6 22:59:42 UTC 2015 x86_64 x86_64
Alert Count                   53
First Seen                    2015-02-07 21:34:29 EET
Last Seen                     2015-02-14 02:51:53 EET

Raw Audit Messages
type=AVC msg=audit(1423875113.913:974): avc:  denied  { execstack } for  pid=13268 comm="motion" scontext=system_u:system_r:motion_t:s0 tcontext=system_u:system_r:motion_t:s0 tclass=process permissive=0


type=SYSCALL msg=audit(1423875113.913:974): arch=x86_64 syscall=mprotect success=no exit=EACCES a0=7fff23136000 a1=1000 a2=1000007 a3=34cfe1e2f0 items=0 ppid=1 pid=13268 auid=4294967295 uid=491 gid=39 euid=491 suid=491 fsuid=491 egid=39 sgid=39 fsgid=39 tty=(none) ses=4294967295 comm=motion exe=/usr/bin/motion subj=system_u:system_r:motion_t:s0 key=(null)

Hash: motion,motion_t,motion_t,process,execstack

Comment 1 zimon 2015-02-14 11:40:30 UTC
libOpenCL seems to be to blame:

$ ldd /usr/bin/motion | perl -ane 'print $F[2],"\n";' | xargs execstack -q | grep X
X /usr/lib64/nvidia-304xx/libOpenCL.so.1


$ rpm -qf /usr/lib64/nvidia-304xx/libOpenCL.so.1
xorg-x11-drv-nvidia-304xx-libs-304.125-1.fc21.x86_64

Comment 2 zimon 2015-02-17 18:36:13 UTC
Also, after I allowed that execstack SELinux-access for motion, I got another SELinux permission denied notification:

Feb 17 20:24:39 localhost motion[5803]: /usr/bin/motion: error while loading shared libraries: libOpenCL.so.1: cannot enable executable stack as shared object requires: Permission denied
Feb 17 20:24:40 localhost python[5805]: SELinux is preventing /usr/bin/motion from using the execmem access on a process.

After allowing that also, then:

Feb 17 20:31:16 localhost python[20556]: SELinux is preventing /usr/bin/motion from read access on the chr_file urandom.

"
$ sealert -l XXXXXXXXXXX
SELinux is preventing /usr/bin/motion from read access on the chr_file urandom.
If you want to enable reading of urandom for all domains.
Then you must tell SELinux about this by enabling the 'global_ssp' boolean.
You can read 'None' man page for more details.
Do
setsebool -P global_ssp 1

Additional Information:
Source Context                system_u:system_r:motion_t:s0
Target Context                system_u:object_r:urandom_device_t:s0
Target Objects                urandom [ chr_file ]
Source                        motion
Source Path                   /usr/bin/motion
Port                          <Unknown>
Host                          localhost
Source RPM Packages           motion-3.3.0.trunkREV557-10.fc21.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-105.3.fc21.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     localhost
Platform                      Linux localhost 3.18.6-200.fc21.x86_64 #1 SMP Fri Feb
                              6 22:59:42 UTC 2015 x86_64 x86_64
Alert Count                   1
First Seen                    2015-02-17 20:31:15 EET
Last Seen                     2015-02-17 20:31:15 EET
...
Raw Audit Messages
type=AVC msg=audit(1424197875.771:12989): avc:  denied  { read } for  pid=28128 comm="motion" name="urandom" dev="devtmpfs" ino=1033 scontext=system_u:system_r:motion_t:s0 tcontext=system_u:object_r:urandom_device_t:s0 tclass=chr_file permissive=0

type=SYSCALL msg=audit(1424197875.771:12989): arch=x86_64 syscall=open success=no exit=EACCES a0=3dba8f2d90 a1=0 a2=0 a3=11f items=0 ppid=1 pid=28128 auid=4294967295 uid=491 gid=39 euid=491 suid=491 fsuid=491 egid=39 sgid=39 fsgid=39 tty=(none) ses=4294967295 comm=motion exe=/usr/bin/motion subj=system_u:system_r:motion_t:s0 key=(null)

Hash: motion,motion_t,urandom_device_t,chr_file,read
"

Comment 3 Fedora End Of Life 2015-11-04 13:34:12 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. 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 '21'.

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 21 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 4 Fedora End Of Life 2015-12-02 09:03:17 UTC
Fedora 21 changed to end-of-life (EOL) status on 2015-12-01. Fedora 21 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.