Bug 988532 - Can't start apache resource agent using filesystem mounted on lvm device
Can't start apache resource agent using filesystem mounted on lvm device
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy (Show other bugs)
7.0
Unspecified Unspecified
high Severity high
: rc
: ---
Assigned To: Miroslav Grepl
BaseOS QE Security Team
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-25 15:15 EDT by Chris Feist
Modified: 2013-07-26 05:20 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-26 05:20:57 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Chris Feist 2013-07-25 15:15:16 EDT
Description of problem:
Can't use a newly created filesystem as the root for an apache filesystem.


Version-Release number of selected component (if applicable):
libselinux-2.1.13-16.el7.x86_64
libselinux-utils-2.1.13-16.el7.x86_64
libselinux-python-2.1.13-16.el7.x86_64
selinux-policy-targeted-3.12.1-65.el7.noarch
selinux-policy-3.12.1-65.el7.noarch
httpd-2.4.4-7.el7.x86_64


How reproducible:
Always

Steps to Reproduce:
1.  Create an lvm volume on shared storage
2.  Mount that volume on /var/www/html
3.  Start apache

Actual results:

Syntax error on line 119 of /etc/httpd/conf/httpd.conf: DocumentRoot must be a directory

In audit.log:
type=AVC msg=audit(1374779490.105:2292): avc:  denied  { getattr } for  pid=28177 comm="httpd" path="/var/www/html" dev="dm-6" ino=2 scontext=system_u:system_r:httpd_t:s0 tcontext=syst
em_u:object_r:file_t:s0 tclass=dir
type=SYSCALL msg=audit(1374779490.105:2292): arch=c000003e syscall=4 success=no exit=-13 a0=7fd89f2510d8 a1=7fff38d07b70 a2=7fff38d07b70 a3=c items=0 ppid=28174 pid=28177 auid=42949672
95 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm="httpd" exe="/usr/sbin/httpd" subj=system_u:system_r:httpd_t:s0 key=(null)
type=AVC msg=audit(1374779547.205:2293): avc:  denied  { getattr } for  pid=28525 comm="httpd" path="/var/www/html" dev="dm-6" ino=2 scontext=system_u:system_r:httpd_t:s0 tcontext=syst
em_u:object_r:file_t:s0 tclass=dir
type=SYSCALL msg=audit(1374779547.205:2293): arch=c000003e syscall=4 success=no exit=-13 a0=7f5f494000d8 a1=7fff2831c350 a2=7fff2831c350 a3=c items=0 ppid=28524 pid=28525 auid=42949672
95 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm="httpd" exe="/usr/sbin/httpd" subj=system_u:system_r:httpd_t:s0 key=(null)
type=MAC_STATUS msg=audit(1374779649.354:2294): enforcing=0 old_enforcing=1 auid=0 ses=247
type=SYSCALL msg=audit(1374779649.354:2294): arch=c000003e syscall=1 success=yes exit=1 a0=3 a1=7fff351539c0 a2=1 a3=0 items=0 ppid=27962 pid=28903 auid=0 uid=0 gid=0 euid=0 suid=0 fsu
id=0 egid=0 sgid=0 fsgid=0 ses=247 tty=pts2 comm="setenforce" exe="/usr/sbin/setenforce" subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null)
type=AVC msg=audit(1374779657.004:2295): avc:  denied  { getattr } for  pid=28983 comm="httpd" path="/var/www/html" dev="dm-6" ino=2 scontext=system_u:system_r:httpd_t:s0 tcontext=syst
em_u:object_r:file_t:s0 tclass=dir
type=SYSCALL msg=audit(1374779657.004:2295): arch=c000003e syscall=4 success=yes exit=0 a0=7f768837c0d8 a1=7fffc859e140 a2=7fffc859e140 a3=c items=0 ppid=28982 pid=28983 auid=429496729
5 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm="httpd" exe="/usr/sbin/httpd" subj=system_u:system_r:httpd_t:s0 key=(null)
type=AVC msg=audit(1374779659.086:2296): avc:  denied  { search } for  pid=28996 comm="httpd" name="/" dev="dm-6" ino=2 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=dir


Expected results:
When selinux is turned off, apache starts


Is there a special tag I need to use on the filesystem to allow apache to read from it?
Comment 2 Miroslav Grepl 2013-07-26 05:20:57 EDT
You need to fix labeling. "file_t" means no label.

# restorecon -R -v /var/www

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