Bug 725209

Summary: SELinux is preventing /usr/bin/perl from 'setattr' accesses on the directory /var/cache/fontconfig.
Product: [Fedora] Fedora Reporter: Jeff Raber <jeff.raber>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA 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:021af142272f9e13ca0d2436ae2a30f9bd271c3655e6406bff42aaf7269b1aff
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-09-06 10:37:42 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 Jeff Raber 2011-07-24 07:47:50 UTC
SELinux is preventing /usr/bin/perl from 'setattr' accesses on the directory /var/cache/fontconfig.

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

If you believe that perl should be allowed setattr access on the fontconfig 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:
# grep graph.cgi /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:httpd_t:s0
Target Context                system_u:object_r:fonts_cache_t:s0
Target Objects                /var/cache/fontconfig [ dir ]
Source                        graph.cgi
Source Path                   /usr/bin/perl
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           perl-5.12.4-159.fc15
Target RPM Packages           fontconfig-2.8.0-3.fc15
Policy RPM                    selinux-policy-3.9.16-34.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed)
                              2.6.38.8-35.fc15.x86_64 #1 SMP Wed Jul 6 13:58:54
                              UTC 2011 x86_64 x86_64
Alert Count                   656
First Seen                    Sun 24 Jul 2011 02:11:11 AM CDT
Last Seen                     Sun 24 Jul 2011 02:44:56 AM CDT
Local ID                      e748356b-ef3a-491b-88d9-19cf3815bc0e

Raw Audit Messages
type=AVC msg=audit(1311493496.935:1479): avc:  denied  { setattr } for  pid=32543 comm="graph.cgi" name="fontconfig" dev=dm-0 ino=2759 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:fonts_cache_t:s0 tclass=dir


type=SYSCALL msg=audit(1311493496.935:1479): arch=x86_64 syscall=chmod success=no exit=EACCES a0=1516560 a1=1ed a2=d a3=1 items=0 ppid=30584 pid=32543 auid=4294967295 uid=48 gid=487 euid=48 suid=48 fsuid=48 egid=487 sgid=487 fsgid=487 tty=(none) ses=4294967295 comm=graph.cgi exe=/usr/bin/perl subj=system_u:system_r:httpd_t:s0 key=(null)

Hash: graph.cgi,httpd_t,fonts_cache_t,dir,setattr

audit2allow

#============= httpd_t ==============
allow httpd_t fonts_cache_t:dir setattr;

audit2allow -R

#============= httpd_t ==============
allow httpd_t fonts_cache_t:dir setattr;

Comment 1 Jeff Raber 2011-07-24 07:51:32 UTC
I installed the package 'collectd-web' (some dependencies were installed too).

The alert appeared when I accessed the webpage provided by the package.



-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 2 Miroslav Grepl 2011-07-25 14:19:43 UTC
It looks like we will need a policy for 'collectd-web'

Comment 3 Daniel Walsh 2011-07-25 15:29:18 UTC
I just wrote a policy for collectd in Rawhide.

Comment 4 Daniel Walsh 2011-07-25 15:29:46 UTC
Totally untested, but enough to start and stop the service.

Comment 5 Miroslav Grepl 2011-08-04 09:23:40 UTC
Backported to selinux-policy-3.9.16-37.fc15