|
Chris PeBenito |
3865d6 |
## <module name="clock" layer="system">
|
|
Chris PeBenito |
e32d52 |
## <summary>Policy for reading and setting the hardware clock.</summary>
|
|
Chris PeBenito |
b2b38c |
|
|
Chris PeBenito |
daa0e0 |
########################################
|
|
Chris PeBenito |
daa0e0 |
## <interface name="clock_transition">
|
|
Chris PeBenito |
daa0e0 |
## <description>
|
|
Chris PeBenito |
daa0e0 |
## Execute hwclock in the clock domain.
|
|
Chris PeBenito |
daa0e0 |
## </description>
|
|
Chris PeBenito |
daa0e0 |
## <parameter name="domain">
|
|
Chris PeBenito |
daa0e0 |
## The type of the process performing this action.
|
|
Chris PeBenito |
daa0e0 |
## </parameter>
|
|
Chris PeBenito |
daa0e0 |
## <infoflow type="write" weight="10"/>
|
|
Chris PeBenito |
daa0e0 |
## </interface>
|
|
Chris PeBenito |
075c4f |
#
|
|
Chris PeBenito |
075c4f |
define(`clock_transition',`
|
|
Chris PeBenito |
0c73cd |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
a71972 |
domain_auto_trans($1,hwclock_exec_t,hwclock_t)
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
allow $1 hwclock_t:fd use;
|
|
Chris PeBenito |
0c73cd |
allow hwclock_t $1:fd use;
|
|
Chris PeBenito |
0c73cd |
allow hwclock_t $1:fifo_file rw_file_perms;
|
|
Chris PeBenito |
0c73cd |
allow hwclock_t $1:process sigchld;
|
|
Chris PeBenito |
075c4f |
')
|
|
Chris PeBenito |
075c4f |
|
|
Chris PeBenito |
075c4f |
define(`clock_transition_depend',`
|
|
Chris PeBenito |
0c73cd |
type hwclock_t, hwclock_exec_t;
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
class file { getattr read execute };
|
|
Chris PeBenito |
0c73cd |
class process { transition noatsecure siginh rlimitinh sigchld };
|
|
Chris PeBenito |
0c73cd |
class fd use;
|
|
Chris PeBenito |
0c73cd |
class fifo_file rw_file_perms;
|
|
Chris PeBenito |
075c4f |
')
|
|
Chris PeBenito |
075c4f |
|
|
Chris PeBenito |
daa0e0 |
########################################
|
|
Chris PeBenito |
daa0e0 |
## <interface name="clock_transition_add_role_use_terminal">
|
|
Chris PeBenito |
daa0e0 |
## <description>
|
|
Chris PeBenito |
daa0e0 |
## Execute hwclock in the clock domain, and
|
|
Chris PeBenito |
daa0e0 |
## allow the specified role the hwclock domain.
|
|
Chris PeBenito |
daa0e0 |
## </description>
|
|
Chris PeBenito |
daa0e0 |
## <parameter name="domain">
|
|
Chris PeBenito |
daa0e0 |
## The type of the process performing this action.
|
|
Chris PeBenito |
daa0e0 |
## </parameter>
|
|
Chris PeBenito |
daa0e0 |
## <parameter name="role">
|
|
Chris PeBenito |
daa0e0 |
## The role to be allowed the clock domain.
|
|
Chris PeBenito |
daa0e0 |
## </parameter>
|
|
Chris PeBenito |
daa0e0 |
## <parameter name="terminal">
|
|
Chris PeBenito |
daa0e0 |
## The type of the terminal allow the clock domain to use.
|
|
Chris PeBenito |
daa0e0 |
## </parameter>
|
|
Chris PeBenito |
daa0e0 |
## <infoflow type="write" weight="10"/>
|
|
Chris PeBenito |
daa0e0 |
## </interface>
|
|
Chris PeBenito |
daa0e0 |
#
|
|
Chris PeBenito |
daa0e0 |
define(`clock_transition_add_role_use_terminal',`
|
|
Chris PeBenito |
0c73cd |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
clock_transition($1)
|
|
Chris PeBenito |
0c73cd |
role $2 types hwclock_t;
|
|
Chris PeBenito |
0c73cd |
allow hwclock_t $3:chr_file { getattr read write ioctl };
|
|
Chris PeBenito |
daa0e0 |
')
|
|
Chris PeBenito |
daa0e0 |
|
|
Chris PeBenito |
daa0e0 |
define(`clock_transition_add_role_use_terminal_depend',`
|
|
Chris PeBenito |
0c73cd |
type hwclock_t;
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
class chr_file { getattr read write ioctl };
|
|
Chris PeBenito |
daa0e0 |
')
|
|
Chris PeBenito |
daa0e0 |
|
|
Chris PeBenito |
3865d6 |
########################################
|
|
Chris PeBenito |
3865d6 |
## <interface name="clock_execute">
|
|
Chris PeBenito |
3865d6 |
## <description>
|
|
Chris PeBenito |
3865d6 |
## Execute hwclock
|
|
Chris PeBenito |
3865d6 |
## </description>
|
|
Chris PeBenito |
3865d6 |
## <parameter name="domain">
|
|
Chris PeBenito |
3865d6 |
## The type of the process performing this action.
|
|
Chris PeBenito |
3865d6 |
## </parameter>
|
|
Chris PeBenito |
3865d6 |
## <infoflow type="execute" weight="10"/>
|
|
Chris PeBenito |
3865d6 |
## </interface>
|
|
Chris PeBenito |
075c4f |
#
|
|
Chris PeBenito |
075c4f |
define(`clock_execute',`
|
|
Chris PeBenito |
0c73cd |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
a71972 |
can_exec($1,hwclock_exec_t)
|
|
Chris PeBenito |
075c4f |
')
|
|
Chris PeBenito |
075c4f |
|
|
Chris PeBenito |
075c4f |
define(`clock_execute_depend',`
|
|
Chris PeBenito |
0c73cd |
type hwclock_exec_t;
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
0c73cd |
class file { getattr read execute execute_no_trans };
|
|
Chris PeBenito |
075c4f |
')
|
|
Chris PeBenito |
075c4f |
|
|
Chris PeBenito |
3865d6 |
########################################
|
|
Chris PeBenito |
3865d6 |
## <interface name="clock_modify_drift_records">
|
|
Chris PeBenito |
3865d6 |
## <description>
|
|
Chris PeBenito |
3865d6 |
## Allow executing domain to modify clock drift
|
|
Chris PeBenito |
3865d6 |
## </description>
|
|
Chris PeBenito |
3865d6 |
## <parameter name="domain">
|
|
Chris PeBenito |
3865d6 |
## The type of the process performing this action.
|
|
Chris PeBenito |
3865d6 |
## </parameter>
|
|
Chris PeBenito |
3865d6 |
## <infoflow type="write" weight="10"/>
|
|
Chris PeBenito |
3865d6 |
## </interface>
|
|
Chris PeBenito |
b2b38c |
#
|
|
Chris PeBenito |
b2b38c |
define(`clock_modify_drift_records',`
|
|
Chris PeBenito |
0c73cd |
requires_block_template(`$0'_depend)
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
a71972 |
allow $1 adjtime_t:file rw_file_perms;
|
|
Chris PeBenito |
0c73cd |
files_read_general_system_config_directory($1)
|
|
Chris PeBenito |
b2b38c |
')
|
|
Chris PeBenito |
b2b38c |
|
|
Chris PeBenito |
b2b38c |
define(`clock_modify_drift_records_depend',`
|
|
Chris PeBenito |
0c73cd |
type adjtime_t;
|
|
Chris PeBenito |
0c73cd |
|
|
Chris PeBenito |
a71972 |
class file rw_file_perms;
|
|
Chris PeBenito |
b2b38c |
')
|
|
Chris PeBenito |
e32d52 |
|
|
Chris PeBenito |
e32d52 |
## </module>
|