Bug 545285

Summary: SELinux is preventing /usr/sbin/httpd from using potentially mislabeled files mod_gnutls.dir.
Product: [Fedora] Fedora Reporter: Daniel <dod1450>
Component: selinux-policyAssignee: Daniel Walsh <dwalsh>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 12CC: dod1450, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:e11ddaa12a6bf483120da309cc333045bab475cb054155598dd96d3a9bfb5ad6
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-12-22 20:42:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Daniel 2009-12-08 02:31:10 UTC
Summary:

SELinux is preventing /usr/sbin/httpd from using potentially mislabeled files
mod_gnutls.dir.

Detailed Description:

SELinux has denied the httpd access to potentially mislabeled files
mod_gnutls.dir. This means that SELinux will not allow httpd to use these files.
If httpd should be allowed this access to these files you should change the file
context to one of the following types, httpd_lock_t, httpd_rw_content,
httpd_cache_t, httpd_tmpfs_t, httpd_tmp_t, httpd_squirrelmail_t,
httpd_var_lib_t, httpd_var_run_t, httpd_t, afs_cache_t, squirrelmail_spool_t,
httpd_w3c_validator_content_rw_t, httpd_user_content_rw_t, httpdcontent,
httpd_munin_content_rw_t, root_t, httpd_bugzilla_content_rw_t,
httpd_nagios_content_rw_t, httpd_sys_content_rw_t, httpd_sys_content_rw_t,
httpd_cvs_content_rw_t, httpd_git_content_rw_t, httpd_nutups_cgi_content_rw_t,
httpd_squid_content_rw_t, httpd_apcupsd_cgi_content_rw_t,
httpd_prewikka_content_rw_t, httpd_awstats_content_rw_t. Many third party apps
install html files in directories that SELinux policy cannot predict. These
directories have to be labeled with a file context which httpd can access.

Allowing Access:

If you want to change the file context of mod_gnutls.dir so that the httpd
daemon can access it, you need to execute it using semanage fcontext -a -t
FILE_TYPE 'mod_gnutls.dir'.
where FILE_TYPE is one of the following: httpd_lock_t, httpd_rw_content,
httpd_cache_t, httpd_tmpfs_t, httpd_tmp_t, httpd_squirrelmail_t,
httpd_var_lib_t, httpd_var_run_t, httpd_t, afs_cache_t, squirrelmail_spool_t,
httpd_w3c_validator_content_rw_t, httpd_user_content_rw_t, httpdcontent,
httpd_munin_content_rw_t, root_t, httpd_bugzilla_content_rw_t,
httpd_nagios_content_rw_t, httpd_sys_content_rw_t, httpd_sys_content_rw_t,
httpd_cvs_content_rw_t, httpd_git_content_rw_t, httpd_nutups_cgi_content_rw_t,
httpd_squid_content_rw_t, httpd_apcupsd_cgi_content_rw_t,
httpd_prewikka_content_rw_t, httpd_awstats_content_rw_t. You can look at the
httpd_selinux man page for additional information.

Additional Information:

Source Context                system_u:system_r:httpd_t:s0
Target Context                unconfined_u:object_r:var_t:s0
Target Objects                mod_gnutls.dir [ file ]
Source                        httpd
Source Path                   /usr/sbin/httpd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           httpd-2.2.14-1.fc12
Target RPM Packages           
Policy RPM                    selinux-policy-3.6.32-55.fc12
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   httpd_bad_labels
Host Name                     (removed)
Platform                      Linux (removed)
                              2.6.31.6-145.fc12.i686.PAE #1 SMP Sat Nov 21
                              16:12:37 EST 2009 i686 i686
Alert Count                   3
First Seen                    Sun 06 Dec 2009 08:43:42 AM PST
Last Seen                     Mon 07 Dec 2009 06:29:01 PM PST
Local ID                      ce8d74cf-36e8-422e-bf5d-f71791d13394
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1260239341.732:18): avc:  denied  { read write } for  pid=1988 comm="httpd" name="mod_gnutls.dir" dev=dm-0 ino=6683 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:var_t:s0 tclass=file

node=(removed) type=SYSCALL msg=audit(1260239341.732:18): arch=40000003 syscall=5 success=no exit=-13 a0=2894ac0 a1=88042 a2=1a4 a3=27 items=0 ppid=1987 pid=1988 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="httpd" exe="/usr/sbin/httpd" subj=system_u:system_r:httpd_t:s0 key=(null)



Hash String generated from  selinux-policy-3.6.32-55.fc12,httpd_bad_labels,httpd,httpd_t,var_t,file,read,write
audit2allow suggests:

#============= httpd_t ==============
allow httpd_t var_t:file { read write };

Comment 1 Daniel Walsh 2009-12-09 12:57:32 UTC
chcon -t httpd_cache_t -R /var/cache/mod_gnutls

Fixed in selinux-policy-3.6.32-57.fc12.noarch

Comment 2 Fedora Update System 2009-12-16 13:52:36 UTC
selinux-policy-3.6.32-59.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/selinux-policy-3.6.32-59.fc12

Comment 3 Fedora Update System 2009-12-18 04:40:54 UTC
selinux-policy-3.6.32-59.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update selinux-policy'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2009-13384

Comment 4 Fedora Update System 2009-12-23 21:30:33 UTC
selinux-policy-3.6.32-59.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.