2005-04-28 15:45:32 +00:00
|
|
|
|
2005-05-02 21:01:08 +00:00
|
|
|
policy_module(udev,1.0)
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
2005-05-09 17:47:57 +00:00
|
|
|
type udev_t; # nscd_client_domain
|
2005-04-28 15:45:32 +00:00
|
|
|
type udev_exec_t;
|
|
|
|
type udev_helper_exec_t;
|
2005-06-10 01:01:13 +00:00
|
|
|
kernel_userland_entry(udev_t,udev_exec_t)
|
2005-06-13 17:35:46 +00:00
|
|
|
kernel_obj_id_change_exempt(udev_t)
|
|
|
|
domain_entry_file(udev_t,udev_helper_exec_t)
|
|
|
|
domain_wide_inherit_fd(udev_t)
|
|
|
|
init_daemon_domain(udev_t,udev_exec_t)
|
2005-04-28 15:45:32 +00:00
|
|
|
|
|
|
|
type udev_etc_t alias etc_udev_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
files_file_type(udev_etc_t)
|
2005-04-28 15:45:32 +00:00
|
|
|
|
2005-05-04 13:16:09 +00:00
|
|
|
# udev_runtime_t is the type of the udev table file
|
|
|
|
# cjp: this is probably a copy of udev_tbl_t and can be removed
|
|
|
|
type udev_runtime_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
files_file_type(udev_runtime_t)
|
2005-05-04 13:16:09 +00:00
|
|
|
|
2005-04-28 15:45:32 +00:00
|
|
|
type udev_tbl_t alias udev_tdb_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
files_file_type(udev_tbl_t)
|
2005-05-02 21:01:08 +00:00
|
|
|
|
|
|
|
type udev_var_run_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
files_pid_file(udev_var_run_t)
|
2005-05-02 21:01:08 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Local policy
|
|
|
|
#
|
2005-04-28 15:45:32 +00:00
|
|
|
|
|
|
|
allow udev_t self:capability { chown dac_override dac_read_search fowner fsetid sys_admin mknod net_raw net_admin };
|
|
|
|
allow udev_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem dyntransition };
|
|
|
|
allow udev_t self:process { execmem setfscreate };
|
|
|
|
allow udev_t self:fd use;
|
2005-06-08 21:07:03 +00:00
|
|
|
allow udev_t self:fifo_file rw_file_perms;
|
2005-04-28 15:45:32 +00:00
|
|
|
allow udev_t self:unix_stream_socket { listen accept };
|
|
|
|
allow udev_t self:unix_dgram_socket sendto;
|
|
|
|
allow udev_t self:unix_stream_socket connectto;
|
2005-06-08 21:07:03 +00:00
|
|
|
allow udev_t self:shm create_shm_perms;
|
|
|
|
allow udev_t self:sem create_sem_perms;
|
|
|
|
allow udev_t self:msgq create_msgq_perms;
|
2005-04-28 15:45:32 +00:00
|
|
|
allow udev_t self:msg { send receive };
|
2005-06-08 21:07:03 +00:00
|
|
|
allow udev_t self:rawip_socket create_socket_perms;
|
2005-04-28 15:45:32 +00:00
|
|
|
|
2005-06-08 21:07:03 +00:00
|
|
|
allow udev_t udev_exec_t:file write;
|
|
|
|
can_exec(udev_t, udev_exec_t)
|
2005-05-30 21:17:20 +00:00
|
|
|
|
2005-06-08 21:07:03 +00:00
|
|
|
allow udev_t udev_helper_exec_t:dir r_dir_perms;
|
2005-04-28 15:45:32 +00:00
|
|
|
|
|
|
|
# read udev config
|
2005-06-08 21:07:03 +00:00
|
|
|
allow udev_t udev_etc_t:file r_file_perms;
|
2005-04-28 15:45:32 +00:00
|
|
|
|
|
|
|
# create udev database in /dev/.udevdb
|
2005-06-08 21:07:03 +00:00
|
|
|
allow udev_t udev_tbl_t:file create_file_perms;
|
2005-06-13 16:22:32 +00:00
|
|
|
dev_create_dev_node(udev_t,udev_tbl_t,file)
|
2005-04-28 15:45:32 +00:00
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
allow udev_t udev_var_run_t:dir rw_dir_perms;
|
|
|
|
allow udev_t udev_var_run_t:file create_file_perms;
|
2005-05-02 21:01:08 +00:00
|
|
|
|
2005-04-28 15:45:32 +00:00
|
|
|
kernel_read_system_state(udev_t)
|
2005-06-10 01:01:13 +00:00
|
|
|
kernel_getattr_core(udev_t)
|
|
|
|
kernel_use_fd(udev_t)
|
2005-04-28 15:45:32 +00:00
|
|
|
kernel_read_device_sysctl(udev_t)
|
|
|
|
kernel_read_hotplug_sysctl(udev_t)
|
|
|
|
kernel_read_modprobe_sysctl(udev_t)
|
|
|
|
kernel_read_kernel_sysctl(udev_t)
|
|
|
|
kernel_read_hardware_state(udev_t)
|
|
|
|
kernel_get_selinuxfs_mount_point(udev_t)
|
2005-06-10 01:01:13 +00:00
|
|
|
kernel_validate_context(udev_t)
|
|
|
|
kernel_compute_access_vector(udev_t)
|
|
|
|
kernel_compute_create_context(udev_t)
|
|
|
|
kernel_compute_relabel_context(udev_t)
|
|
|
|
kernel_compute_reachable_user_contexts(udev_t)
|
2005-05-02 21:01:08 +00:00
|
|
|
|
2005-06-13 16:22:32 +00:00
|
|
|
dev_manage_dev_nodes(udev_t)
|
2005-04-28 15:45:32 +00:00
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
fs_getattr_all_fs(udev_t)
|
2005-05-04 21:44:51 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
corecmd_exec_bin(udev_t)
|
|
|
|
corecmd_exec_sbin(udev_t)
|
|
|
|
corecmd_exec_shell(udev_t)
|
2005-05-26 20:38:45 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
domain_exec_all_entry_files(udev_t)
|
|
|
|
domain_dontaudit_list_all_domains_proc(udev_t)
|
2005-04-28 15:45:32 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
files_read_etc_runtime_files(udev_t)
|
|
|
|
files_read_generic_etc_files(udev_t)
|
|
|
|
files_exec_generic_etc_files(udev_t)
|
|
|
|
files_dontaudit_search_isid_type_dir(udev_t)
|
2005-04-28 15:45:32 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
init_use_fd(udev_t)
|
|
|
|
init_read_script_pid(udev_t)
|
|
|
|
init_dontaudit_write_script_pid(udev_t)
|
2005-04-28 15:45:32 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
libs_use_ld_so(udev_t)
|
|
|
|
libs_use_shared_libs(udev_t)
|
2005-05-24 22:22:26 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_send_syslog_msg(udev_t)
|
2005-04-28 15:45:32 +00:00
|
|
|
|
2005-05-30 21:17:20 +00:00
|
|
|
miscfiles_read_localization(udev_t)
|
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
modutils_domtrans_insmod(udev_t)
|
2005-05-30 21:17:20 +00:00
|
|
|
|
|
|
|
selinux_read_config(udev_t)
|
|
|
|
selinux_read_default_contexts(udev_t)
|
|
|
|
selinux_read_file_contexts(udev_t)
|
2005-06-13 17:35:46 +00:00
|
|
|
selinux_domtrans_restorecon(udev_t)
|
2005-05-30 21:17:20 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
sysnet_domtrans_ifconfig(udev_t)
|
2005-05-04 17:01:46 +00:00
|
|
|
|
2005-06-07 18:45:47 +00:00
|
|
|
ifdef(`distro_redhat',`
|
2005-06-08 13:12:00 +00:00
|
|
|
fs_manage_tmpfs_block_devices(udev_t)
|
|
|
|
fs_manage_tmpfs_character_devices(udev_t)
|
2005-05-19 21:06:06 +00:00
|
|
|
|
2005-06-03 12:25:14 +00:00
|
|
|
# for arping used for static IP addresses on PCMCIA ethernet
|
2005-06-13 17:35:46 +00:00
|
|
|
netutils_domtrans(udev_t)
|
2005-06-07 18:45:47 +00:00
|
|
|
')
|
2005-05-19 21:06:06 +00:00
|
|
|
|
2005-05-04 17:01:46 +00:00
|
|
|
optional_policy(`authlogin.te',`
|
2005-06-13 17:35:46 +00:00
|
|
|
auth_read_pam_console_data(udev_t)
|
|
|
|
auth_domtrans_pam_console(udev_t)
|
2005-05-04 17:01:46 +00:00
|
|
|
')
|
|
|
|
|
2005-05-04 13:16:09 +00:00
|
|
|
optional_policy(`consoletype.te',`
|
2005-06-13 17:35:46 +00:00
|
|
|
consoletype_exec(udev_t)
|
2005-04-28 15:45:32 +00:00
|
|
|
')
|
|
|
|
|
2005-05-04 17:01:46 +00:00
|
|
|
optional_policy(`hotplug.te',`
|
2005-06-03 12:25:14 +00:00
|
|
|
hotplug_read_config(udev_t)
|
2005-05-04 17:01:46 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`sysnetwork.te',`
|
2005-06-13 17:35:46 +00:00
|
|
|
sysnet_domtrans_dhcpc(udev_t)
|
2005-05-04 17:01:46 +00:00
|
|
|
')
|
|
|
|
|
2005-04-28 15:45:32 +00:00
|
|
|
ifdef(`TODO',`
|
|
|
|
allow udev_t var_log_t:dir search;
|
|
|
|
allow udev_t var_lock_t:dir search;
|
|
|
|
allow udev_t var_lock_t:file getattr;
|
|
|
|
|
|
|
|
allow udev_t mnt_t:dir search;
|
|
|
|
|
|
|
|
allow udev_t devpts_t:dir { getattr search };
|
|
|
|
allow udev_t sysadm_tty_device_t:chr_file { read write };
|
|
|
|
|
|
|
|
# Dontaudits
|
|
|
|
dontaudit udev_t staff_home_dir_t:dir search;
|
|
|
|
dontaudit udev_t ttyfile:chr_file unlink;
|
|
|
|
|
|
|
|
allow udev_t kernel_t:unix_dgram_socket { sendto ioctl read write };
|
|
|
|
|
|
|
|
dbusd_client(system, udev)
|
|
|
|
|
2005-06-07 18:45:47 +00:00
|
|
|
ifdef(`distro_redhat',`
|
2005-04-28 15:45:32 +00:00
|
|
|
allow udev_t tmpfs_t:sock_file create_file_perms;
|
|
|
|
allow udev_t tmpfs_t:lnk_file create_lnk_perms;
|
2005-05-19 21:06:06 +00:00
|
|
|
allow udev_t tmpfs_t:{ chr_file blk_file } { relabelfrom relabelto };
|
2005-06-07 18:45:47 +00:00
|
|
|
')
|
2005-04-28 15:45:32 +00:00
|
|
|
|
2005-05-04 13:16:09 +00:00
|
|
|
tunable_policy(`hide_broken_symptoms',`
|
2005-04-28 15:45:32 +00:00
|
|
|
dontaudit restorecon_t udev_t:unix_dgram_socket { read write };
|
|
|
|
dontaudit ifconfig_t udev_t:unix_dgram_socket { read write };
|
|
|
|
')
|
|
|
|
|
2005-05-04 13:16:09 +00:00
|
|
|
optional_policy(`xdm.te',`
|
2005-04-28 15:45:32 +00:00
|
|
|
allow udev_t xdm_var_run_t:file { getattr read };
|
|
|
|
')
|
|
|
|
|
|
|
|
') dnl endif TODO
|