RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1125165 - EPEL7 package varnish is prohibited from starting
Summary: EPEL7 package varnish is prohibited from starting
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.0
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Miroslav Grepl
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-31 08:35 UTC by Ingvar Hagelund
Modified: 2015-03-05 10:42 UTC (History)
2 users (show)

Fixed In Version: selinux-policy-3.13.1-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 10:42:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0458 0 normal SHIPPED_LIVE selinux-policy bug fix and enhancement update 2015-03-05 15:17:00 UTC

Description Ingvar Hagelund 2014-07-31 08:35:06 UTC
Description of problem:
Newly built EPEL7 package varnish-4.0.1-2.el7 is prohibited from starting by selinux. This was only tested on CentOS7, but I think the results would be the same on RHEL7.

Version-Release number of selected component (if applicable):
selinux-policy-3.12.1-153.el7_0.10.noarch

How reproducible:
Always

Steps to Reproduce:
1. Install varnish-4.0.1-2.el7

If not available on mirrors yet, the build is here: http://koji.fedoraproject.org/koji/buildinfo?buildID=549140

2. systemctl start varnish.service; systemctl status varnish.service
3. setenforce 0
4. systemctl start varnish.service; systemctl status varnish.service

Actual results:
Varnish does not start unless selinux enforcement is turned off

Expected results:
Varnish should be allowed to start


Additional info:

I think it's a bit strange I don't see this on f19. I haven't tested on f20 yet.

This is the culprit:

varnishd[20364]: Failed to set permissions on ./vcl.UdrgPE5O.so: Operation not permitted

sealert output:

[root@centos7 audit]# sealert -a audit.log
 38% done'list' object has no attribute 'split'
100% done
found 1 alerts in audit.log
--------------------------------------------------------------------------------

SELinux is preventing /usr/sbin/varnishd from using the fowner capability.

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

If you believe that varnishd should have the fowner capability 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 varnishd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp


Additional Information:
Source Context                system_u:system_r:varnishd_t:s0
Target Context                system_u:system_r:varnishd_t:s0
Target Objects                 [ capability ]
Source                        varnishd
Source Path                   /usr/sbin/varnishd
Port                          <Unknown>
Host                          <Unknown>
Source RPM Packages           varnish-4.0.1-2.el7.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-153.el7_0.10.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     centos7
Platform                      Linux centos7 3.10.0-123.4.4.el7.x86_64 #1 SMP Fri
                              Jul 25 05:07:12 UTC 2014 x86_64 x86_64
Alert Count                   13
First Seen                    2014-07-30 09:39:30 CEST
Last Seen                     2014-07-31 10:22:20 CEST
Local ID                      4921c987-8da1-4bed-b2f4-b44521fe319e

Raw Audit Messages
type=AVC msg=audit(1406794940.879:374): avc:  denied  { fowner } for  pid=10373 comm="varnishd" capability=3  scontext=system_u:system_r:varnishd_t:s0 tcontext=system_u:system_r:varnishd_t:s0 tclass=capability


type=AVC msg=audit(1406794940.879:374): avc:  denied  { fsetid } for  pid=10373 comm="varnishd" capability=4  scontext=system_u:system_r:varnishd_t:s0 tcontext=system_u:system_r:varnishd_t:s0 tclass=capability


type=SYSCALL msg=audit(1406794940.879:374): arch=x86_64 syscall=chmod success=yes exit=0 a0=7fff14bcad00 a1=1ed a2=0 a3=0 items=0 ppid=1 pid=10373 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=varnishd exe=/usr/sbin/varnishd subj=system_u:system_r:varnishd_t:s0 key=(null)

Hash: varnishd,varnishd_t,varnishd_t,capability,fowner

Comment 2 Milos Malik 2014-07-31 13:15:24 UTC
Seen on my virtual machine in enforcing mode:
----
time->Thu Jul 31 15:11:41 2014
type=PATH msg=audit(1406812301.471:842): item=0 name="./vcl.CNkoGA3g.so" inode=9687604 dev=fd:03 mode=0100711 ouid=989 ogid=988 rdev=00:00 obj=system_u:object_r:varnishd_var_lib_t:s0 objtype=NORMAL
type=CWD msg=audit(1406812301.471:842):  cwd="/var/lib/varnish/rhel70vm"
type=SYSCALL msg=audit(1406812301.471:842): arch=c000003e syscall=90 success=yes exit=0 a0=7fff5567c090 a1=1ed a2=0 a3=0 items=1 ppid=1 pid=23443 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="varnishd" exe="/usr/sbin/varnishd" subj=system_u:system_r:varnishd_t:s0 key=(null)
type=AVC msg=audit(1406812301.471:842): avc:  denied  { fsetid } for  pid=23443 comm="varnishd" capability=4  scontext=system_u:system_r:varnishd_t:s0 tcontext=system_u:system_r:varnishd_t:s0 tclass=capability
----
time->Thu Jul 31 15:11:48 2014
type=PATH msg=audit(1406812308.082:845): item=0 name="./vcl.Smc3ieVX.so" inode=9687604 dev=fd:03 mode=0100711 ouid=989 ogid=988 rdev=00:00 obj=system_u:object_r:varnishd_var_lib_t:s0 objtype=NORMAL
type=CWD msg=audit(1406812308.082:845):  cwd="/var/lib/varnish/rhel70vm"
type=SYSCALL msg=audit(1406812308.082:845): arch=c000003e syscall=90 success=yes exit=0 a0=7fff3616b6d0 a1=1ed a2=0 a3=0 items=1 ppid=1 pid=24199 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="varnishd" exe="/usr/sbin/varnishd" subj=system_u:system_r:varnishd_t:s0 key=(null)
type=AVC msg=audit(1406812308.082:845): avc:  denied  { fsetid } for  pid=24199 comm="varnishd" capability=4  scontext=system_u:system_r:varnishd_t:s0 tcontext=system_u:system_r:varnishd_t:s0 tclass=capability
----

Comment 5 Ingvar Hagelund 2014-12-09 12:18:49 UTC
At least three extra system calls are needed for varnishd, that is chown, fowner and fsetid. These were all added through selinux-policy-3.13.1-64. A recompile of 3.13.1-64.fc21 from https://koji.fedoraproject.org/koji/buildinfo?buildID=543958 makes varnish work on el7.

While this changes are missing in downstream el7, varnish for epel7 will not work properly.

Ingvar

Comment 7 errata-xmlrpc 2015-03-05 10:42:28 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0458.html


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