Bug 1149236

Summary: SELinux prevents sensord from calling statfs() on /sys
Product: Red Hat Enterprise Linux 7 Reporter: Milos Malik <mmalik>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1   
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-3.13.1-5.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 10:45:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Milos Malik 2014-10-03 14:55:24 UTC
Description of problem:

Version-Release number of selected component (if applicable):
lm_sensors-sensord-3.3.4-11.el7.x86_64
selinux-policy-3.13.1-1.el7.noarch
selinux-policy-devel-3.13.1-1.el7.noarch
selinux-policy-mls-3.13.1-1.el7.noarch
selinux-policy-targeted-3.13.1-1.el7.noarch

How reproducible:
always

Steps to Reproduce:
1. get a RHEL-7.1 machine with active targeted policy
2. service sensord start
3. search for AVCs

Actual results (enforcing mode):
----
type=PATH msg=audit(10/03/2014 16:43:35.985:834) : item=0 name=/sys inode=1 dev=00:10 mode=dir,555 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:sysfs_t:s0 objtype=NORMAL 
type=CWD msg=audit(10/03/2014 16:43:35.985:834) :  cwd=/ 
type=SYSCALL msg=audit(10/03/2014 16:43:35.985:834) : arch=x86_64 syscall=statfs success=no exit=-13(Permission denied) a0=0x7fbfece512a0 a1=0x7fff58edd080 a2=0xffffffff a3=0x7fff58edce00 items=1 ppid=1 pid=6508 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=sensord exe=/usr/sbin/sensord subj=system_u:system_r:sensord_t:s0 key=(null) 
type=AVC msg=audit(10/03/2014 16:43:35.985:834) : avc:  denied  { getattr } for  pid=6508 comm=sensord name=/ dev="sysfs" ino=1 scontext=system_u:system_r:sensord_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=filesystem 
----

Actual results (permissive mode):
----
type=PATH msg=audit(10/03/2014 16:45:01.780:383) : item=0 name=/sys inode=1 dev=00:10 mode=dir,555 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:sysfs_t:s0 objtype=NORMAL 
type=CWD msg=audit(10/03/2014 16:45:01.780:383) :  cwd=/ 
type=SYSCALL msg=audit(10/03/2014 16:45:01.780:383) : arch=x86_64 syscall=statfs success=yes exit=0 a0=0x7f34ad70e2a0 a1=0x7fff7bbd1e50 a2=0xffffffff a3=0x7fff7bbd1bd0 items=1 ppid=1 pid=5347 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=sensord exe=/usr/sbin/sensord subj=system_u:system_r:sensord_t:s0 key=(null) 
type=AVC msg=audit(10/03/2014 16:45:01.780:383) : avc:  denied  { getattr } for  pid=5347 comm=sensord name=/ dev="sysfs" ino=1 scontext=system_u:system_r:sensord_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=filesystem 
----

Expected results:
 * no AVCs

Comment 1 Miroslav Grepl 2014-10-13 09:16:23 UTC
commit ab7d6fdda3517ce43947f69eda9750c40e3f1ce8
Author: Miroslav Grepl <mgrepl>
Date:   Mon Oct 13 11:15:59 2014 +0200

    ALlow sensord to getattr on sysfs.

Comment 5 errata-xmlrpc 2015-03-05 10:45:19 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0458.html