Bug 642983 - SELinux is preventing /usr/bin/python "read" access to /etc/smolt/hw-uuid.
Summary: SELinux is preventing /usr/bin/python "read" access to /etc/smolt/hw-uuid.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 14
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Daniel Walsh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-10-14 11:36 UTC by Mads Kiilerich
Modified: 2010-10-18 05:43 UTC (History)
2 users (show)

Fixed In Version: selinux-policy-3.9.7-3.fc14
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-10-18 05:43:35 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Mads Kiilerich 2010-10-14 11:36:07 UTC
The workaround described below is probably correct, but AFAIK I haven't done anything special with the hw-uuid file. It was created several versions and updates ago. I would expect it to work correctly after this update too. 

I have no problem doing what it describes, but regular users should not have that experience.

Smolt was run automatically, probably from cron.


Summary:

SELinux is preventing /usr/bin/python "read" access to /etc/smolt/hw-uuid.

Detailed Description:

SELinux denied access requested by smoltSendProfil. /etc/smolt/hw-uuid may be a
mislabeled. /etc/smolt/hw-uuid default SELinux type is etc_t, but its current
type is etc_runtime_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/smolt/hw-uuid', if this file is a
directory, you can recursively restore using restorecon -R '/etc/smolt/hw-uuid'.

Fix Command:

/sbin/restorecon '/etc/smolt/hw-uuid'

Additional Information:

Source Context                system_u:system_r:smoltclient_t:s0-s0:c0.c1023
Target Context                system_u:object_r:etc_runtime_t:s0
Target Objects                /etc/smolt/hw-uuid [ file ]
Source                        smoltSendProfil
Source Path                   /usr/bin/python
Port                          <Unknown>
Host                          dev-mk
Source RPM Packages           python-2.7-8.fc14.1
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.5-7.fc14
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   restorecon
Host Name                     dev-mk
Platform                      Linux dev-mk 2.6.35.4-28.fc14.i686.PAE #1 SMP Wed
                              Sep 15 01:57:00 UTC 2010 i686 i686
Alert Count                   1
First Seen                    Sun 10 Oct 2010 06:20:05 PM CEST
Last Seen                     Sun 10 Oct 2010 06:20:05 PM CEST
Local ID                      93d16e0f-e0ba-4f4c-af1c-23b7a4d25e7a
Line Numbers                  

Raw Audit Messages            

node=dev-mk type=AVC msg=audit(1286727605.447:16745): avc:  denied  { read } for  pid=8938 comm="smoltSendProfil" name="hw-uuid" dev=sda3 ino=16437 scontext=system_u:system_r:smoltclient_t:s0-s0:c0.c1023 tcontext=system_u:object_r:etc_runtime_t:s0 tclass=file

node=dev-mk type=SYSCALL msg=audit(1286727605.447:16745): arch=40000003 syscall=5 success=no exit=-13 a0=a029518 a1=8000 a2=1b6 a3=9ead381 items=0 ppid=8936 pid=8938 auid=495 uid=495 gid=492 euid=495 suid=495 fsuid=495 egid=492 sgid=492 fsgid=492 tty=(none) ses=99 comm="smoltSendProfil" exe="/usr/bin/python" subj=system_u:system_r:smoltclient_t:s0-s0:c0.c1023 key=(null)

Comment 1 Daniel Walsh 2010-10-14 12:39:48 UTC
Fixed in selinux-policy-3.9.7-2.fc14

Miroslav could you back port this to F13.

Comment 2 Fedora Update System 2010-10-15 15:51:41 UTC
selinux-policy-3.9.7-3.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/selinux-policy-3.9.7-3.fc14

Comment 3 Fedora Update System 2010-10-15 19:06:52 UTC
selinux-policy-3.9.7-3.fc14 has been pushed to the Fedora 14 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: https://admin.fedoraproject.org/updates/selinux-policy-3.9.7-3.fc14

Comment 4 Fedora Update System 2010-10-18 05:43:08 UTC
selinux-policy-3.9.7-3.fc14 has been pushed to the Fedora 14 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.