Bug 149996 - SELinux and autofs UserDirs
SELinux and autofs UserDirs
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: selinux-policy-targeted (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Daniel Walsh
: SELinux
Depends On:
  Show dependency treegraph
Reported: 2005-03-01 08:54 EST by Andrew Gormanly
Modified: 2007-11-30 17:07 EST (History)
4 users (show)

See Also:
Fixed In Version: 1.25.4-10.1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-09-15 11:57:13 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
diff of dmesg outputs (5.11 KB, text/plain)
2005-03-14 04:14 EST, Andrew Gormanly
no flags Details

  None (edit)
Description Andrew Gormanly 2005-03-01 08:54:47 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.3) Gecko/20050104 Red Hat/1.4.3-3.0.7

Description of problem:
With NFS homes directories auto-mounted from an RHEL 3 AS file server onto a RHEL 4 AS web server, UserDir public_html fails unless SELinux is disabled.

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

How reproducible:

Steps to Reproduce:
1. Enable UserDir in httpd.conf
2. Point a browser at a user's pages (e.g. www.cmmp.ucl.ac.uk/~lkd)

Actual Results:  403 error.

Expected Results:  See user's front page.

Additional info:

Error in the logs is:

Mar  1 13:28:28 metatron kernel: audit(1109683708.145:0): avc:  denied  { search } for  pid=3389 exe=/usr/sbin/httpd name=/ dev=autofs ino=5269 scontext=root:system_r:httpd_t tcontext=system_u:object_r:autofs_t tclass=dir
Mar  1 13:28:28 metatron kernel: audit(1109683708.145:0): avc:  denied  { getattr } for  pid=3389 exe=/usr/sbin/httpd path=/homes dev=autofs ino=5269 scontext=root:system_r:httpd_t tcontext=system_u:object_r:autofs_t tclass=dir
Comment 2 Joe Orton 2005-03-04 11:18:39 EST
Thanks for the report.

This seems to be a bug in the SELinux targeted policy; it should be
allowing those accesses.
Comment 4 Joe Orton 2005-03-07 10:37:37 EST
To confirm that: an updated version of the SELinux targeted policy which fixes
this issue is available for testing purposes, from:


This fix is targeted to be included in U1.
Comment 5 Aleksandar Milivojevic 2005-03-11 11:18:06 EST
I'm getting:

Usage: /sbin/fixfiles {-R rpmpackage[,rpmpackage...] [-l logfile ] [-o
outputfile ] |check|restore|[-F] relabel}

when installing the selinux-policy-targeted-1.17.30-2.86.noarch.rpm.
Comment 6 Daniel Walsh 2005-03-11 11:34:05 EST
You need to update the policycoreutils.
It should have been required.

Comment 7 Aleksandar Milivojevic 2005-03-11 12:05:15 EST
I've checked
ftp://ftp.redhat.com/pub/redhat/linux/updates/enterprise/4AS/en/os/SRPMS/, and
there's no update for policycoreutils.  I'll try compiling the one from FC3.
Comment 8 Daniel Walsh 2005-03-11 15:17:09 EST

Is the one scheduled for U1
Comment 9 Andrew Gormanly 2005-03-14 04:04:01 EST
Installing these two packages solves the autofs bug, but causes a new breakage
with minilogd, and still leaves httpd and syslogd unable to write to their
output files.  ntpd is also still unable to read its drift file (should I file
these as seperate bugs?)...

From dmesg:

audit(1110789131.039:0): avc:  denied  { read } for  pid=590 exe=/sbin/minilogd
name=ld.so.cache dev=hda2 ino=33264 scontext=user_u:system_r:syslogd_t
tcontext=system_u:object_r:file_t tclass=file
Comment 10 Andrew Gormanly 2005-03-14 04:14:56 EST
Created attachment 111969 [details]
diff of dmesg outputs

Attached a diff of dmesg outputs related to selinux

(By doing

# dmesg | grep 'security\|SELinux\|audit' > dmesg_new_policy

repeated after reinstalling old policycoreutils and selinux-policy-targetted to
create dmesg_old_policy, then

diff -u dmesg_old_policy dmesg_new_policy > newpolicy_effects

Points to note are the fixing of the autofs bug and the new minilogd error.)
Comment 11 Andrew Gormanly 2005-03-14 04:19:55 EST
Are these new selinux-related problems caused by running with SELINUX=disabled
while waiting for this autofs fix?  It occurs to me (selinux dunce that I am)
that the contexts might be screwed up by having written to each of these files
over the last few days.

If so, any ideas on the correct invocation of chcon necessary to fix them?
Comment 12 Colin Walters 2005-03-14 10:44:23 EST
Yes, if you run with SELINUX=disabled, you need to relabel your filesystem
before returning to enforcement.

touch /.autorelabel
Comment 13 Andrew Gormanly 2005-03-15 04:05:50 EST
The fix works - thanks.

autorelabel re-exposes the subdirectories problem (bug # 149990), but
that's easily fixed.
Comment 14 Andrew Gormanly 2005-03-15 06:06:49 EST
Spoke too soon: autorelabel also leaves suexec inopperable, presumably
because it has the wrong contexts.  This breaks our perl scripts, and
I don't know and can't find info on the correct settings. Any suggestions?

ls -lZ /usr/sbin/suexec
-r-s--x---  root     apache   system_u:object_r:httpd_suexec_exec_t

audit(1110882504.941:0): avc:  denied  { net_bind_service } for 
pid=25469 exe=/usr/sbin/suexec capability=10
tcontext=root:system_r:httpd_suexec_t tclass=capability

audit(1110882504.941:0): avc:  denied  { write } for  pid=25469
exe=/usr/sbin/suexec name=httpd dev=hda9 ino=131086
tcontext=system_u:object_r:httpd_log_t tclass=dir

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