Blob Blame History Raw
## <module name="kernel" layer="kernel">
## <summary>
##	Policy for kernel threads, security interface (selinuxfs),
##	proc filesystem, sysfs filesystem, and usb device filesystem.
## </summary>

########################################
## <interface name="kernel_userland_entry">
## 	<description>
##		Allows to start userland processes
##		by transitioning to the specified domain.
## 	</description>
## 	<parameter name="domain">
##		The process type entered by kernel.
## 	</parameter>
## 	<parameter name="entrypoint">
##		The executable type for the entrypoint.
## 	</parameter>
## </interface>
#
define(`kernel_userland_entry',`
	gen_require(`$0'_depend)

	domain_auto_trans(kernel_t, $2, $1)

	allow $1 kernel_t:fd use;
	allow kernel_t $1:fd use;
	allow kernel_t $1:fifo_file rw_file_perms;
	allow $1 kernel_t:process sigchld;
')

define(`kernel_userland_entry_depend',`
	type kernel_t;

	class process { transition noatsecure siginh rlimitinh sigchld };
	class file { getattr read execute };
	class fifo_file rw_file_perms;
	class fd use;
')

########################################
## <interface name="kernel_rootfs_mountpoint">
##	<description>
## 		Allows the kernel to mount filesystems on
## 		the specified directory type.
##	</description>
##	<parameter name="directory_type">
##		The type of the directory to use as a mountpoint.
##	</parameter>
## </interface>
#
define(`kernel_rootfs_mountpoint',`
	gen_require(`$0'_depend)

	allow kernel_t $1:dir mounton;
')

define(`kernel_rootfs_mountpoint_depend',`
	type kernel_t;

	class dir mounton;
')

########################################
## <interface name="kernel_share_state">
## 	<description>
## 		Allows the kernel to share state information with
## 		the caller.
## 	</description>
## 	<parameter name="domain">
## 		The type of the process with which to share state information.
## 	</parameter>
## </interface>
#
define(`kernel_share_state',`
	gen_require(`$0'_depend)

	allow kernel_t $1:process share;
')

define(`kernel_share_state_depend',`
	type kernel_t;

	class process share;
')

########################################
## <interface name="kernel_use_fd">
## 	<description>
## 		Permits caller to use kernel file descriptors.
## 	</description>
## 	<parameter name="domain">
## 		The type of the process using the descriptors.
## 	</parameter>
## </interface>
#
define(`kernel_use_fd',`
	gen_require(`$0'_depend)

	allow $1 kernel_t:fd use;
')

define(`kernel_use_fd_depend',`
	type kernel_t;

	class fd use;
')

########################################
## <interface name="kernel_dontaudit_use_fd">
## 	<description>
## 		Do not audit attempts to use
## 		kernel file descriptors.
## 	</description>
## 	<parameter name="domain">
## 		The type of process not to audit.
##	</parameter>
## </interface>
#
define(`kernel_dontaudit_use_fd',`
	gen_require(`$0'_depend)

	dontaudit $1 kernel_t:fd use;
')

define(`kernel_dontaudit_use_fd_depend',`
	type kernel_t;

	class fd use;
')

########################################
## <interface name="kernel_subj_id_change_exempt">
##	<description>
## 		Makes caller an exception to the constraint preventing
## 		changing of user identity.
##	</description>
##	<parameter name="domain">
##		The process type to make an exception to the constraint.
##	</parameter>
## </interface>
#
define(`kernel_subj_id_change_exempt',`
	gen_require(`$0'_depend)

	typeattribute $1 can_change_process_identity;
')

define(`kernel_subj_id_change_exempt_depend',`
	attribute can_change_process_identity;
')

########################################
## <interface name="kernel_role_change_exempt">
##	<description>
## 		Makes caller an exception to the constraint preventing
## 		changing of role.
##	</description>
##	<parameter name="domain">
##		The process type to make an exception to the constraint.
##	</parameter>
## </interface>
#
define(`kernel_role_change_exempt',`
	gen_require(`$0'_depend)

	typeattribute $1 can_change_process_role;
')

define(`kernel_role_change_exempt_depend',`
	attribute can_change_process_role;
')

########################################
## <interface name="kernel_obj_id_change_exempt">
##	<description>
## 		Makes caller an exception to the constraint preventing 
## 		changing the user identity in object contexts.
##	</description>
##	<parameter name="domain">
##		The process type to make an exception to the constraint.
##	</parameter>
## </interface>
#
define(`kernel_obj_id_change_exempt',`
	gen_require(`$0'_depend)

	typeattribute $1 can_change_object_identity;
')

define(`kernel_obj_id_change_exempt_depend',`
	attribute can_change_object_identity;
')

########################################
## <interface name="kernel_load_module">
##	<description>
## 		Allows caller to load kernel modules
##	</description>
##	<parameter name="domain">
##		The process type to allow to load kernel modules.
##	</parameter>
## </interface>
#
define(`kernel_load_module',`
	gen_require(`$0'_depend)

	allow $1 self:capability sys_module;
	typeattribute $1 can_load_kernmodule;
')

define(`kernel_load_module_depend',`
	attribute can_load_kernmodule;

	class capability sys_module;
')

########################################
## <interface name="kernel_get_selinux_enforcement_mode">
##	<description>
## 		Allows the caller to get the mode of policy enforcement
## 		(enforcing or permissive mode).
##	</description>
##	<parameter name="domain">
##		The process type to allow to get the enforcing mode.
##	</parameter>
## </interface>
#
define(`kernel_get_selinux_enforcement_mode',`
	gen_require(`$0'_depend)

	allow $1 security_t:dir { read search getattr };
	allow $1 security_t:file { getattr read };
')

define(`kernel_get_selinux_enforcement_mode_depend',`
	type security_t;

	class dir { read search getattr };
	class file { getattr read };
')

########################################
## <interface name="kernel_set_enforcement_mode">
##	<description>
## 		Allow caller to set the mode of policy enforcement
## 		(enforcing or permissive mode).
##	</description>
##	<parameter name="domain">
##		The process type to allow to set the enforcement mode.
##	</parameter>
## </interface>
#
define(`kernel_set_enforcement_mode',`
	gen_require(`$0'_depend)

	allow $1 security_t:dir { read search getattr };
	allow $1 security_t:file { getattr read write };
	allow $1 security_t:security setenforce;
	auditallow $1 security_t:security setenforce;
	typeattribute $1 can_setenforce;
')

define(`kernel_set_enforcement_mode_depend',`
	type security_t;

	attribute can_setenforce;

	class dir { read search getattr };
	class file { getattr read write };
	class security setenforce;
')

########################################
## <interface name="kernel_load_policy">
##	<description>
## 		Allow caller to load the policy into the kernel.
##	</description>
##	<parameter name="domain">
##		The process type that will load the policy.
##	</parameter>
## </interface>
#
define(`kernel_load_policy',`
	gen_require(`$0'_depend)

	allow $1 security_t:dir { read search getattr };
	allow $1 security_t:file { getattr read write };
	allow $1 security_t:security load_policy;
	auditallow $1 security_t:security load_policy;
	typeattribute $1 can_load_policy;
')

define(`kernel_load_policy_depend',`
	type security_t;

	attribute can_load_policy;

	class dir { read search getattr };
	class file { getattr read write };
	class security load_policy;
')

########################################
## <interface name="kernel_set_boolean">
##	<description>
## 		Allow caller to set the state of Booleans to
## 		enable or disable conditional portions of the policy.
##	</description>
##	<parameter name="domain">
##		The process type allowed to set the Boolean.
##	</parameter>
##	<parameter name="booltype" optional="true">
##		The type of Booleans the caller is allowed to set.
##	</parameter>
## </interface>
#
define(`kernel_set_boolean',`
	gen_require(`$0'_depend)

	ifelse(`$2',`',`
		allow $1 security_t:dir { getattr search read };
		allow $1 security_t:file { getattr read write };
	',`
		allow $1 $2:dir { getattr search read };
		allow $1 $2:file { getattr read write };
	')

	allow $1 security_t:dir search;
	allow $1 security_t:security setbool;
	auditallow $1 security_t:security setbool;
')

define(`kernel_set_boolean_depend',`
	type security_t;

	class dir { read search getattr };
	class file { getattr read write };
	class security setbool;
')

########################################
## <interface name="kernel_set_security_parameters">
##	<description>
## 		Allow caller to set selinux security parameters.
##	</description>
##	<parameter name="domain">
##		The process type to allow to set security parameters.
##	</parameter>
## </interface>
#
define(`kernel_set_security_parameters',`
	gen_require(`$0'_depend)

	allow $1 security_t:dir { read search getattr };
	allow $1 security_t:file { getattr read write };
	allow $1 security_t:security setsecparam;
	auditallow $1 security_t:security setsecparam;
	typeattribute $1 can_setsecparam;
')

define(`kernel_set_security_parameters_depend',`
	type security_t;

	attribute can_setsecparam;

	class dir { read search getattr };
	class file { getattr read write };
	class security setsecparam;
')

########################################
## <interface name="kernel_validate_context">
##	<description>
## 		Allows caller to validate security contexts.
##	</description>
##	<parameter name="domain">
##		The process type permitted to validate contexts.
##	</parameter>
## </interface>
#
define(`kernel_validate_context',`
	gen_require(`$0'_depend)

	allow $1 security_t:dir { read search getattr };
	allow $1 security_t:file { getattr read write };
	allow $1 security_t:security check_context;
')

define(`kernel_validate_context_depend',`
	type security_t;

	class dir { read search getattr };
	class file { getattr read write };
	class security check_context;
')

########################################
## <interface name="kernel_compute_access_vector">
##	<description>
## 		Allows caller to compute an access vector.
##	</description>
##	<parameter name="domain">
##		The process type allowed to compute an access vector.
##	</parameter>
## </interface>
#
define(`kernel_compute_access_vector',`
	gen_require(`$0'_depend)

	allow $1 security_t:dir { read search getattr };
	allow $1 security_t:file { getattr read write };
	allow $1 security_t:security compute_av;
')

define(`kernel_compute_access_vector_depend',`
	type security_t;

	class dir { read search getattr };
	class file { getattr read write };
	class security compute_av;
')

########################################
## <interface name="kernel_compute_create_context">
##	<description>
## 		
##	</description>
##	<parameter name="domain">
##		
##	</parameter>
## </interface>
#
define(`kernel_compute_create_context',`
	gen_require(`$0'_depend)

	allow $1 security_t:dir { read search getattr };
	allow $1 security_t:file { getattr read write };
	allow $1 security_t:security compute_create;
')

define(`kernel_compute_create_context_depend',`
	type security_t;

	class dir { read search getattr };
	class file { getattr read write };
	class security compute_create;
')

########################################
## <interface name="kernel_compute_relabel_context">
##	<description>
## 		
##	</description>
##	<parameter name="domain">
##		The process type to 
##	</parameter>
## </interface>
#
define(`kernel_compute_relabel_context',`
	gen_require(`$0'_depend)

	allow $1 security_t:dir { read search getattr };
	allow $1 security_t:file { getattr read write };
	allow $1 security_t:security compute_relabel;
')

define(`kernel_compute_relabel_context_depend',`
	type security_t;

	class dir { read search getattr };
	class file { getattr read write };
	class security compute_relabel;
')

########################################
## <interface name="kernel_compute_reachable_user_contexts">
##	<description>
## 		Allows caller to compute possible contexts for a user.
##	</description>
##	<parameter name="domain">
##		The process type allowed to compute user contexts.
##	</parameter>
## </interface>
#
define(`kernel_compute_reachable_user_contexts',`
	gen_require(`$0'_depend)

	allow $1 security_t:dir { read search getattr };
	allow $1 security_t:file { getattr read write };
	allow $1 security_t:security compute_user;
')

define(`kernel_compute_reachable_user_contexts_depend',`
	type security_t;

	class dir { read search getattr };
	class file { getattr read write };
	class security compute_user;
')

########################################
## <interface name="kernel_read_ring_buffer">
##	<description>
## 		Allows caller to read the ring buffer.
##	</description>
##	<parameter name="domain">
##		The process type allowed to read the ring buffer.
##	</parameter>
## </interface>
#
define(`kernel_read_ring_buffer',`
	gen_require(`$0'_depend)

	allow $1 kernel_t:system syslog_read;
')

define(`kernel_read_ring_buffer_depend',`
	type kernel_t;

	class system syslog_read;
')

########################################
## <interface name="kernel_dontaudit_read_ring_buffer">
##	<description>
## 		Do not audit attempts to read the ring buffer.
##	</description>
##	<parameter name="domain">
##		The domain to not audit.
##	</parameter>
## </interface>
#
define(`kernel_dontaudit_read_ring_buffer',`
	gen_require(`$0'_depend)

	dontaudit $1 kernel_t:system syslog_read;
')

define(`kernel_dontaudit_read_ring_buffer_depend',`
	type kernel_t;

	class system syslog_read;
')

########################################
## <interface name="kernel_change_ring_buffer_level">
##	<description>
## 		
##	</description>
##	<parameter name="domain">
##		
##	</parameter>
## </interface>
#
define(`kernel_change_ring_buffer_level',`
	gen_require(`$0'_depend)

	allow $1 kernel_t:system syslog_console;
')

define(`kernel_change_ring_buffer_level_depend',`
	type kernel_t;

	class system syslog_console;
')

########################################
## <interface name="kernel_clear_ring_buffer">
##	<description>
## 		Allows the caller to clear the ring buffer.
##	</description>
##	<parameter name="domain">
##		The process type clearing the buffer.
##	</parameter>
## </interface>
#
define(`kernel_clear_ring_buffer',`
	gen_require(`$0'_depend)

	allow $1 kernel_t:system syslog_mod;
')

define(`kernel_clear_ring_buffer_depend',`
	type kernel_t;

	class system syslog_mod;
')

########################################
## <interface name="kernel_get_sysvipc_info">
##	<description>
## 		Get information on all System V IPC objects.
##	</description>
##	<parameter name="domain">
##		
##	</parameter>
## </interface>
#
define(`kernel_get_sysvipc_info',`
	gen_require(`$0'_depend)

	allow $1 kernel_t:system ipc_info;
')

define(`kernel_get_sysvipc_info_depend',`
	type kernel_t;

	class system ipc_info;
')

########################################
## <interface name="kernel_get_selinuxfs_mount_point">
##	<description>
## 		Gets the caller the mountpoint of the selinuxfs filesystem.
##	</description>
##	<parameter name="domain">
##		The process type requesting the selinuxfs mountpoint.
##	</parameter>
## </interface>
#
define(`kernel_get_selinuxfs_mount_point',`
	gen_require(`$0'_depend)

	allow $1 proc_t:dir search;
	allow $1 proc_t:{ file lnk_file } read;
	allow $1 self:dir search;
	allow $1 self:file { getattr read };
')

define(`kernel_get_selinuxfs_mount_point_depend',`
	type proc_t;

	class dir search;
	class lnk_file read;
	class file { getattr read };
')

########################################
## <interface name="kernel_read_system_state">
##	<description>
## 		Allows caller to read system state information.
##	</description>
##	<parameter name="domain">
##		The process type reading the system state information.
##	</parameter>
## </interface>
#
define(`kernel_read_system_state',`
	gen_require(`$0'_depend)

	allow $1 proc_t:dir r_dir_perms;
	allow $1 proc_t:lnk_file { getattr read };
	allow $1 proc_t:file r_file_perms;
')

define(`kernel_read_system_state_depend',`
	type proc_t;

	class dir r_dir_perms;
	class lnk_file { getattr read };
	class file r_file_perms;
')

########################################
## <interface name="kernel_dontaudit_read_system_state">
##	<description>
## 		Do not audit attempts by caller to 
## 		read system state information.
##	</description>
##	<parameter name="domain">
##		The process type not to audit.
##	</parameter>
## </interface>
#
define(`kernel_dontaudit_read_system_state',`
	gen_require(`$0'_depend)

	allow $1 proc_t:file read;
')

define(`kernel_dontaudit_read_system_state_depend',`
	type proc_t;

	class file read;
')

#######################################
## <interface name="kernel_read_software_raid_state">
##	<description>
## 		Allow caller to read the state information for software raid.
##	</description>
##	<parameter name="domain">
##		The process type reading software raid state.
##	</parameter>
## </interface>
#
define(`kernel_read_software_raid_state',`
	gen_require(`$0'_depend)

	allow $1 proc_t:dir r_dir_perms;
	allow $1 proc_mdstat_t:file r_file_perms;
')

define(`kernel_read_software_raid_state_depend',`
	type proc_t, proc_mdstat_t;

	class dir r_dir_perms;
	class file r_file_perms;
')

########################################
## <interface name="kernel_getattr_core">
##	<description>
## 		Allows caller to get attribues of core kernel interface.
##	</description>
##	<parameter name="domain">
##		The process type getting the attibutes.
##	</parameter>
## </interface>
#
define(`kernel_getattr_core',`
	gen_require(`$0'_depend)

	allow $1 proc_t:dir r_dir_perms;
	allow $1 proc_kcore_t:file getattr;
')

define(`kernel_getattr_core_depend',`
	type proc_t, proc_kcore_t;

	class dir { search getattr read };
	class file getattr;
')

########################################
## <interface name="kernel_dontaudit_getattr_core">
##	<description>
## 		Do not audit attempts to get the attributes of 
## 		core kernel interfaces.
##	</description>
##	<parameter name="domain">
##		The process type to not audit.
##	</parameter>
## </interface>
#
define(`kernel_dontaudit_getattr_core',`
	gen_require(`$0'_depend)

	dontaudit $1 proc_kcore_t:file getattr;
')

define(`kernel_dontaudit_getattr_core_depend',`
	type proc_kcore_t;

	class file getattr;
')

########################################
## <interface name="kernel_read_messages">
##	<description>
## 		Allow caller to read kernel messages
##		using the /proc/kmsg interface.
##	</description>
##	<parameter name="domain">
##		The process type reading the messages.
##	</parameter>
## </interface>
#
define(`kernel_read_messages',`
	gen_require(`$0'_depend)

	allow $1 proc_t:dir search;
	allow $1 proc_kmsg_t:file r_file_perms;
	typeattribute $1 can_receive_kernel_messages;
')

define(`kernel_read_messages_depend',`
	attribute can_receive_kernel_messages;

	type proc_kmsg_t, proc_t;

	class dir search;
	class file r_file_perms;
')

########################################
## <interface name="kernel_getattr_message_if">
##	<description>
## 		Allow caller to get the attributes of kernel message
## 		interface (/proc/kmsg).
##	</description>
##	<parameter name="domain">
##		The process type getting the attributes.
##	</parameter>
## </interface>
#
define(`kernel_getattr_message_if',`
	gen_require(`$0'_depend)

	allow $1 proc_t:dir search;
	allow $1 proc_kmsg_t:file getattr;
')

define(`kernel_getattr_message_if_depend',`
	type proc_kmsg_t, proc_t;

	class dir search;
	class file getattr;
')

########################################
## <interface name="kernel_dontaudit_getattr_message_if">
##	<description>
## 		Do not audit attempts by caller to get the attributes of kernel 
## 		message interfaces.
##	</description>
##	<parameter name="domain">
##		The process type not to audit.
##	</parameter>
## </interface>
#
define(`kernel_dontaudit_getattr_message_if',`
	gen_require(`$0'_depend)

	dontaudit $1 proc_kmsg_t:file getattr;
')

define(`kernel_dontaudit_getattr_message_if_depend',`
	type proc_kmsg_t, proc_t;

	class file getattr;
')

########################################
## <interface name="kernel_read_network_state">
##	<description>
## 		Allow caller to read the network state information.
##	</description>
##	<parameter name="domain">
##		The process type reading the state.
##	</parameter>
## </interface>
##
#
define(`kernel_read_network_state',`
	gen_require(`$0'_depend)

	allow $1 proc_t:dir search;
	allow $1 proc_net_t:dir r_dir_perms;
	allow $1 proc_net_t:file r_file_perms;
')

define(`kernel_read_network_state_depend',`
	type proc_t, proc_net_t;

	class dir r_dir_perms;
	class file r_file_perms;
')

########################################
## <interface name="kernel_dontaudit_search_sysctl_dir">
##	<description>
## 		Do not audit attempts by caller to search the sysctl directory.
##	</description>
##	<parameter name="domain">
##		The process type not to audit.
##	</parameter>
## </interface>
##
#
define(`kernel_dontaudit_search_sysctl_dir',`
	gen_require(`$0'_depend)

	dontaudit $1 sysctl_t:dir search;
')

define(`kernel_dontaudit_search_sysctl_dir_depend',`
	type sysctl_t;

	class dir search;
')

########################################
## <interface name="kernel_read_device_sysctl">
##	<description>
## 		Allow caller to read the device sysctls.
##	</description>
##	<parameter name="domain">
##		The process type to allow to read the device sysctls.
##	</parameter>
## </interface>
#
define(`kernel_read_device_sysctl',`
	gen_require(`$0'_depend)

	allow $1 proc_t:dir search;
	allow $1 sysctl_t:dir r_dir_perms;
	allow $1 sysctl_dev_t:dir r_dir_perms;
	allow $1 sysctl_dev_t:file r_file_perms;
')

define(`kernel_read_device_sysctl_depend',`
	type proc_t, sysctl_t, sysctl_dev_t;

	class dir r_dir_perms;
	class file r_file_perms;
')

########################################
## <interface name="kernel_rw_device_sysctl">
##	<description>
## 		Read and write device sysctls.
##	</description>
##	<parameter name="domain">
##		The type of the process performing this action.
##	</parameter>
## </interface>
#
define(`kernel_rw_device_sysctl',`
	gen_require(`$0'_depend)

	allow $1 proc_t:dir search;
	allow $1 sysctl_t:dir r_dir_perms;
	allow $1 sysctl_dev_t:file rw_file_perms;
')

define(`kernel_rw_device_sysctl_depend',`
	type proc_t, sysctl_t, sysctl_dev_t;

	class dir r_dir_perms;
	class file rw_file_perms;
')

########################################
## <interface name="kernel_read_vm_sysctl">
##	<description>
## 		Allow caller to read virtual memory sysctls.
##	</description>
##	<parameter name="domain">
##		The type of the process performing this action.
##	</parameter>
## </interface>
##
#
define(`kernel_read_vm_sysctl',`
	gen_require(`$0'_depend)

	allow $1 proc_t:dir search;
	allow $1 sysctl_t:dir r_dir_perms;
	allow $1 sysctl_vm_t:file r_file_perms;
')

define(`kernel_read_vm_sysctl_depend',`
	type proc_t, sysctl_t, sysctl_vm_t;

	class dir r_dir_perms;
	class file r_file_perms;
')

########################################
## <interface name="kernel_rw_vm_sysctl">
##	<description>
## 		Read and write virtual memory sysctls.
##	</description>
##	<parameter name="domain">
##		The type of the process performing this action.
##	</parameter>
## </interface>
#
define(`kernel_rw_vm_sysctl',`
	gen_require(`$0'_depend)

	allow $1 proc_t:dir search;
	allow $1 sysctl_t:dir r_dir_perms;
	allow $1 sysctl_vm_t:file rw_file_perms;
')

define(`kernel_rw_vm_sysctl_depend',`
	type proc_t, sysctl_t, sysctl_vm_t;

	class dir r_dir_perms;
	class file rw_file_perms;
')

########################################
## <interface name="kernel_dontaudit_search_network_sysctl_dir">
##	<description>
## 		Do not audit attempts by caller to search sysctl network directories.
##	</description>
##	<parameter name="domain">
##		The process type not to audit.
##	</parameter>
## </interface>
#
define(`kernel_dontaudit_search_network_sysctl_dir',`
	gen_require(`$0'_depend)

	dontaudit $1 sysctl_net_t:dir search;
')

define(`kernel_dontaudit_search_network_sysctl_dir_depend',`
	type sysctl_net_t;

	class dir search;
')

########################################
## <interface name="kernel_read_net_sysctl">
##	<description>
## 		Allow caller to read network sysctls.
##	</description>
##	<parameter name="domain">
##		The type of the process performing this action.
##	</parameter>
## </interface>
##
#
define(`kernel_read_net_sysctl',`
	gen_require(`$0'_depend)

	allow $1 proc_t:dir search;
	allow $1 sysctl_t:dir r_dir_perms;
	allow $1 sysctl_net_t:dir r_dir_perms;
	allow $1 sysctl_net_t:file r_file_perms;
')

define(`kernel_read_net_sysctl_depend',`
	type proc_t, sysctl_t, sysctl_net_t;

	class dir r_dir_perms;
	class file f_file_perms;
')

########################################
## <interface name="kernel_rw_net_sysctl">
##	<description>
## 		Allow caller to modiry contents of sysctl network files.
##	</description>
##	<parameter name="domain">
##		The type of the process performing this action.
##	</parameter>
## </interface>
#
define(`kernel_rw_net_sysctl',`
	gen_require(`$0'_depend)

	allow $1 proc_t:dir search;
	allow $1 sysctl_t:dir r_dir_perms;
	allow $1 sysctl_net_t:dir r_dir_perms;
	allow $1 sysctl_net_t:file rw_file_perms;
')

define(`kernel_rw_net_sysctl_depend',`
	type proc_t, sysctl_t, sysctl_net_t;

	class dir r_dir_perms;
	class file rw_file_perms;
')

########################################
## <interface name="kernel_read_unix_sysctl">
##	<description>
## 		Allow caller to read unix domain
##		socket sysctls.
##	</description>
##	<parameter name="domain">
##		The type of the process performing this action.
##	</parameter>
## </interface>
#
define(`kernel_read_unix_sysctl',`
	gen_require(`$0'_depend)

	allow $1 proc_t:dir search;
	allow $1 sysctl_t:dir r_dir_perms;
	allow $1 sysctl_net_t:dir r_dir_perms;
	allow $1 sysctl_net_unix_t:file r_file_perms;
')

define(`kernel_read_unix_sysctl_depend',`
	type proc_t, sysctl_t, sysctl_net_t, sysctl_net_unix_t;

	class dir r_dir_perms;
	class file r_file_perms;
')

########################################
## <interface name="kernel_rw_unix_sysctl">
##	<description>
## 		Read and write unix domain
##		socket sysctls.
##	</description>
##	<parameter name="domain">
##		The type of the process performing this action.
##	</parameter>
## </interface>
#
define(`kernel_rw_unix_sysctl',`
	gen_require(`$0'_depend)

	allow $1 proc_t:dir search;
	allow $1 sysctl_t:dir r_dir_perms;
	allow $1 sysctl_net_t:dir r_dir_perms;
	allow $1 sysctl_net_unix_t:file rw_file_perms;
')

define(`kernel_rw_net_sysctl_depend',`
	type proc_t, sysctl_t, sysctl_net_t, sysctl_net_unix_t;

	class dir r_dir_perms;
	class file rw_file_perms;
')

########################################
## <interface name="kernel_read_hotplug_sysctl">
##	<description>
## 		Read the hotplug sysctl.
##	</description>
##	<parameter name="domain">
##		The type of the process performing this action.
##	</parameter>
## </interface>
#
define(`kernel_read_hotplug_sysctl',`
	gen_require(`$0'_depend)

	allow $1 proc_t:dir search;
	allow $1 sysctl_t:dir r_dir_perms;
	allow $1 sysctl_kernel_t:dir r_dir_perms;
	allow $1 sysctl_hotplug_t:file r_file_perms;
')

define(`kernel_read_hotplug_sysctl_depend',`
	type proc_t, sysctl_t, sysctl_kernel_t, sysctl_hotplug_t;

	class dir r_dir_perms;
	class file r_file_perms;
')

########################################
## <interface name="kernel_rw_hotplug_sysctl">
##	<description>
## 		Read and write the hotplug sysctl.
##	</description>
##	<parameter name="domain">
##		The type of the process performing this action.
##	</parameter>
## </interface>
#
define(`kernel_rw_hotplug_sysctl',`
	gen_require(`$0'_depend)

	allow $1 proc_t:dir search;
	allow $1 sysctl_t:dir r_dir_perms;
	allow $1 sysctl_kernel_t:dir r_dir_perms;
	allow $1 sysctl_hotplug_t:file rw_file_perms;
')

define(`kernel_rw_hotplug_sysctl_depend',`
	type proc_t, sysctl_t, sysctl_kernel_t, sysctl_hotplug_t;

	class dir r_dir_perms;
	class file rw_file_perms;
')

########################################
## <interface name="kernel_read_modprobe_sysctl">
##	<description>
## 		Read the modprobe sysctl.
##	</description>
##	<parameter name="domain">
##		The type of the process performing this action.
##	</parameter>
## </interface>
#
define(`kernel_read_modprobe_sysctl',`
	gen_require(`$0'_depend)

	allow $1 proc_t:dir search;
	allow $1 sysctl_t:dir r_dir_perms;
	allow $1 sysctl_kernel_t:dir r_dir_perms;
	allow $1 sysctl_modprobe_t:file r_file_perms;
')

define(`kernel_read_modprobe_sysctl_depend',`
	type proc_t, sysctl_t, sysctl_kernel_t, sysctl_modprobe_t;

	class dir r_dir_perms;
	class file r_file_perms;
')

########################################
## <interface name="kernel_rw_modprobe_sysctl">
##	<description>
##		Read and write the modprobe sysctl.
##	</description>
##	<parameter name="domain">
##		The type of the process performing this action.
##	</parameter>
## </interface>
#
define(`kernel_rw_modprobe_sysctl',`
	gen_require(`$0'_depend)

	allow $1 proc_t:dir search;
	allow $1 sysctl_t:dir r_dir_perms;
	allow $1 sysctl_kernel_t:dir r_dir_perms;
	allow $1 sysctl_modprobe_t:file rw_file_perms;
')

define(`kernel_rw_modprobe_sysctl_depend',`
	type proc_t, sysctl_t, sysctl_kernel_t, sysctl_modprobe_t;

	class dir r_dir_perms;
	class file rw_file_perms;
')

########################################
## <interface name="kernel_read_kernel_sysctl">
##	<description>
##		Read generic kernel sysctls.
##	</description>
##	<parameter name="domain">
##		The type of the process performing this action.
##	</parameter>
## </interface>
#
define(`kernel_read_kernel_sysctl',`
	gen_require(`$0'_depend)

	allow $1 proc_t:dir search;
	allow $1 sysctl_t:dir r_dir_perms;
	allow $1 sysctl_kernel_t:dir r_dir_perms;
	allow $1 sysctl_kernel_t:file r_file_perms;
')

define(`kernel_read_kernel_sysctl_depend',`
	type proc_t, sysctl_t, sysctl_kernel_t;

	class dir r_dir_perms;
	class file r_file_perms;
')

########################################
## <interface name="kernel_rw_kernel_sysctl">
##	<description>
## 		Read and write generic kernel sysctls.
##	</description>
##	<parameter name="domain">
##		The type of the process performing this action.
##	</parameter>
## </interface>
#
define(`kernel_rw_kernel_sysctl',`
	gen_require(`$0'_depend)

	allow $1 proc_t:dir search;
	allow $1 sysctl_t:dir r_dir_perms;
	allow $1 sysctl_kernel_t:dir r_dir_perms;
	allow $1 sysctl_kernel_t:file rw_file_perms;
')

define(`kernel_rw_kernel_sysctl_depend',`
	type proc_t, sysctl_t, sysctl_kernel_t;

	class dir r_dir_perms;
	class file rw_file_perms;
')

########################################
## <interface name="kernel_read_fs_sysctl">
##	<description>
##		Read filesystem sysctls.
##	</description>
##	<parameter name="domain">
##		The type of the process performing this action.
##	</parameter>
## </interface>
#
define(`kernel_read_fs_sysctl',`
	gen_require(`$0'_depend)

	allow $1 proc_t:dir search;
	allow $1 sysctl_t:dir r_dir_perms;
	allow $1 sysctl_fs_t:dir r_dir_perms;
	allow $1 sysctl_fs_t:file r_file_perms;
')

define(`kernel_read_fs_sysctl_depend',`
	type proc_t, sysctl_t, sysctl_fs_t;

	class dir r_dir_perms;
	class file r_file_perms;
')

########################################
## <interface name="kernel_rw_fs_sysctl">
##	<description>
##		Read and write fileystem sysctls.
##	</description>
##	<parameter name="domain">
##		The type of the process performing this action.
##	</parameter>
## </interface>
#
define(`kernel_rw_fs_sysctl',`
	gen_require(`$0'_depend)

	allow $1 proc_t:dir search;
	allow $1 sysctl_t:dir r_dir_perms;
	allow $1 sysctl_fs_t:dir r_dir_perms;
	allow $1 sysctl_fs_t:file rw_file_perms;
')

define(`kernel_rw_fs_sysctl_depend',`
	type proc_t, sysctl_t, sysctl_fs_t;

	class dir r_dir_perms;
	class file rw_file_perms;
')

########################################
## <interface name="kernel_read_irq_sysctl">
##	<description>
## 		Read IRQ sysctls.
##	</description>
##	<parameter name="domain">
##		The type of the process performing this action.
##	</parameter>
## </interface>
#
define(`kernel_read_irq_sysctl',`
	gen_require(`$0'_depend)

	allow $1 proc_t:dir search;
	allow $1 sysctl_irq_t:dir r_dir_perms;
	allow $1 sysctl_irq_t:file r_file_perms;
')

define(`kernel_read_irq_sysctl_depend',`
	type proc_t, sysctl_irq_t;

	class dir r_dir_perms;
	class file r_file_perms;
')

########################################
## <interface name="kernel_rw_irq_sysctl">
##	<description>
## 		Read and write IRQ sysctls.
##	</description>
##	<parameter name="domain">
##		The type of the process performing this action.
##	</parameter>
## </interface>
##
#
define(`kernel_rw_irq_sysctl',`
	gen_require(`$0'_depend)

	allow $1 proc_t:dir search;
	allow $1 sysctl_irq_t:dir r_dir_perms;
	allow $1 sysctl_irq_t:file rw_file_perms;
')

define(`kernel_rw_irq_sysctl_depend',`
	type proc_t, sysctl_irq_t;

	class dir r_dir_perms;
	class file rw_file_perms;
')

########################################
#
# kernel_read_rpc_sysctl(domain)
#
define(`kernel_read_rpc_sysctl',`
	gen_require(`$0'_depend)

	allow $1 proc_t:dir search;
	allow $1 proc_net_t:dir search;
	allow $1 sysctl_rpc_t:dir r_dir_perms;
	allow $1 sysctl_rpc_t:file r_file_perms;
')

define(`kernel_read_rpc_sysctl_depend',`
	type proc_t, proc_net_t, sysctl_rpc_t;

	class dir r_dir_perms;
	class file r_file_perms;
')

########################################
#
# kernel_rw_rpc_sysctl(domain)
#
define(`kernel_rw_rpc_sysctl',`
	gen_require(`$0'_depend)

	allow $1 proc_t:dir search;
	allow $1 proc_net_t:dir search;
	allow $1 sysctl_rpc_t:dir r_dir_perms;
	allow $1 sysctl_rpc_t:file rw_file_perms;
')

define(`kernel_rw_rpc_sysctl_depend',`
	type proc_t, proc_net_t, sysctl_rpc_t;

	class dir r_dir_perms;
	class file rw_file_perms;
')

########################################
## <interface name="kernel_read_all_sysctl">
##	<description>
## 		Allow caller to read all sysctls.
##	</description>
##	<parameter name="domain">
##		The type of the process performing this action.
##	</parameter>
## </interface>
#
define(`kernel_read_all_sysctl',`
	kernel_read_device_sysctl($1)
	kernel_read_vm_sysctl($1)
	kernel_read_net_sysctl($1)
	kernel_read_unix_sysctl($1)
	kernel_read_hotplug_sysctl($1)
	kernel_read_modprobe_sysctl($1)
	kernel_read_kernel_sysctl($1)
	kernel_read_fs_sysctl($1)
	kernel_read_irq_sysctl($1)
	kernel_read_rpc_sysctl($1)
')

########################################
## <interface name="kernel_rw_all_sysctl">
##	<description>
## 		Read and write all sysctls.
##	</description>
##	<parameter name="domain">
##		The type of the process performing this action.
##	</parameter>
## </interface>
#
define(`kernel_rw_all_sysctl',`
	kernel_rw_device_sysctl($1)
	kernel_rw_vm_sysctl($1)
	kernel_rw_net_sysctl($1)
	kernel_rw_unix_sysctl($1)
	kernel_rw_hotplug_sysctl($1)
	kernel_rw_modprobe_sysctl($1)
	kernel_rw_kernel_sysctl($1)
	kernel_rw_fs_sysctl($1)
	kernel_rw_irq_sysctl($1)
	kernel_rw_rpc_sysctl($1)
')

########################################
## <interface name="kernel_search_sysfs">
##	<description>
##		Search the directory containing hardware information.
##	</description>
##	<parameter name="domain">
##		The type of the process performing this action.
##	</parameter>
## </interface>
#
define(`kernel_search_sysfs',`
	gen_require(`$0'_depend)

	allow $1 sysfs_t:dir search;
')

define(`kernel_search_sysfs_depend',`
	type sysfs_t;

	class dir search;
')

########################################
## <interface name="kernel_read_hardware_state">
##	<description>
## 		Allow caller to read hardware state information.
##	</description>
##	<parameter name="domain">
##		The process type reading hardware state information.
##	</parameter>
## </interface>
#
define(`kernel_read_hardware_state',`
	gen_require(`$0'_depend)

	allow $1 sysfs_t:dir r_dir_perms;
	allow $1 sysfs_t:{ file lnk_file } r_file_perms;
')

define(`kernel_read_hardware_state_depend',`
	type sysfs_t;

	class dir r_dir_perms;
	class file r_file_perms;
	class lnk_file r_file_perms;
')

########################################
## <interface name="kernel_rw_hardware_config_option">
##	<description>
## 		Allow caller to modify hardware state information.
##	</description>
##	<parameter name="domain">
##		The process type modifying hardware state information.
##	</parameter>
## </interface>
#
define(`kernel_rw_hardware_config_option',`
	gen_require(`$0'_depend)

	allow $1 sysfs_t:dir r_dir_perms;
	allow $1 sysfs_t:lnk_file r_file_perms;
	allow $1 sysfs_t:file rw_file_perms;
')

define(`kernel_rw_hardware_config_option_depend',`
	type sysfs_t;

	class dir r_dir_perms;
	class file rw_file_perms;
	class lnk_file r_file_perms;
')

########################################
## <interface name="kernel_kill_unlabeled">
##	<description>
##		Send a kill signal to unlabeled processes.
##	</description>
##	<parameter name="domain">
##		The type of the process performing this action.
##	</parameter>
## </interface>
#
define(`kernel_kill_unlabeled',`
	gen_require(`$0'_depend)

	allow $1 unlabeled_t:process sigkill;
')

define(`kernel_kill_unlabeled_depend',`
	type unlabeled_t;

	class process sigkill;
')

########################################
## <interface name="kernel_signal_unlabeled">
##	<description>
##		Send general signals to unlabeled processes.
##	</description>
##	<parameter name="domain">
##		The type of the process performing this action.
##	</parameter>
## </interface>
#
define(`kernel_signal_unlabeled',`
	gen_require(`$0'_depend)

	allow $1 unlabeled_t:process signal;
')

define(`kernel_signal_unlabeled_depend',`
	type unlabeled_t;

	class process signal;
')

########################################
## <interface name="kernel_signull_unlabeled">
##	<description>
##		Send a null signal to unlabeled processes.
##	</description>
##	<parameter name="domain">
##		The type of the process performing this action.
##	</parameter>
## </interface>
#
define(`kernel_signull_unlabeled',`
	gen_require(`$0'_depend)

	allow $1 unlabeled_t:process signull;
')

define(`kernel_signull_unlabeled_depend',`
	type unlabeled_t;

	class process signull;
')

########################################
## <interface name="kernel_sigstop_unlabeled">
##	<description>
##		Send a stop signal to unlabeled processes.
##	</description>
##	<parameter name="domain">
##		The type of the process performing this action.
##	</parameter>
## </interface>
#
define(`kernel_sigstop_unlabeled',`
	gen_require(`$0'_depend)

	allow $1 unlabeled_t:process sigstop;
')

define(`kernel_sigstop_unlabeled_depend',`
	type unlabeled_t;

	class process sigstop;
')

########################################
## <interface name="kernel_sigchld_unlabeled">
##	<description>
##		Send a child terminated signal to unlabeled processes.
##	</description>
##	<parameter name="domain">
##		The type of the process performing this action.
##	</parameter>
## </interface>
#
define(`kernel_sigchld_unlabeled',`
	gen_require(`$0'_depend)

	allow $1 unlabeled_t:process sigchld;
')

define(`kernel_sigchld_unlabeled_depend',`
	type unlabeled_t;

	class process sigchld;
')

########################################
## <interface name="kernel_dontaudit_getattr_unlabeled_blk_dev">
##	<description>
## 		Do not audit attempts by caller to get attributes for 
## 		unlabeled block devices.
##	</description>
##	<parameter name="domain">
##		The process type not to audit.
##	</parameter>
## </interface>
#
define(`kernel_dontaudit_getattr_unlabeled_blk_dev',`
	gen_require(`$0'_depend)

	allow $1 unlabeled_t:blk_file getattr;
')

define(`kernel_dontaudit_getattr_unlabeled_blk_dev_depend',`
	type unlabeled_t;

	class process getattr;
')

########################################
## <interface name="kernel_relabel_unlabeled">
##	<description>
## 		Allow caller to relabel unlabeled objects.
##	</description>
##	<parameter name="domain">
##		The process type relabeling the objects.
##	</parameter>
## </interface>
#
define(`kernel_relabel_unlabeled',`
	gen_require(`$0'_depend)

	allow $1 unlabeled_t:dir_file_class_set { getattr relabelfrom };
')

define(`kernel_relabel_unlabeled_depend',`
	type unlabeled_t;

	class dir { getattr relabelfrom };
	class file { getattr relabelfrom };
	class lnk_file { getattr relabelfrom };
	class fifo_file { getattr relabelfrom };
	class sock_file { getattr relabelfrom };
	class chr_file { getattr relabelfrom };
	class blk_file { getattr relabelfrom };
')

########################################
## <interface name="kernel_search_usbfs">
##	<description>
##		Search the directory containing USB hardware information.
##	</description>
##	<parameter name="domain">
##		The type of the process performing this action.
##	</parameter>
## </interface>
#
define(`kernel_search_usbfs',`
	gen_require(`$0'_depend)

	allow $1 usbfs_t:dir search;
')

define(`kernel_search_usbfs_depend',`
	type usbfs_t;

	class dir search;
')

########################################
## <interface name="kernel_list_usb_hardware">
##	<description>
## 		Allow caller to get a list of usb hardware.
##	</description>
##	<parameter name="domain">
##		The process type getting the list.
##	</parameter>
## </interface>
#
define(`kernel_list_usb_hardware',`
	gen_require(`$0'_depend)

	allow $1 usbfs_t:dir r_dir_perms;
	allow $1 usbfs_t:lnk_file r_file_perms;
	allow $1 usbfs_t:file getattr;
')

define(`kernel_list_usb_hardware_depend',`
	type usbfs_t;

	class dir r_dir_perms;
	class file getattr;
	class lnk_file r_file_perms;
')

########################################
## <interface name="kernel_read_usb_hardware_state">
##	<description>
##		Read USB hardware information using
##		the usbfs filesystem interface.
##	</description>
##	<parameter name="domain">
##		The type of the process performing this action.
##	</parameter>
## </interface>
#
define(`kernel_read_usb_hardware_state',`
	gen_require(`$0'_depend)

	allow $1 usbfs_t:dir r_dir_perms;
	allow $1 usbfs_t:{ file lnk_file } r_file_perms;
')

define(`kernel_read_usb_hardware_state_depend',`
	type usbfs_t;

	class dir r_dir_perms;
	class file r_file_perms;
	class lnk_file r_file_perms;
')

########################################
## <interface name="kernel_rw_usb_hardware_config_option">
##	<description>
## 		Allow caller to modify usb hardware configuration files.
##	</description>
##	<parameter name="domain">
##		The process type modifying the options.
##	</parameter>
## </interface>
#
define(`kernel_rw_usb_hardware_config_option',`
	gen_require(`$0'_depend)

	allow $1 usbfs_t:dir r_dir_perms;
	allow $1 usbfs_t:lnk_file r_file_perms;
	allow $1 usbfs_t:file rw_file_perms;
')

define(`kernel_rw_usb_hardware_config_option_depend',`
	type usbfs_t;

	class dir r_dir_perms;
	class file rw_file_perms;
	class lnk_file r_file_perms;
')

## </module>