Bug 612294 - ldconfig writes ld.so.cache with incorrect label
Summary: ldconfig writes ld.so.cache with incorrect label
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 13
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-07-07 19:38 UTC by Chris Wright
Modified: 2011-05-25 20:55 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-25 20:55:07 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Chris Wright 2010-07-07 19:38:04 UTC
Description of problem:

yum update or erasing a package with an rpm post(un)install script that calls ldconfig will results in ld.so.cache with incorrect label

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

selinux-policy-3.7.19-28.fc13.noarch
glibc-2.12-2.x86_64
rpm-4.8.0-14.fc13.x86_64

How reproducible:

every time

Steps to Reproduce:
1. yum update|erase packge-with-ldconfig-in-post(un)install-script
2. ls -lZ /etc/ld.so.cache
  
Actual results:

ld.so.cache has default label

Expected results:

ld.so.cache has proper label

Additional info:

here's an example:

$ ls -lZ /etc/ld.so.cache
-rw-r--r--. root root system_u:object_r:ld_so_cache_t:s0 /etc/ld.so.cache
$ sudo yum install wireshark
...install...
$ ls -lZ /etc/ld.so.cache
-rw-r--r--. root root unconfined_u:object_r:etc_t:s0   /etc/ld.so.cache
$ rpm -q wireshark --scripts
postinstall program: /sbin/ldconfig
postuninstall program: /sbin/ldconfig

$ sudo restorecon -v /etc/ld.so/cache
restorecon reset /etc/ld.so.cache context unconfined_u:object_r:etc_t:s0->system_u:object_r:ld_so_cache_t:s0

Which generated this SELinux alert a bit later...

Summary:

SELinux is preventing /usr/bin/iceauth "read" access to /etc/ld.so.cache.

Detailed Description:

SELinux denied access requested by iceauth. /etc/ld.so.cache may be a
mislabeled. /etc/ld.so.cache default SELinux type is ld_so_cache_t, but its
current type is etc_t. Changing this file back to the default type, may fix your
problem.

File contexts can be assigned to a file in the following ways.

  * Files created in a directory receive the file context of the parent
    directory by default.
  * The SELinux policy might override the default label inherited from the
    parent directory by specifying a process running in context A which creates
    a file in a directory labeled B will instead create the file with label C.
    An example of this would be the dhcp client running with the dhclient_t type
    and creating a file in the directory /etc. This file would normally receive
    the etc_t type due to parental inheritance but instead the file is labeled
    with the net_conf_t type because the SELinux policy specifies this.
  * Users can change the file context on a file using tools such as chcon, or
    restorecon.

This file could have been mislabeled either by user error, or if an normally
confined application was run under the wrong domain.

However, this might also indicate a bug in SELinux because the file should not
have been labeled with this type.

If you believe this is a bug, please file a bug report against this package.

Allowing Access:

You can restore the default system context to this file by executing the
restorecon command. restorecon '/etc/ld.so.cache', if this file is a directory,
you can recursively restore using restorecon -R '/etc/ld.so.cache'.

Fix Command:

/sbin/restorecon '/etc/ld.so.cache'

Additional Information:

Source Context                unconfined_u:unconfined_r:iceauth_t:s0-s0:c0.c1023
Target Context                unconfined_u:object_r:etc_t:s0
Target Objects                /etc/ld.so.cache [ file ]
Source                        iceauth
Source Path                   /usr/bin/iceauth
Port                          <Unknown>
Host                          x200.localdomain
Source RPM Packages           xorg-x11-server-utils-7.4-16.fc13
Target RPM Packages           glibc-2.12-2
Policy RPM                    selinux-policy-3.7.19-28.fc13
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   restorecon
Host Name                     x200.localdomain
Platform                      Linux x200.localdomain 2.6.33.5-124.fc13.x86_64 #1
                              SMP Fri Jun 11 09:38:12 UTC 2010 x86_64 x86_64
Alert Count                   1
First Seen                    Wed 07 Jul 2010 10:05:39 AM PDT
Last Seen                     Wed 07 Jul 2010 10:05:39 AM PDT
Local ID                      7ebbd033-5dbd-461c-8408-b31ed3db7622
Line Numbers                  

Raw Audit Messages            

node=x200.localdomain type=AVC msg=audit(1278522339.17:865): avc:  denied  { read } for  pid=23812 comm="iceauth" name="ld.so.cache" dev=dm-0 ino=2147034 scontext=unconfined_u:unconfined_r:iceauth_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:etc_t:s0 tclass=file

node=x200.localdomain type=SYSCALL msg=audit(1278522339.17:865): arch=c000003e syscall=2 success=no exit=-13 a0=3c23a19e31 a1=0 a2=1 a3=ffffffff items=0 ppid=23811 pid=23812 auid=500 uid=500 gid=500 euid=500 suid=500 fsuid=500 egid=500 sgid=500 fsgid=500 tty=(none) ses=1 comm="iceauth" exe="/usr/bin/iceauth" subj=unconfined_u:unconfined_r:iceauth_t:s0-s0:c0.c1023 key=(null)

Comment 1 Daniel Walsh 2010-07-13 19:17:50 UTC
I think you are seeing a different problem

ls -lZ /sbin/ldconfig
ls -lZ /usr/bin/yum

Comment 2 Daniel Walsh 2010-08-20 10:12:25 UTC
Are you still having this problem?

Comment 3 Fedora Admin XMLRPC Client 2010-11-08 21:48:39 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 4 Fedora Admin XMLRPC Client 2010-11-08 21:50:11 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 5 Fedora Admin XMLRPC Client 2010-11-08 21:51:24 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.


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