-## Allow virt to use usb devices -##
++##++## Allow confined virtual guests to interact with the sanlock ++##
++##+## Allow confined virtual guests to interact with the xserver +##
@@ -56579,7 +56695,7 @@ index 3eca020..60a0e6a 100644 type virt_etc_t; files_config_file(virt_etc_t) -@@ -62,23 +73,31 @@ files_config_file(virt_etc_t) +@@ -62,23 +80,31 @@ files_config_file(virt_etc_t) type virt_etc_rw_t; files_type(virt_etc_rw_t) @@ -56612,7 +56728,7 @@ index 3eca020..60a0e6a 100644 type virtd_t; type virtd_exec_t; -@@ -89,6 +108,11 @@ domain_subj_id_change_exemption(virtd_t) +@@ -89,6 +115,11 @@ domain_subj_id_change_exemption(virtd_t) type virtd_initrc_exec_t; init_script_file(virtd_initrc_exec_t) @@ -56624,7 +56740,7 @@ index 3eca020..60a0e6a 100644 ifdef(`enable_mcs',` init_ranged_daemon_domain(virtd_t, virtd_exec_t, s0 - mcs_systemhigh) ') -@@ -99,20 +123,29 @@ ifdef(`enable_mls',` +@@ -99,20 +130,29 @@ ifdef(`enable_mls',` ######################################## # @@ -56658,7 +56774,7 @@ index 3eca020..60a0e6a 100644 fs_hugetlbfs_filetrans(svirt_t, svirt_image_t, file) list_dirs_pattern(svirt_t, virt_content_t, virt_content_t) -@@ -130,9 +163,13 @@ corenet_tcp_connect_all_ports(svirt_t) +@@ -130,9 +170,13 @@ corenet_tcp_connect_all_ports(svirt_t) dev_list_sysfs(svirt_t) @@ -56672,7 +56788,7 @@ index 3eca020..60a0e6a 100644 tunable_policy(`virt_use_comm',` term_use_unallocated_ttys(svirt_t) -@@ -147,11 +184,15 @@ tunable_policy(`virt_use_fusefs',` +@@ -147,11 +191,15 @@ tunable_policy(`virt_use_fusefs',` tunable_policy(`virt_use_nfs',` fs_manage_nfs_dirs(svirt_t) fs_manage_nfs_files(svirt_t) @@ -56688,7 +56804,7 @@ index 3eca020..60a0e6a 100644 ') tunable_policy(`virt_use_sysfs',` -@@ -160,11 +201,22 @@ tunable_policy(`virt_use_sysfs',` +@@ -160,11 +208,28 @@ tunable_policy(`virt_use_sysfs',` tunable_policy(`virt_use_usb',` dev_rw_usbfs(svirt_t) @@ -56698,6 +56814,12 @@ index 3eca020..60a0e6a 100644 ') optional_policy(` ++ tunable_policy(`virt_use_sanlock',` ++ sanlock_stream_connect(svirt_t) ++ ') ++') ++ ++optional_policy(` + tunable_policy(`virt_use_xserver',` + xserver_stream_connect(svirt_t) + ') @@ -56711,7 +56833,7 @@ index 3eca020..60a0e6a 100644 xen_rw_image_files(svirt_t) ') -@@ -174,21 +226,35 @@ optional_policy(` +@@ -174,21 +239,35 @@ optional_policy(` # allow virtd_t self:capability { chown dac_override fowner ipc_lock kill mknod net_admin net_raw setpcap setuid setgid sys_admin sys_nice sys_ptrace }; @@ -56753,7 +56875,7 @@ index 3eca020..60a0e6a 100644 read_files_pattern(virtd_t, virt_etc_t, virt_etc_t) read_lnk_files_pattern(virtd_t, virt_etc_t, virt_etc_t) -@@ -200,8 +266,15 @@ filetrans_pattern(virtd_t, virt_etc_t, virt_etc_rw_t, dir) +@@ -200,8 +279,15 @@ filetrans_pattern(virtd_t, virt_etc_t, virt_etc_rw_t, dir) manage_files_pattern(virtd_t, virt_image_type, virt_image_type) manage_blk_files_pattern(virtd_t, virt_image_type, virt_image_type) @@ -56771,7 +56893,7 @@ index 3eca020..60a0e6a 100644 manage_dirs_pattern(virtd_t, virt_log_t, virt_log_t) manage_files_pattern(virtd_t, virt_log_t, virt_log_t) -@@ -217,9 +290,15 @@ manage_files_pattern(virtd_t, virt_var_run_t, virt_var_run_t) +@@ -217,9 +303,15 @@ manage_files_pattern(virtd_t, virt_var_run_t, virt_var_run_t) manage_sock_files_pattern(virtd_t, virt_var_run_t, virt_var_run_t) files_pid_filetrans(virtd_t, virt_var_run_t, { file dir }) @@ -56787,7 +56909,7 @@ index 3eca020..60a0e6a 100644 kernel_request_load_module(virtd_t) kernel_search_debugfs(virtd_t) -@@ -239,22 +318,31 @@ corenet_tcp_connect_soundd_port(virtd_t) +@@ -239,22 +331,31 @@ corenet_tcp_connect_soundd_port(virtd_t) corenet_rw_tun_tap_dev(virtd_t) dev_rw_sysfs(virtd_t) @@ -56820,7 +56942,7 @@ index 3eca020..60a0e6a 100644 fs_list_auto_mountpoints(virtd_t) fs_getattr_xattr_fs(virtd_t) -@@ -262,6 +350,18 @@ fs_rw_anon_inodefs_files(virtd_t) +@@ -262,6 +363,18 @@ fs_rw_anon_inodefs_files(virtd_t) fs_list_inotifyfs(virtd_t) fs_manage_cgroup_dirs(virtd_t) fs_rw_cgroup_files(virtd_t) @@ -56839,7 +56961,7 @@ index 3eca020..60a0e6a 100644 mcs_process_set_categories(virtd_t) -@@ -285,16 +385,29 @@ modutils_read_module_config(virtd_t) +@@ -285,16 +398,29 @@ modutils_read_module_config(virtd_t) modutils_manage_module_config(virtd_t) logging_send_syslog_msg(virtd_t) @@ -56869,7 +56991,7 @@ index 3eca020..60a0e6a 100644 tunable_policy(`virt_use_nfs',` fs_manage_nfs_dirs(virtd_t) -@@ -313,6 +426,10 @@ optional_policy(` +@@ -313,6 +439,10 @@ optional_policy(` ') optional_policy(` @@ -56880,7 +57002,7 @@ index 3eca020..60a0e6a 100644 dbus_system_bus_client(virtd_t) optional_policy(` -@@ -329,11 +446,17 @@ optional_policy(` +@@ -329,11 +459,17 @@ optional_policy(` ') optional_policy(` @@ -56898,7 +57020,7 @@ index 3eca020..60a0e6a 100644 ') optional_policy(` -@@ -365,6 +488,12 @@ optional_policy(` +@@ -365,6 +501,12 @@ optional_policy(` qemu_signal(virtd_t) qemu_kill(virtd_t) qemu_setsched(virtd_t) @@ -56911,7 +57033,7 @@ index 3eca020..60a0e6a 100644 ') optional_policy(` -@@ -394,20 +523,36 @@ optional_policy(` +@@ -394,20 +536,36 @@ optional_policy(` # virtual domains common policy # @@ -56950,7 +57072,7 @@ index 3eca020..60a0e6a 100644 corecmd_exec_bin(virt_domain) corecmd_exec_shell(virt_domain) -@@ -418,10 +563,11 @@ corenet_tcp_sendrecv_generic_node(virt_domain) +@@ -418,10 +576,11 @@ corenet_tcp_sendrecv_generic_node(virt_domain) corenet_tcp_sendrecv_all_ports(virt_domain) corenet_tcp_bind_generic_node(virt_domain) corenet_tcp_bind_vnc_port(virt_domain) @@ -56963,7 +57085,7 @@ index 3eca020..60a0e6a 100644 dev_read_rand(virt_domain) dev_read_sound(virt_domain) dev_read_urand(virt_domain) -@@ -429,10 +575,12 @@ dev_write_sound(virt_domain) +@@ -429,10 +588,12 @@ dev_write_sound(virt_domain) dev_rw_ksm(virt_domain) dev_rw_kvm(virt_domain) dev_rw_qemu(virt_domain) @@ -56976,7 +57098,7 @@ index 3eca020..60a0e6a 100644 files_read_usr_files(virt_domain) files_read_var_files(virt_domain) files_search_all(virt_domain) -@@ -440,14 +588,20 @@ files_search_all(virt_domain) +@@ -440,14 +601,20 @@ files_search_all(virt_domain) fs_getattr_tmpfs(virt_domain) fs_rw_anon_inodefs_files(virt_domain) fs_rw_tmpfs_files(virt_domain) @@ -57000,7 +57122,7 @@ index 3eca020..60a0e6a 100644 logging_send_syslog_msg(virt_domain) miscfiles_read_localization(virt_domain) -@@ -457,8 +611,177 @@ optional_policy(` +@@ -457,8 +624,177 @@ optional_policy(` ') optional_policy(` @@ -62218,7 +62340,7 @@ index 94fd8dd..f4a1020 100644 + read_fifo_files_pattern($1, init_var_run_t, init_var_run_t) +') diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te -index 29a9565..cd829ed 100644 +index 29a9565..8c027c2 100644 --- a/policy/modules/system/init.te +++ b/policy/modules/system/init.te @@ -16,6 +16,34 @@ gen_require(` @@ -62494,7 +62616,7 @@ index 29a9565..cd829ed 100644 + seutil_read_file_contexts(init_t) + + systemd_exec_systemctl(init_t) -+ systemd_read_unit_files(init_t) ++ systemd_manage_all_unit_files(init_t) + systemd_logger_stream_connect(init_t) + + # needs to remain @@ -65135,7 +65257,7 @@ index 172287e..ec1f0e8 100644 /usr/local/man(/.*)? gen_context(system_u:object_r:man_t,s0) /usr/local/share/man(/.*)? gen_context(system_u:object_r:man_t,s0) diff --git a/policy/modules/system/miscfiles.if b/policy/modules/system/miscfiles.if -index 926ba65..1dfa62a 100644 +index 926ba65..13762b6 100644 --- a/policy/modules/system/miscfiles.if +++ b/policy/modules/system/miscfiles.if @@ -582,6 +582,26 @@ interface(`miscfiles_manage_man_pages',` @@ -65165,6 +65287,31 @@ index 926ba65..1dfa62a 100644 ## Read public files used for file ## transfer services. ##