Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
policy_module(clock,1.0.1)
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
########################################
Chris PeBenito 17de1b7
#
Chris PeBenito 17de1b7
# Declarations
Chris PeBenito 17de1b7
#
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
type adjtime_t;
Chris PeBenito 17de1b7
files_type(adjtime_t)
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
type hwclock_t;
Chris PeBenito 17de1b7
type hwclock_exec_t;
Chris PeBenito 17de1b7
init_system_domain(hwclock_t,hwclock_exec_t)
Chris PeBenito 17de1b7
role system_r types hwclock_t;
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
########################################
Chris PeBenito 17de1b7
#
Chris PeBenito 17de1b7
# Local policy
Chris PeBenito 17de1b7
#
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
# Give hwclock the capabilities it requires.  dac_override is a surprise,
Chris PeBenito 17de1b7
# but hwclock does require it.
Chris PeBenito 17de1b7
allow hwclock_t self:capability { dac_override sys_rawio sys_time sys_tty_config audit_write };
Chris PeBenito 17de1b7
dontaudit hwclock_t self:capability sys_tty_config;
Chris PeBenito 17de1b7
allow hwclock_t self:process signal_perms;
Chris PeBenito 17de1b7
allow hwclock_t self:netlink_audit_socket { create_netlink_socket_perms nlmsg_relay };
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
# Allow hwclock to store & retrieve correction factors.
Chris PeBenito 17de1b7
allow hwclock_t adjtime_t:file { rw_file_perms setattr };
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
kernel_read_kernel_sysctls(hwclock_t)
Chris PeBenito 17de1b7
kernel_list_proc(hwclock_t)
Chris PeBenito 17de1b7
kernel_read_proc_symlinks(hwclock_t)
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
dev_read_sysfs(hwclock_t)
Chris PeBenito 17de1b7
dev_rw_realtime_clock(hwclock_t)
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
fs_getattr_xattr_fs(hwclock_t)
Chris PeBenito 17de1b7
fs_search_auto_mountpoints(hwclock_t)
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
term_dontaudit_use_console(hwclock_t)
Chris PeBenito 17de1b7
term_use_unallocated_ttys(hwclock_t)
Chris PeBenito 17de1b7
term_use_all_user_ttys(hwclock_t)
Chris PeBenito 17de1b7
term_use_all_user_ptys(hwclock_t)
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
domain_use_interactive_fds(hwclock_t)
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
init_use_fds(hwclock_t)
Chris PeBenito 17de1b7
init_use_script_ptys(hwclock_t)
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
files_read_etc_files(hwclock_t)
Chris PeBenito 17de1b7
# for when /usr is not mounted:
Chris PeBenito 17de1b7
files_dontaudit_search_isid_type_dirs(hwclock_t)
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
libs_use_ld_so(hwclock_t)
Chris PeBenito 17de1b7
libs_use_shared_libs(hwclock_t)
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
logging_send_syslog_msg(hwclock_t)
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
miscfiles_read_localization(hwclock_t)
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
ifdef(`targeted_policy',`
Chris PeBenito 17de1b7
	term_dontaudit_use_unallocated_ttys(hwclock_t)
Chris PeBenito 17de1b7
	term_dontaudit_use_generic_ptys(hwclock_t)
Chris PeBenito 17de1b7
	files_dontaudit_read_root_files(hwclock_t)
Chris PeBenito 17de1b7
')
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
optional_policy(`
Chris PeBenito 17de1b7
	apm_append_log(hwclock_t)
Chris PeBenito 17de1b7
	apm_rw_stream_sockets(hwclock_t)
Chris PeBenito 17de1b7
')
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
optional_policy(`
Chris PeBenito 17de1b7
	nscd_socket_use(hwclock_t)
Chris PeBenito 17de1b7
')
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
optional_policy(`
Chris PeBenito 17de1b7
	seutil_sigchld_newrole(hwclock_t)
Chris PeBenito 17de1b7
')
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
optional_policy(`
Chris PeBenito 17de1b7
	udev_read_db(hwclock_t)
Chris PeBenito 17de1b7
')
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
optional_policy(`
Chris PeBenito 17de1b7
	userdom_dontaudit_use_unpriv_user_fds(hwclock_t)
Chris PeBenito 17de1b7
')