policy_module(udev,1.0) ######################################## # # Declarations # type udev_t; # nscd_client_domain type udev_exec_t; type udev_helper_exec_t; kernel_userland_entry(udev_t,udev_exec_t) domain_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) type udev_etc_t alias etc_udev_t; files_type(udev_etc_t) # 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; files_type(udev_runtime_t) type udev_tbl_t alias udev_tdb_t; files_type(udev_tbl_t) type udev_var_run_t; files_pid_file(udev_var_run_t) ######################################## # # Local policy # 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; allow udev_t self:fifo_file rw_file_perms; 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; allow udev_t self:shm create_shm_perms; allow udev_t self:sem create_sem_perms; allow udev_t self:msgq create_msgq_perms; allow udev_t self:msg { send receive }; allow udev_t self:rawip_socket create_socket_perms; allow udev_t udev_exec_t:file write; can_exec(udev_t, udev_exec_t) allow udev_t udev_helper_exec_t:dir r_dir_perms; # read udev config allow udev_t udev_etc_t:file r_file_perms; # create udev database in /dev/.udevdb allow udev_t udev_tbl_t:file create_file_perms; dev_create_dev_node(udev_t,udev_tbl_t,file) allow udev_t udev_var_run_t:dir rw_dir_perms; allow udev_t udev_var_run_t:file create_file_perms; kernel_read_system_state(udev_t) kernel_getattr_core(udev_t) kernel_use_fd(udev_t) 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_rw_unix_dgram_socket(udev_t) kernel_sendto_unix_dgram_socket(udev_t) dev_read_sysfs(udev_t) dev_manage_dev_nodes(udev_t) fs_getattr_all_fs(udev_t) selinux_get_fs_mount(udev_t) selinux_validate_context(udev_t) selinux_compute_access_vector(udev_t) selinux_compute_create_context(udev_t) selinux_compute_relabel_context(udev_t) selinux_compute_user_contexts(udev_t) corecmd_exec_bin(udev_t) corecmd_exec_sbin(udev_t) corecmd_exec_shell(udev_t) domain_exec_all_entry_files(udev_t) domain_dontaudit_list_all_domains_proc(udev_t) files_read_etc_runtime_files(udev_t) files_read_etc_files(udev_t) files_exec_etc_files(udev_t) files_dontaudit_search_isid_type_dir(udev_t) files_getattr_generic_locks(udev_t) files_search_mnt(udev_t) init_use_fd(udev_t) init_read_script_pid(udev_t) init_dontaudit_write_script_pid(udev_t) libs_use_ld_so(udev_t) libs_use_shared_libs(udev_t) logging_search_logs(udev_t) logging_send_syslog_msg(udev_t) miscfiles_read_localization(udev_t) modutils_domtrans_insmod(udev_t) seutil_read_config(udev_t) seutil_read_default_contexts(udev_t) seutil_read_file_contexts(udev_t) seutil_domtrans_restorecon(udev_t) sysnet_domtrans_ifconfig(udev_t) userdom_use_sysadm_tty(udev_t) userdom_dontaudit_search_staff_home_dir(udev_t) ifdef(`distro_redhat',` fs_manage_tmpfs_symlinks(udev_t) fs_manage_tmpfs_sockets(udev_t) fs_manage_tmpfs_blk_dev(udev_t) fs_manage_tmpfs_chr_dev(udev_t) fs_relabel_tmpfs_blk_dev(udev_t) fs_relabel_tmpfs_chr_dev(udev_t) # for arping used for static IP addresses on PCMCIA ethernet netutils_domtrans(udev_t) ') optional_policy(`authlogin.te',` auth_read_pam_console_data(udev_t) auth_domtrans_pam_console(udev_t) ') optional_policy(`consoletype.te',` consoletype_exec(udev_t) ') optional_policy(`hotplug.te',` hotplug_read_config(udev_t) ') optional_policy(`sysnetwork.te',` sysnet_domtrans_dhcpc(udev_t) ') optional_policy(`xserver.te',` xserver_read_xdm_pid(udev_t) ') ifdef(`TODO',` dontaudit udev_t ttyfile:chr_file unlink; dbusd_client(system, udev) ') dnl endif TODO