Bug 418821 - selinux problems with ldconfig in Fedora 8 (Automounted NFS home directory)
selinux problems with ldconfig in Fedora 8 (Automounted NFS home directory)
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted (Show other bugs)
8
All Linux
low Severity low
: ---
: ---
Assigned To: Daniel Walsh
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-12-10 16:12 EST by Jonathan Abbey
Modified: 2008-01-30 14:06 EST (History)
0 users

See Also:
Fixed In Version: Current
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-01-30 14:06:58 EST
Type: ---
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 Jonathan Abbey 2007-12-10 16:12:26 EST
Description of problem:

-------------------------------------------------------------------------------

Part 1:

Summary
    SELinux prevented /sbin/ldconfig from reading and writing files stored on a
    NFS filesytem.

Detailed Description
    SELinux prevented /sbin/ldconfig from reading and writing files stored on a
    NFS filesystem. NFS (Network Filesystem) is a network filesystem commonly
    used on Unix / Linux systems. /sbin/ldconfig attempted to read one or more
    files or directories from a mounted filesystem of this type.  As NFS
    filesystems do not support fine-grained SELinux labeling, all files and
    directories in the filesystem will have the same security context. If you
    have not configured /sbin/ldconfig to read files from a NFS filesystem this
    access attempt could signal an intrusion attempt.

Allowing Access
    Changing the "use_nfs_home_dirs" boolean to true will allow this access:
    "setsebool -P use_nfs_home_dirs=1"

    The following command will allow this access:
    setsebool -P use_nfs_home_dirs=1

Additional Information        

Source Context                system_u:system_r:ldconfig_t:s0-s0:c0.c1023
Target Context                system_u:object_r:nfs_t:s0
Target Objects                None [ file ]
Affected RPM Packages         glibc-2.7-2 [application]
Policy RPM                    selinux-policy-3.0.8-62.fc8
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   plugins.use_nfs_home_dirs
Host Name                     csdpc20
Platform                      Linux csdpc20 2.6.23.1-49.fc8 #1 SMP Thu Nov 8
                              21:41:26 EST 2007 i686 i686
Alert Count                   7
First Seen                    Mon 10 Dec 2007 01:52:04 PM CST
Last Seen                     Mon 10 Dec 2007 01:52:23 PM CST
Local ID                      2f47040d-7c7e-4199-860e-3496d8ee8436
Line Numbers                  

Raw Audit Messages            

avc: denied { write } for comm=ldconfig dev=0:12 egid=12010 euid=12003
exe=/sbin/ldconfig exit=0 fsgid=12010 fsuid=12003 gid=12010 items=0
path=jabber/jabberd14-1.6.1.1/make.log.5220 pid=7146
scontext=system_u:system_r:ldconfig_t:s0-s0:c0.c1023 sgid=12010
subj=system_u:system_r:ldconfig_t:s0-s0:c0.c1023 suid=12003 tclass=file
tcontext=system_u:object_r:nfs_t:s0 tty=pts29 uid=12003

-------------------------------------------------------------------------------

Part 2:

Summary
    SELinux is preventing /sbin/ldconfig (ldconfig_t) "search" to <Unknown>
    (autofs_t).

Detailed Description
    SELinux denied access requested by /sbin/ldconfig. It is not expected that
    this access is required by /sbin/ldconfig and this access may signal an
    intrusion attempt. It is also possible that the specific version or
    configuration of the application is causing it to require additional access.

Allowing Access
    Sometimes labeling problems can cause SELinux denials.  You could try to
    restore the default system file context for <Unknown>, restorecon -v
    <Unknown> If this does not work, there is currently no automatic way to
    allow this access. Instead,  you can generate a local policy module to allow
    this access - see http://fedora.redhat.com/docs/selinux-faq-fc5/#id2961385
    Or you can disable SELinux protection altogether. Disabling SELinux
    protection is not recommended. Please file a
    http://bugzilla.redhat.com/bugzilla/enter_bug.cgi against this package.

Additional Information        

Source Context                system_u:system_r:ldconfig_t:s0-s0:c0.c1023
Target Context                system_u:object_r:autofs_t:s0
Target Objects                None [ dir ]
Affected RPM Packages         glibc-2.7-2 [application]
Policy RPM                    selinux-policy-3.0.8-62.fc8
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   plugins.catchall_file
Host Name                     csdpc20
Platform                      Linux csdpc20 2.6.23.1-49.fc8 #1 SMP Thu Nov 8
                              21:41:26 EST 2007 i686 i686
Alert Count                   3
First Seen                    Mon 10 Dec 2007 01:52:11 PM CST
Last Seen                     Mon 10 Dec 2007 01:52:23 PM CST
Local ID                      001b3377-61c5-4204-a979-a3ae60400dc8
Line Numbers                  

Raw Audit Messages            

avc: denied { search } for comm=ldconfig dev=autofs egid=12010 euid=12003
exe=/sbin/ldconfig exit=-13 fsgid=12010 fsuid=12003 gid=12010 items=0 name=/
pid=7146 scontext=system_u:system_r:ldconfig_t:s0-s0:c0.c1023 sgid=12010
subj=system_u:system_r:ldconfig_t:s0-s0:c0.c1023 suid=12003 tclass=dir
tcontext=system_u:object_r:autofs_t:s0 tty=pts29 uid=12003


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

selinux-policy-targeted-3.0.8-62.fc8

How reproducible:

Mount an NFS home directory over Automounter, see ldconfig search errors
when installing software (jabberd14 in this case, using make install) into
an NFS-mounted home directory.

Note that this occurs even when the use_nfs_home_dirs SE Boolean is enabled.

Steps to Reproduce:
0. Run Fedora 8 with enforcing targeted SELinux policy
1. Automount a home directory over NFS
2. Make sure use_nfs_home_dirs boolean is on
3. Attempt to run a 'make install' to a --prefix set on the home directory
  
Actual results:

The above SELinux enforcement actions, both on /home/broccol and /home, due
to ldconfig recursive search ascending from /home/broccol (nfs_t) and /home
(auto_fs_t).

Expected results:

Either have the make install work without SELinux enforcement actions, or have
the SELinux enforcement reports in the setroubleshoot browser provide useful
suggestions (i.e., not to suggest enabling use_nfs_home_dirs when
use_nfs_home_dirs is already enabled).

Additional info:

selinux-policy-targeted-3.0.8-62.fc8 is the currently installed SELinux policy,
but I have not rebooted the Fedora box in the last 25 days.

'cat /selinux/policyvers'

reports 21, but I'm not sure what version of the selinux-policy-targeted RPM
that corresponds to.  It may be that the selinux-policy-targeted in effect is
whatever was in effect when the system was booted 25 days ago?
Comment 1 Daniel Walsh 2007-12-12 10:53:48 EST
# audit2allow -M mypol -i /var/log/audit/audit.log 
# semodule -i mypol.pp

Fixed in selinux-policy-3.0.8-68.fc8
Comment 2 Daniel Walsh 2008-01-30 14:06:58 EST
Bulk closing a old selinux policy bugs that were in the modified state.  If the
bug is still not fixed.  Please reopen.

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