Bug 1071302 - selinux policy doesn't allow chronyd to read /sysfs
Summary: selinux policy doesn't allow chronyd to read /sysfs
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-28 13:08 UTC by Miroslav Lichvar
Modified: 2014-04-10 08:50 UTC (History)
5 users (show)

Fixed In Version: selinux-policy-3.13.1-46.fc21
Clone Of:
Environment:
Last Closed: 2014-04-10 08:50:20 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Miroslav Lichvar 2014-02-28 13:08:45 UTC
Description of problem:
chronyd has a (rarely used) feature that allows it to compensate for temperature changes. It can be configured to read a temperature sensor in /sysfs, for example /sys/class/hwmon/hwmon1/device/temp2_input, but selinux seems to block access to it.

audit2allow prints:
#============= chronyd_t ==============
allow chronyd_t sysfs_t:file { read getattr open };
allow chronyd_t sysfs_t:lnk_file read;

syslog messages:
Feb 28 13:57:23 localhost kernel: [4321980.917065] type=1400 audit(1393592243.488:266): avc:  denied  { read } for  pid=23485 comm="chronyd" name="hwmon0" dev="sysfs" ino=15502 scontext=system_u:system_r:chronyd_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=lnk_file  
Feb 28 13:57:23 localhost kernel: [4321980.917141] type=1400 audit(1393592243.488:267): avc:  denied  { read } for  pid=23485 comm="chronyd" name="temp2_input" dev="sysfs" ino=15515 scontext=system_u:system_r:chronyd_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=file  
Feb 28 13:57:23 localhost kernel: [4321980.917156] type=1400 audit(1393592243.488:268): avc:  denied  { open } for  pid=23485 comm="chronyd" path="/sys/devices/platform/coretemp.0/temp2_input" dev="sysfs" ino=15515 scontext=system_u:system_r:chronyd_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=file  
Feb 28 13:57:23 localhost kernel: [4321980.917174] type=1400 audit(1393592243.488:269): avc:  denied  { getattr } for  pid=23485 comm="chronyd" path="/sys/devices/platform/coretemp.0/temp2_input" dev="sysfs" ino=15515 scontext=system_u:system_r:chronyd_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=file

Comment 1 Miroslav Grepl 2014-04-10 08:50:20 UTC
commit 1de94a58c8b5793c3ceea6a40238a07eeeb5da42
Author: Miroslav Grepl <mgrepl>
Date:   Thu Apr 10 10:49:20 2014 +0200

    Allow chronyd to read /sys/class/hwmon/hwmon1/device/temp2


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