Bug 429549

Summary: SELinux is preventing /usr/libexec/hal-storage-mount (hald_t) "getattr" access to /swapfile (swapfile_t).
Product: Red Hat Enterprise Linux 5 Reporter: Bill Kriebel <bilkay>
Component: selinux-policyAssignee: Daniel Walsh <dwalsh>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: 5.1   
Target Milestone: rc   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2008-0465 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-21 16:06:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Bill Kriebel 2008-01-21 15:19:52 UTC
Description of problem:

Installed CentOS 5.1 w/o swap partition. After installation, created /swapfile
and proceeded iaw man mkswap. Added following to /etc/fstab:
/swapfile               swap                    swap    defaults        0 0

After yum updates, started getting the following message in /var/log/messages on
boot:
Jan 20 13:30:50 localhost setroubleshoot:      SELinux is preventing
/usr/libexec/hal-storage-mount (hald_t) "getattr" access to /swapfile
(swapfile_t).      For complete SELinux messages. run sealert -l
87e7ef9e-4e5d-49ef-8d50-3219114ebaa9

Running sealert yields:

Summary
    SELinux is preventing /usr/libexec/hal-storage-mount (hald_t) "getattr"
    access to /swapfile (swapfile_t).

Detailed Description
    SELinux denied access requested by /usr/libexec/hal-storage-mount. It is not
    expected that this access is required by /usr/libexec/hal-storage-mount 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. Please file a
    http://bugzilla.redhat.com/bugzilla/enter_bug.cgi against this package.

Allowing Access
    Sometimes labeling problems can cause SELinux denials.  You could try to
    restore the default system file context for /swapfile, restorecon -v
    /swapfile. 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 entirely for the application. Disabling SELinux
    protection is not recommended. Please file a
    http://bugzilla.redhat.com/bugzilla/enter_bug.cgi against this package.
    Changing the "hald_disable_trans" boolean to true will disable SELinux
    protection this application: "setsebool -P hald_disable_trans=1."

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

Additional Information        

Source Context                system_u:system_r:hald_t
Target Context                root:object_r:swapfile_t
Target Objects                /swapfile [ file ]
Affected RPM Packages         hal-0.5.8.1-25.el5_1.1 [application]
Policy RPM                    selinux-policy-2.4.6-106.el5_1.3
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   plugins.disable_trans
Host Name                     localhost.localdomain
Platform                      Linux localhost.localdomain 2.6.18-53.1.4.el5 #1
                              SMP Fri Nov 30 00:45:16 EST 2007 i686 i686
Alert Count                   1
Line Numbers                  

Raw Audit Messages            

avc: denied { getattr } for comm="hal-storage-mou" dev=hda10 egid=0 euid=0
exe="/usr/libexec/hal-storage-mount" exit=-13 fsgid=0 fsuid=0 gid=0 items=0
path="/swapfile" pid=16794 scontext=system_u:system_r:hald_t:s0 sgid=0
subj=system_u:system_r:hald_t:s0 suid=0 tclass=file
tcontext=root:object_r:swapfile_t:s0 tty=(none) uid=0

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


How reproducible:

Every boot.

Steps to Reproduce:
1. boot
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Daniel Walsh 2008-01-21 18:39:08 UTC
Fixed in /selinux-policy-2.4.6-116.el5	

Comment 2 RHEL Program Management 2008-01-21 18:45:36 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 7 errata-xmlrpc 2008-05-21 16:06:32 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2008-0465.html