2005-04-28 15:45:32 +00:00
|
|
|
|
2007-12-14 14:23:18 +00:00
|
|
|
policy_module(udev,1.9.0)
|
2005-05-02 21:01:08 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
2005-09-26 20:26:32 +00:00
|
|
|
type udev_t;
|
2006-10-04 17:25:34 +00:00
|
|
|
type udev_exec_t;
|
2005-04-28 15:45:32 +00:00
|
|
|
type udev_helper_exec_t;
|
2006-01-27 19:55:42 +00:00
|
|
|
kernel_domtrans_to(udev_t,udev_exec_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
domain_obj_id_change_exemption(udev_t)
|
2005-06-13 17:35:46 +00:00
|
|
|
domain_entry_file(udev_t,udev_helper_exec_t)
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_interactive_fd(udev_t)
|
2005-06-13 17:35:46 +00:00
|
|
|
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-10-24 18:40:24 +00:00
|
|
|
files_config_file(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-29 14:26:41 +00:00
|
|
|
files_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-29 14:26:41 +00:00
|
|
|
files_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
|
|
|
|
2006-10-04 17:25:34 +00:00
|
|
|
ifdef(`enable_mcs',`
|
|
|
|
kernel_ranged_domtrans_to(udev_t,udev_exec_t,s0 - mcs_systemhigh)
|
|
|
|
init_ranged_daemon_domain(udev_t,udev_exec_t,s0 - mcs_systemhigh)
|
|
|
|
')
|
|
|
|
|
2005-05-02 21:01:08 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Local policy
|
|
|
|
#
|
2005-04-28 15:45:32 +00:00
|
|
|
|
2006-07-28 15:13:58 +00:00
|
|
|
allow udev_t self:capability { chown dac_override dac_read_search fowner fsetid sys_admin mknod net_raw net_admin sys_nice sys_rawio sys_resource setuid setgid sys_nice sys_ptrace };
|
2005-10-31 22:19:16 +00:00
|
|
|
dontaudit udev_t self:capability sys_tty_config;
|
2006-07-28 15:13:58 +00:00
|
|
|
allow udev_t self:process ~{ setcurrent setexec setfscreate setrlimit execmem execstack execheap };
|
2005-04-28 15:45:32 +00:00
|
|
|
allow udev_t self:process { execmem setfscreate };
|
|
|
|
allow udev_t self:fd use;
|
2006-12-12 20:08:08 +00:00
|
|
|
allow udev_t self:fifo_file rw_fifo_file_perms;
|
|
|
|
allow udev_t self:sock_file read_file_perms;
|
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-10-13 20:59:36 +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;
|
|
|
|
allow udev_t self:netlink_kobject_uevent_socket create_socket_perms;
|
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
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
allow udev_t udev_helper_exec_t:dir list_dir_perms;
|
2005-04-28 15:45:32 +00:00
|
|
|
|
|
|
|
# read udev config
|
2006-12-12 20:08:08 +00:00
|
|
|
allow udev_t udev_etc_t:file read_file_perms;
|
2005-04-28 15:45:32 +00:00
|
|
|
|
|
|
|
# create udev database in /dev/.udevdb
|
2006-12-12 20:08:08 +00:00
|
|
|
allow udev_t udev_tbl_t:file manage_file_perms;
|
2006-02-21 18:40:44 +00:00
|
|
|
dev_filetrans(udev_t,udev_tbl_t,file)
|
2005-04-28 15:45:32 +00:00
|
|
|
|
2007-09-05 17:55:57 +00:00
|
|
|
manage_dirs_pattern(udev_t,udev_var_run_t,udev_var_run_t)
|
2006-12-12 20:08:08 +00:00
|
|
|
manage_files_pattern(udev_t,udev_var_run_t,udev_var_run_t)
|
2007-09-05 17:55:57 +00:00
|
|
|
files_pid_filetrans(udev_t,udev_var_run_t,{ dir file })
|
2005-05-02 21:01:08 +00:00
|
|
|
|
2005-04-28 15:45:32 +00:00
|
|
|
kernel_read_system_state(udev_t)
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_getattr_core_if(udev_t)
|
2006-03-02 23:41:11 +00:00
|
|
|
kernel_use_fds(udev_t)
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_device_sysctls(udev_t)
|
|
|
|
kernel_read_hotplug_sysctls(udev_t)
|
|
|
|
kernel_read_modprobe_sysctls(udev_t)
|
|
|
|
kernel_read_kernel_sysctls(udev_t)
|
|
|
|
kernel_rw_hotplug_sysctls(udev_t)
|
|
|
|
kernel_rw_unix_dgram_sockets(udev_t)
|
2006-02-06 15:43:46 +00:00
|
|
|
kernel_dgram_send(udev_t)
|
2005-09-13 13:06:07 +00:00
|
|
|
kernel_signal(udev_t)
|
2005-06-16 20:33:51 +00:00
|
|
|
|
2007-09-05 17:55:57 +00:00
|
|
|
#https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=235182
|
|
|
|
kernel_rw_net_sysctls(udev_t)
|
|
|
|
kernel_read_network_state(udev_t)
|
|
|
|
|
2006-09-01 15:52:05 +00:00
|
|
|
corecmd_exec_all_executables(udev_t)
|
|
|
|
|
2005-09-15 21:03:29 +00:00
|
|
|
dev_rw_sysfs(udev_t)
|
2006-01-31 16:08:56 +00:00
|
|
|
dev_manage_all_dev_nodes(udev_t)
|
|
|
|
dev_rw_generic_files(udev_t)
|
|
|
|
dev_delete_generic_files(udev_t)
|
2007-09-05 17:55:57 +00:00
|
|
|
dev_search_usbfs(udev_t)
|
|
|
|
dev_relabel_all_dev_nodes(udev_t)
|
2007-11-30 15:56:48 +00:00
|
|
|
# udev_node.c/node_symlink() symlink labels are explicitly
|
|
|
|
# preserved, instead of short circuiting the relabel
|
|
|
|
dev_relabel_generic_symlinks(udev_t)
|
2005-06-16 20:33:51 +00:00
|
|
|
|
2006-09-01 15:52:05 +00:00
|
|
|
domain_read_all_domains_state(udev_t)
|
2006-09-25 18:53:06 +00:00
|
|
|
domain_dontaudit_ptrace_all_domains(udev_t) #pidof triggers these
|
2006-09-01 15:52:05 +00:00
|
|
|
|
2007-09-05 17:55:57 +00:00
|
|
|
files_read_usr_files(udev_t)
|
2006-09-01 15:52:05 +00:00
|
|
|
files_read_etc_runtime_files(udev_t)
|
|
|
|
files_read_etc_files(udev_t)
|
|
|
|
files_exec_etc_files(udev_t)
|
|
|
|
files_dontaudit_search_isid_type_dirs(udev_t)
|
|
|
|
files_getattr_generic_locks(udev_t)
|
|
|
|
files_search_mnt(udev_t)
|
|
|
|
|
2005-06-16 20:33:51 +00:00
|
|
|
fs_getattr_all_fs(udev_t)
|
2006-02-13 22:05:08 +00:00
|
|
|
fs_list_inotifyfs(udev_t)
|
2005-06-16 20:33:51 +00:00
|
|
|
|
2006-09-01 15:52:05 +00:00
|
|
|
mcs_ptrace_all(udev_t)
|
|
|
|
|
2007-08-20 18:26:08 +00:00
|
|
|
mls_file_read_all_levels(udev_t)
|
|
|
|
mls_file_write_all_levels(udev_t)
|
2006-09-01 15:52:05 +00:00
|
|
|
mls_file_upgrade(udev_t)
|
|
|
|
mls_file_downgrade(udev_t)
|
|
|
|
mls_process_write_down(udev_t)
|
|
|
|
|
2005-06-14 20:48:34 +00:00
|
|
|
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)
|
2005-05-02 21:01:08 +00:00
|
|
|
|
2006-08-22 19:37:56 +00:00
|
|
|
auth_read_pam_console_data(udev_t)
|
|
|
|
auth_domtrans_pam_console(udev_t)
|
2005-10-13 20:59:36 +00:00
|
|
|
auth_use_nsswitch(udev_t)
|
|
|
|
|
2006-01-18 18:08:39 +00:00
|
|
|
init_read_utmp(udev_t)
|
|
|
|
init_dontaudit_write_utmp(udev_t)
|
2007-11-15 16:54:18 +00:00
|
|
|
init_getattr_initctl(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-20 17:41:29 +00:00
|
|
|
logging_search_logs(udev_t)
|
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)
|
2006-11-13 03:24:07 +00:00
|
|
|
# read modules.inputmap:
|
|
|
|
modutils_read_module_deps(udev_t)
|
2005-05-30 21:17:20 +00:00
|
|
|
|
2005-06-14 20:48:34 +00:00
|
|
|
seutil_read_config(udev_t)
|
|
|
|
seutil_read_default_contexts(udev_t)
|
|
|
|
seutil_read_file_contexts(udev_t)
|
2007-05-11 17:10:43 +00:00
|
|
|
seutil_domtrans_setfiles(udev_t)
|
2005-05-30 21:17:20 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
sysnet_domtrans_ifconfig(udev_t)
|
2006-08-22 19:37:56 +00:00
|
|
|
sysnet_domtrans_dhcpc(udev_t)
|
2007-09-05 17:55:57 +00:00
|
|
|
sysnet_rw_dhcp_config(udev_t)
|
|
|
|
sysnet_read_dhcpc_pid(udev_t)
|
|
|
|
sysnet_delete_dhcpc_pid(udev_t)
|
|
|
|
sysnet_signal_dhcpc(udev_t)
|
|
|
|
sysnet_manage_config(udev_t)
|
|
|
|
sysnet_etc_filetrans_config(udev_t)
|
2005-05-04 17:01:46 +00:00
|
|
|
|
2006-02-21 18:40:44 +00:00
|
|
|
userdom_dontaudit_search_all_users_home_content(udev_t)
|
2005-06-30 18:54:08 +00:00
|
|
|
|
2006-11-13 03:24:07 +00:00
|
|
|
ifdef(`distro_gentoo',`
|
|
|
|
# during boot, init scripts use /dev/.rcsysinit
|
|
|
|
# existance to determine if we are in early booting
|
|
|
|
init_getattr_script_status_files(udev_t)
|
|
|
|
')
|
|
|
|
|
2005-06-07 18:45:47 +00:00
|
|
|
ifdef(`distro_redhat',`
|
2005-09-15 21:03:29 +00:00
|
|
|
fs_manage_tmpfs_dirs(udev_t)
|
|
|
|
fs_manage_tmpfs_files(udev_t)
|
2005-06-29 20:53:53 +00:00
|
|
|
fs_manage_tmpfs_symlinks(udev_t)
|
|
|
|
fs_manage_tmpfs_sockets(udev_t)
|
2006-01-31 20:29:27 +00:00
|
|
|
fs_manage_tmpfs_blk_files(udev_t)
|
|
|
|
fs_manage_tmpfs_chr_files(udev_t)
|
|
|
|
fs_relabel_tmpfs_blk_file(udev_t)
|
|
|
|
fs_relabel_tmpfs_chr_file(udev_t)
|
2005-05-19 21:06:06 +00:00
|
|
|
|
2007-04-11 17:56:03 +00:00
|
|
|
term_search_ptys(udev_t)
|
|
|
|
|
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
|
|
|
|
2007-11-15 16:54:18 +00:00
|
|
|
optional_policy(`
|
|
|
|
alsa_domtrans(udev_t)
|
|
|
|
alsa_read_rw_config(udev_t)
|
|
|
|
')
|
|
|
|
|
2007-09-05 17:55:57 +00:00
|
|
|
optional_policy(`
|
|
|
|
brctl_domtrans(udev_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-06-13 17:35:46 +00:00
|
|
|
consoletype_exec(udev_t)
|
2005-04-28 15:45:32 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-08-31 20:58:12 +00:00
|
|
|
dbus_system_bus_client_template(udev,udev_t)
|
|
|
|
')
|
|
|
|
|
2007-09-05 17:55:57 +00:00
|
|
|
optional_policy(`
|
|
|
|
fstools_domtrans(udev_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-03-02 23:41:11 +00:00
|
|
|
hal_dgram_send(udev_t)
|
2005-11-29 21:27:15 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-06-03 12:25:14 +00:00
|
|
|
hotplug_read_config(udev_t)
|
2006-11-13 03:24:07 +00:00
|
|
|
# usb.agent searches /var/run/usb
|
|
|
|
hotplug_search_pids(udev_t)
|
2005-05-04 17:01:46 +00:00
|
|
|
')
|
|
|
|
|
2007-09-05 17:55:57 +00:00
|
|
|
optional_policy(`
|
|
|
|
openct_read_pid_files(udev_t)
|
|
|
|
openct_domtrans(udev_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
pcscd_read_pub_files(udev_t)
|
|
|
|
pcscd_domtrans(udev_t)
|
|
|
|
')
|
|
|
|
|
2007-11-15 16:54:18 +00:00
|
|
|
optional_policy(`
|
|
|
|
raid_domtrans_mdadm(udev_t)
|
|
|
|
')
|
|
|
|
|
2007-09-05 17:55:57 +00:00
|
|
|
optional_policy(`
|
|
|
|
kernel_write_xen_state(udev_t)
|
|
|
|
kernel_read_xen_state(udev_t)
|
|
|
|
xen_manage_log(udev_t)
|
|
|
|
xen_read_image_files(udev_t)
|
|
|
|
')
|
|
|
|
|
2006-04-03 19:49:47 +00:00
|
|
|
optional_policy(`
|
|
|
|
xserver_read_xdm_pid(udev_t)
|
|
|
|
')
|