Bug 684611 - SELinux prevents httpd from mounting autofs
Summary: SELinux prevents httpd from mounting autofs
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy
Version: 6.0
Hardware: i686
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Miroslav Grepl
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-13 19:55 UTC by Brian Dudek
Modified: 2012-10-11 12:28 UTC (History)
3 users (show)

Fixed In Version: selinux-policy-3.7.19-79.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-19 12:24:24 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0526 0 normal SHIPPED_LIVE selinux-policy bug fix and enhancement update 2011-05-19 09:37:41 UTC

Description Brian Dudek 2011-03-13 19:55:09 UTC
Description of problem:  SELinux is preventing httpd from autofs mounting files system.  Without SELinux enabled the httpd mount of NFS resources work as expected and works as expected if mount is done manually (with 'cd' into /net/server...)  Home dir NFS resources from same server works with and without SELinux enabled.

# getsebool use_nfs_home_dirs
use_nfs_home_dirs --> on
 
# getsebool httpd_use_nfs
httpd_use_nfs --> on

# grep DocumentRoot /etc/httpd/conf/httpd.conf
DocumentRoot /net/shadow/export/iraid/website/client-site

Version-Release number of selected component (if applicable):


How reproducible:
Always with SELINUX=enforcing

Apache/autofs configuration works and has been tested with SELINUX=permissive with no issues and as expected.


Steps to Reproduce:
1. disable selinux, reboot

2. config apache and autofs for /net/shadow/... resources then verify OK

3. enable selinux, reboot

2. mount | grep website
  ...nothing mounted as it should be

2.  service httpd start
Starting httpd: Syntax error on line 295 of /etc/httpd/conf/httpd.conf:
DocumentRoot must be a directory
                                                           [FAILED]
3.  cd /net/shadow/export/iraid/website/

4. mount | grep website
shadow:/export/iraid/website on /net/shadow/export/iraid/website type nfs (rw,nosuid,nodev,intr,sloppy,vers=4,addr=XXX.XXX.XXX.XXX,clientaddr=XXX.XX.XXX.XXX)

5. service httpd start
Starting httpd: 

6. service httpd status
httpd (pid  3474) is running...

Actual results:


Expected results:


Additional info:

audio.log report generated then httpd is started then fails:

type=AVC msg=audit(1300043363.272:71): avc:  denied  { read } for  pid=3165 comm="httpd" name="/" dev=autofs ino=20368 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:autofs_t:s0 tclass=dir

type=SYSCALL msg=audit(1300043363.272:71): arch=c000003e syscall=4 success=no exit=-13 a0=7f20c9133760 a1=7fff7e2f94f0 a2=7fff7e2f94f0 a3=7fff7e2f93d0 items=0 ppid=3163 pid=3165 auid=5076 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=3 comm="httpd" exe="/usr/sbin/httpd" subj=unconfined_u:system_r:httpd_t:s0 key=(null)

Comment 2 Daniel Walsh 2011-03-14 19:05:16 UTC
        fs_list_auto_mountpoints(httpd_*_t) 

Should be added to all nfs boolean blocks.

Comment 3 Miroslav Grepl 2011-03-14 19:45:54 UTC
yes, will add it.

Comment 4 Miroslav Grepl 2011-03-17 10:28:24 UTC
Fixed in selinux-policy-3.7.19-79.el6

Comment 7 errata-xmlrpc 2011-05-19 12:24:24 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0526.html


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