Bug 560689

Summary: chrony policy update
Product: [Fedora] Fedora Reporter: Miroslav Lichvar <mlichvar>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 12CC: dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 3.6.32-84.fc12 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-02-11 14:42:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Miroslav Lichvar 2010-02-01 16:07:07 UTC
Description of problem:
New chrony version (currently packaged only in rawhide) adds support for several reference clocks which are not allowed by current policy.

Version-Release number of selected component (if applicable):
selinux-policy-3.6.32-69.fc12.noarch

Additional info:

# PPS refclock:
allow chronyd_t device_t:chr_file { read write open };

# SOCK refclock:
allow chronyd_t chronyd_var_lib_t:sock_file { create unlink };
allow chronyd_t self:capability dac_override;

# SHM refclock:
allow chronyd_t self:shm { unix_read read write unix_write associate };
allow chronyd_t tmpfs_t:file { read write };

The DAC override seems to be required to allow creating/removing the unix socket in /var/lib/chrony before root privileges are dropped.

Also, it would be nice to have /etc/chrony.keys marked with a different context to not allow other processes read it.

/etc/chrony\.keys                  --      gen_context(system_u:object_r:chronyd_keys_t,s0)

type chronyd_keys_t;
files_type(chronyd_keys_t)

allow chronyd_t chronyd_keys_t:file { read getattr open };


The policy is always in permissive mode, is this still needed?

Comment 1 Miroslav Lichvar 2010-02-01 16:14:34 UTC
One more thing. To allow SHM be used with gpsd, these seem to be required, depending on the order in which the services were started:

allow chronyd_t gpsd_t:shm { unix_read unix_write };

allow gpsd_t chronyd_t:shm { unix_read unix_write };

Comment 2 Miroslav Grepl 2010-02-01 16:44:35 UTC
(In reply to comment #0)
> Description of problem:
> New chrony version (currently packaged only in rawhide) adds support for
> several reference clocks which are not allowed by current policy.
> 
> Version-Release number of selected component (if applicable):
> selinux-policy-3.6.32-69.fc12.noarch
> 
> Additional info:
> 
> # PPS refclock:
> allow chronyd_t device_t:chr_file { read write open };
> 
device_t is bad. What device is used by chrony?

Comment 3 Miroslav Lichvar 2010-02-01 16:48:54 UTC
/dev/pps*

crw-rw----. root root system_u:object_r:device_t:s0    /dev/pps0

Comment 4 Miroslav Lichvar 2010-02-01 17:09:35 UTC
Actually for the gpsd SHM this might be required:

allow chronyd_t gpsd_t:shm { unix_read read write unix_write associate };
allow chronyd_t gpsd_tmpfs_t:file { read write };

Also, new chrony has support for memory locking and real-time scheduler setting:

allow chronyd_t self:capability { sys_resource ipc_lock };
allow chronyd_t self:process setrlimit;

Comment 5 Daniel Walsh 2010-02-02 12:35:04 UTC
/dev/pps.*		-c	gen_context(system_u:object_r:clock_device_t,s0)

Everything else looks fine.

I have updated policy in Rawhide.

You can take the permissive domain away.

Comment 6 Miroslav Grepl 2010-02-02 17:55:08 UTC
Added to selinux-policy-3.6.32-81.fc12

Comment 7 Fedora Update System 2010-02-03 23:21:26 UTC
selinux-policy-3.6.32-82.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/selinux-policy-3.6.32-82.fc12

Comment 8 Fedora Update System 2010-02-05 01:44:59 UTC
selinux-policy-3.6.32-84.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/F12/FEDORA-2010-1492

Comment 9 Fedora Update System 2010-02-11 14:37:43 UTC
selinux-policy-3.6.32-84.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.