Bug 561481 - SELinux is preventing /usr/sbin/httpd from using potentially mislabeled files .wapi.
Summary: SELinux is preventing /usr/sbin/httpd from using potentially mislabeled files...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 12
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: setroubleshoot_trace_hash:4b8d2c64c84...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-02-03 18:27 UTC by Pete Gale
Modified: 2010-02-11 14:44 UTC (History)
2 users (show)

Fixed In Version: 3.6.32-84.fc12
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-02-11 14:44:09 UTC


Attachments (Terms of Use)

Description Pete Gale 2010-02-03 18:27:01 UTC
Summary:

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

Detailed Description:

SELinux has denied the httpd access to potentially mislabeled files .wapi. 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_squirrelmail_t, squirrelmail_spool_t,
httpd_rw_content, httpd_cache_t, httpd_tmpfs_t, httpd_tmp_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, httpd_w3c_validator_content_rw_t,
httpd_user_content_rw_t, httpdcontent, httpd_munin_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 .wapi so that the httpd daemon can
access it, you need to execute it using semanage fcontext -a -t FILE_TYPE
'.wapi'.
where FILE_TYPE is one of the following: httpd_squirrelmail_t,
squirrelmail_spool_t, httpd_rw_content, httpd_cache_t, httpd_tmpfs_t,
httpd_tmp_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, httpd_w3c_validator_content_rw_t,
httpd_user_content_rw_t, httpdcontent, httpd_munin_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                system_u:object_r:httpd_var_run_t:s0
Target Objects                .wapi [ dir ]
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-78.fc12
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   httpd_bad_labels
Host Name                     (removed)
Platform                      Linux (removed)
                              2.6.31.12-174.2.3.fc12.x86_64 #1 SMP Mon Jan 18
                              19:52:07 UTC 2010 x86_64 x86_64
Alert Count                   2
First Seen                    Tue 02 Feb 2010 07:52:47 PM PST
Last Seen                     Wed 03 Feb 2010 10:06:31 AM PST
Local ID                      08692809-672d-400b-bea2-65a6f97cfc4b
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1265220391.304:10): avc:  denied  { create } for  pid=1602 comm="httpd" name=".wapi" scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:httpd_var_run_t:s0 tclass=dir

node=(removed) type=SYSCALL msg=audit(1265220391.304:10): arch=c000003e syscall=83 success=no exit=-13 a0=7fc6f8eb0c90 a1=1c0 a2=7fc6f8eb0ca7 a3=fffffffb items=0 ppid=1601 pid=1602 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 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-78.fc12,httpd_bad_labels,httpd,httpd_t,httpd_var_run_t,dir,create
audit2allow suggests:

#============= httpd_t ==============
allow httpd_t httpd_var_run_t:dir create;

Comment 1 Daniel Walsh 2010-02-03 18:34:23 UTC
Miroslav please add 

manage_dirs_pattern(httpd_t, httpd_var_run_t, httpd_var_run_t)
files_pid_filetrans(httpd_t, httpd_var_run_t, { file sock_file dir })

to apache.te

Comment 2 Miroslav Grepl 2010-02-03 19:16:55 UTC
Fixed in selinux-policy-3.6.32-82.fc12

Comment 3 Fedora Update System 2010-02-03 23:22:06 UTC
selinux-policy-3.6.32-82.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/selinux-policy-3.6.32-82.fc12

Comment 4 Fedora Update System 2010-02-05 01:46:42 UTC
selinux-policy-3.6.32-84.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-2010-1492

Comment 5 Fedora Update System 2010-02-11 14:39:54 UTC
selinux-policy-3.6.32-84.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.


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