Bug 610918 - SELinux is preventing /bin/bash "search" access to /.
Summary: SELinux is preventing /bin/bash "search" access to /.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 12
Hardware: x86_64
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-02 18:29 UTC by peetu.laiho
Modified: 2010-08-20 01:44 UTC (History)
3 users (show)

Fixed In Version: selinux-policy-3.6.32-120.fc12
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-08-20 01:44:54 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description peetu.laiho 2010-07-02 18:29:58 UTC
Description of problem:

SELinux denied access requested by sh. / may be a mislabeled. / default SELinux
type is root_t, but its current type is home_root_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 '/', if this file is a directory, you can
recursively restore using restorecon -R '/'.

Fix Command:

/sbin/restorecon '/'

Additional Information:

Source Context                system_u:system_r:awstats_t:s0-s0:c0.c1023
Target Context                system_u:object_r:home_root_t:s0
Target Objects                / [ dir ]
Source                        sh
Source Path                   /bin/bash
Port                          <Unknown>
Host                          <computername>
Source RPM Packages           bash-4.0.35-3.fc12
Target RPM Packages           filesystem-2.4.30-2.fc12
Policy RPM                    selinux-policy-3.6.32-118.fc12
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   restorecon
Host Name                     <computername>
Platform                      Linux <computername> 2.6.32.14-127.fc12.x86_64 #1 SMP Fri
                              May 28 04:30:39 UTC 2010 x86_64 x86_64
Alert Count                   14
First Seen                    Sat 26 Jun 2010 01:01:02 AM EEST
Last Seen                     Fri 02 Jul 2010 03:01:02 PM EEST
Local ID                      b2013a81-5e16-4e83-8bc2-74d4cf5db2d4
Line Numbers                  

Raw Audit Messages            

node=<computername> type=AVC msg=audit(1278072062.297:26733): avc:  denied  { search } for  pid=11139 comm="sh" name="/" dev=dm-1 ino=2 scontext=system_u:system_r:awstats_t:s0-s0:c0.c1023 tcontext=system_u:object_r:home_root_t:s0 tclass=dir

node=<computername> type=SYSCALL msg=audit(1278072062.297:26733): arch=c000003e syscall=2 success=no exit=-13 a0=19a8b10 a1=90800 a2=0 a3=27 items=0 ppid=11138 pid=11139 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=5 comm="sh" exe="/bin/bash" subj=system_u:system_r:awstats_t:s0-s0:c0.c1023 key=(null)


Additional info:

I first saw this alert after using awstats to generate report from local logfiles. The reported context for '/' is also awstats related (scontext=system_u:system_r:awstats_t:s0-s0:c0.c1023) wich led me to believe  they correlate. Now this alert pops-up every day when I log in.

Comment 1 Daniel Walsh 2010-07-12 19:48:30 UTC
This looks like you have /home on a different file system and for some reason awstats is doing a search on all mounted file systems.

Comment 2 Daniel Walsh 2010-07-12 19:50:03 UTC
Miroslav please add

files_dontaudit_search_all_mountpoints(awstats_t)

Comment 3 Miroslav Grepl 2010-08-05 11:51:06 UTC
Fixed in selinux-policy-3.6.32-120.fc12

Comment 4 Fedora Update System 2010-08-05 13:19:14 UTC
selinux-policy-3.6.32-120.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/selinux-policy-3.6.32-120.fc12

Comment 5 Fedora Update System 2010-08-05 23:23:20 UTC
selinux-policy-3.6.32-120.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update selinux-policy'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/selinux-policy-3.6.32-120.fc12

Comment 6 Fedora Update System 2010-08-20 01:39:34 UTC
selinux-policy-3.6.32-120.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.


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