Bug 1404170 - SELinux is preventing sx.fcgi
Summary: SELinux is preventing sx.fcgi
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: skylable-sx
Version: 25
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Török Edwin
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-13 09:20 UTC by mfs-it2
Modified: 2017-12-12 10:41 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-12-12 10:41:46 UTC
Type: Bug


Attachments (Terms of Use)

Description mfs-it2 2016-12-13 09:20:47 UTC
Description of problem:
sx.fcgi triggers SELinux


Version-Release number of selected component (if applicable):
skylable-sx-2.3-1.fc25.x86_64
selinux-policy-targeted-3.13.1-225.1.fc25.noarch
selinux-policy-3.13.1-225.1.fc25.noarch


How reproducible:
Just install skylable-sx and try to get it running


Steps to Reproduce:
1. dnf install skylable-sx
2. sxsetup
3. systemctl restart sxserver


Actual results:

[output cut from `sealert -a /var/log/audit/audit.log | less']

SELinux is preventing sx.fcgi from unlink access on the file sem.etilqs-99-ca01-cc0848-0.

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

If you believe that sx.fcgi should be allowed unlink access on the sem.etilqs-99-ca01-cc0848-0 file 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 'sx.fcgi' --raw | audit2allow -M my-sxfcgi
# semodule -X 300 -i my-sxfcgi.pp


Additional Information:
Source Context                system_u:system_r:sxserver_t:s0
Target Context                system_u:object_r:tmpfs_t:s0
Target Objects                sem.etilqs-99-ca01-cc0848-0 [ file ]
Source                        sx.fcgi
Source Path                   sx.fcgi
Port                          <Unknown>
Host                          <Unknown>
Source RPM Packages
Target RPM Packages
Policy RPM                    selinux-policy-3.13.1-225.1.fc25.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     test1.fedora
Platform                      Linux test1.fedora 4.8.12-300.fc25.x86_64 #1 SMP
                              Fri Dec 2 17:52:11 UTC 2016 x86_64 x86_64
Alert Count                   1
First Seen                    2016-12-13 09:51:37 CET
Last Seen                     2016-12-13 09:51:37 CET
Local ID                      3de4d1b2-9595-44ab-80a4-f9305d6f9b75

Raw Audit Messages
type=AVC msg=audit(1481619097.792:786): avc:  denied  { unlink } for  pid=16703 comm="sx.fcgi" name="sem.etilqs-99-ca01-cc0848-0" dev="tmpfs" ino=92267 scontext=system_u:system_r:sxserver_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=file permissive=1


Hash: sx.fcgi,sxserver_t,tmpfs_t,file,unlink
--------------------------------------------------------------------------------

SELinux is preventing sx.fcgi from add_name access on the directory I45DdR.

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

If you believe that sx.fcgi should be allowed add_name access on the I45DdR directory 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 'sx.fcgi' --raw | audit2allow -M my-sxfcgi
# semodule -X 300 -i my-sxfcgi.pp


Additional Information:
Source Context                system_u:system_r:sxserver_t:s0
Target Context                system_u:object_r:tmpfs_t:s0
Target Objects                I45DdR [ dir ]
Source                        sx.fcgi
Source Path                   sx.fcgi
Port                          <Unknown>
Host                          <Unknown>
Source RPM Packages
Target RPM Packages
Policy RPM                    selinux-policy-3.13.1-225.1.fc25.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     test1.fedora
Platform                      Linux test1.fedora 4.8.12-300.fc25.x86_64 #1 SMP
                              Fri Dec 2 17:52:11 UTC 2016 x86_64 x86_64
Alert Count                   1
First Seen                    2016-12-13 09:51:39 CET
Last Seen                     2016-12-13 09:51:39 CET
Local ID                      15f3a923-a61c-46a1-85d2-8036c3290421

Raw Audit Messages
type=AVC msg=audit(1481619099.476:794): avc:  denied  { add_name } for  pid=16927 comm="sx.fcgi" name="I45DdR" scontext=system_u:system_r:sxserver_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=dir permissive=1


Hash: sx.fcgi,sxserver_t,tmpfs_t,dir,add_name

--------------------------------------------------------------------------------

SELinux is preventing sx.fcgi from create access on the file I45DdR.

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

If you believe that sx.fcgi should be allowed create access on the I45DdR file 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 'sx.fcgi' --raw | audit2allow -M my-sxfcgi
# semodule -X 300 -i my-sxfcgi.pp


Additional Information:
Source Context                system_u:system_r:sxserver_t:s0
Target Context                system_u:object_r:tmpfs_t:s0
Target Objects                I45DdR [ file ]
Source                        sx.fcgi
Source Path                   sx.fcgi
Port                          <Unknown>
Host                          <Unknown>
Source RPM Packages
Target RPM Packages
Policy RPM                    selinux-policy-3.13.1-225.1.fc25.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     test1.fedora
Platform                      Linux test1.fedora 4.8.12-300.fc25.x86_64 #1 SMP
                              Fri Dec 2 17:52:11 UTC 2016 x86_64 x86_64
Alert Count                   1
First Seen                    2016-12-13 09:51:39 CET
Last Seen                     2016-12-13 09:51:39 CET
Local ID                      46bafa1d-1161-43ee-858d-95a30fb0b78b

Raw Audit Messages
type=AVC msg=audit(1481619099.476:795): avc:  denied  { create } for  pid=16927 comm="sx.fcgi" name="I45DdR" scontext=system_u:system_r:sxserver_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=file permissive=1

Hash: sx.fcgi,sxserver_t,tmpfs_t,file,create
--------------------------------------------------------------------------------
SELinux is preventing sx.fcgi from getattr access on the file /var/lib/sxserver/storage/xfers.db.

*****  Plugin restorecon (94.8 confidence) suggests   ************************

If you want to fix the label.
/var/lib/sxserver/storage/xfers.db default label should be sxserver_var_lib_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /var/lib/sxserver/storage/xfers.db

[/cut]

Expected results:
No SELinux warnings/errors

Additional info:
Running /sbin/restorecon -v /var/lib/sxserver/storage/xfers.db fixes the above-mentioned last warning.

There are also warnings about
"SELinux is preventing sx.fcgi from remove_name access on the directory I45DdR."
"SELinux is preventing sx.fcgi from read access on the file hashfs.lock."
"SELinux is preventing sx.fcgi from link access on the file I45DdR."
"SELinux is preventing sx.fcgi from getattr access on the file /dev/shm/I45DdR."
"SELinux is preventing systemd from read access on the directory sxhttpd."
"SELinux is preventing sx.fcgi from getattr access on the filesystem /dev/shm."
"SELinux is preventing sx.fcgi from write access on the directory /dev/shm."
"SELinux is preventing sx.fcgi from 'read, write, open' accesses on the file /dev/shm/I45DdR."

Comment 1 Török Edwin 2016-12-13 12:05:47 UTC
Thanks for the report.
Looks like sxsetup will have to get patched to run restorecon, running sxadm from sxsetup doesn't get the same SELinux context as when running the sx.fcgi daemon.

Comment 2 Fedora End Of Life 2017-11-16 18:34:32 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 3 Fedora End Of Life 2017-12-12 10:41:46 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.


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