@@ -302,6 +302,9 @@ virt_driver_template(virtsecretd)
302302# virtstoraged
303303virt_driver_template(virtstoraged)
304304
305+ type virtstoraged_tmp_t;
306+ files_tmp_file(virtstoraged_tmp_t)
307+
305308# virtvboxd
306309virt_driver_template(virtvboxd)
307310
@@ -814,6 +817,8 @@ allow virtlogd_t virtd_t:dir list_dir_perms;
814817allow virtlogd_t virtd_t:file read_file_perms;
815818allow virtlogd_t virtd_t:lnk_file read_lnk_file_perms;
816819
820+ read_files_pattern(virtlogd_t, virtqemud_t, virtqemud_t)
821+
817822virt_manage_lib_files(virtlogd_t)
818823
819824tunable_policy(`virt_lockd_blk_devs',`
@@ -1657,26 +1662,32 @@ tunable_policy(`virt_sandbox_use_audit',`
16571662
16581663userdom_use_user_ptys(svirt_qemu_net_t)
16591664
1660-
16611665# ######################################
16621666#
16631667# virtinterfaced local policy
16641668#
16651669allow virtinterfaced_t self:tcp_socket create_stream_socket_perms;
16661670
1671+ corecmd_exec_bin(virtinterfaced_t)
1672+
1673+ fs_getattr_all_fs(virtinterfaced_t)
1674+
16671675modutils_read_module_config(virtinterfaced_t)
16681676
16691677sysnet_read_config(virtinterfaced_t)
1678+
1679+ userdom_read_all_users_state(virtinterfaced_t)
1680+
16701681# ######################################
16711682#
16721683# virtnetworkd local policy
16731684#
16741685allow virtnetworkd_t self:capability { kill sys_ptrace };
16751686allow virtnetworkd_t self:netlink_netfilter_socket create_socket_perms;
16761687allow virtnetworkd_t self:process setcap;
1677- allow virtnetworkd_t self:tun_socket create;
1688+ allow virtnetworkd_t self:tun_socket { create relabelfrom relabelto } ;
16781689
1679- read_lnk_files_pattern (virtnetworkd_t, virt_etc_rw_t, virt_etc_rw_t)
1690+ manage_lnk_files_pattern (virtnetworkd_t, virt_etc_rw_t, virt_etc_rw_t)
16801691
16811692manage_dirs_pattern(virtnetworkd_t, virt_var_lib_t, virt_var_lib_t)
16821693manage_files_pattern(virtnetworkd_t, virt_var_lib_t, virt_var_lib_t)
@@ -1694,6 +1705,9 @@ sysnet_read_config(virtnetworkd_t)
16941705optional_policy(`
16951706 dnsmasq_domtrans(virtnetworkd_t)
16961707 dnsmasq_manage_pid_files(virtnetworkd_t)
1708+ dnsmasq_read_state(virtnetworkd_t)
1709+ dnsmasq_signal(virtnetworkd_t)
1710+ dnsmasq_signull(virtnetworkd_t)
16971711')
16981712
16991713optional_policy(`
@@ -1709,6 +1723,8 @@ optional_policy(`
17091723allow virtnodedevd_t self:capability sys_admin;
17101724allow virtnodedevd_t self:netlink_generic_socket create_socket_perms;
17111725
1726+ kernel_request_load_module(virtnodedevd_t)
1727+
17121728dev_rw_mtrr(virtnodedevd_t)
17131729
17141730miscfiles_read_hwdata(virtnodedevd_t)
@@ -1723,8 +1739,12 @@ optional_policy(`
17231739#
17241740allow virtnwfilterd_t self:capability net_raw;
17251741allow virtnwfilterd_t self:netlink_netfilter_socket create_socket_perms;
1742+ allow virtnwfilterd_t self:packet_socket { bind create getopt ioctl map setopt };
17261743allow virtnwfilterd_t self:rawip_socket create_socket_perms;
17271744
1745+ kernel_read_net_sysctls(virtnwfilterd_t)
1746+ kernel_request_load_module(virtnwfilterd_t)
1747+
17281748manage_dirs_pattern(virtnwfilterd_t, virtnetworkd_var_run_t, virtnetworkd_var_run_t)
17291749manage_files_pattern(virtnwfilterd_t, virtnetworkd_var_run_t, virtnetworkd_var_run_t)
17301750
@@ -1744,12 +1764,14 @@ optional_policy(`
17441764#
17451765allow virtproxyd_t self:udp_socket create_socket_perms;
17461766
1767+ userdom_read_all_users_state(virtproxyd_t)
1768+
17471769# ######################################
17481770#
17491771# virtqemud local policy
17501772#
17511773allow virtqemud_t self:bpf { map_create map_read map_write prog_load prog_run };
1752- allow virtqemud_t self:capability { audit_write chown dac_override dac_read_search fowner fsetid kill setgid setuid sys_admin sys_chroot sys_ptrace };
1774+ allow virtqemud_t self:capability { audit_write chown dac_override dac_read_search fowner fsetid kill setgid setuid sys_admin sys_chroot sys_ptrace sys_rawio };
17531775allow virtqemud_t self:netlink_audit_socket nlmsg_relay;
17541776allow virtqemud_t self:process { setcap setexec setrlimit setsockcreate };
17551777allow virtqemud_t self:tcp_socket { bind create setopt };
@@ -1762,9 +1784,12 @@ allow virtqemud_t virt_driver_domain:unix_stream_socket connectto;
17621784
17631785manage_files_pattern(virtqemud_t, virt_image_t, virt_image_t)
17641786
1787+ read_files_pattern(virtqemud_t, virtproxyd_t, virtproxyd_t)
1788+
17651789allow virtqemud_t svirt_t:process { setsched signal signull transition };
1766- allow virtqemud_t svirt_t:unix_stream_socket create_socket_perms ;
1790+ allow virtqemud_t svirt_t:unix_stream_socket { connectto create_stream_socket_perms } ;
17671791read_files_pattern(virtqemud_t, svirt_t, svirt_t)
1792+ read_lnk_files_pattern(virtqemud_t, svirt_t, svirt_t)
17681793
17691794manage_dirs_pattern(virtqemud_t, svirt_image_t, svirt_image_t)
17701795manage_files_pattern(virtqemud_t, svirt_image_t, svirt_image_t)
@@ -1789,6 +1814,7 @@ corenet_rw_tun_tap_dev(virtqemud_t)
17891814corenet_tcp_bind_generic_node(virtqemud_t)
17901815corenet_tcp_bind_vnc_port(virtqemud_t)
17911816
1817+ dev_read_cpuid(virtqemud_t)
17921818dev_read_sysfs(virtqemud_t)
17931819dev_read_urand(virtqemud_t)
17941820dev_relabel_all_dev_nodes(virtqemud_t)
@@ -1803,13 +1829,19 @@ fs_manage_hugetlbfs_dirs(virtqemud_t)
18031829fs_manage_cgroup_dirs(virtqemud_t)
18041830fs_manage_cgroup_files(virtqemud_t)
18051831fs_manage_tmpfs_chr_files(virtqemud_t)
1832+ fs_manage_tmpfs_dirs(virtqemud_t)
1833+ fs_manage_tmpfs_symlinks(virtqemud_t)
1834+ fs_mount_tmpfs(virtqemud_t)
18061835fs_read_nsfs_files(virtqemud_t)
1836+ fs_relabel_tmpfs_chr_file(virtqemud_t)
18071837
1838+ init_stream_connect(virtqemud_t)
18081839init_stream_connect_script(virtqemud_t)
18091840
18101841seutil_read_default_contexts(virtqemud_t)
18111842seutil_read_file_contexts(virtqemud_t)
18121843
1844+ userdom_read_all_users_state(virtqemud_t)
18131845userdom_read_user_home_content_files(virtqemud_t)
18141846userdom_relabel_user_home_files(virtqemud_t)
18151847
@@ -1825,14 +1857,22 @@ optional_policy(`
18251857#
18261858# virtstoraged local policy
18271859#
1828- manage_files_pattern(virtstoraged_t, virt_image_t, virt_image_t)
1860+ allow virtstoraged_t self:capability { dac_override dac_read_search };
1861+
1862+ files_tmp_filetrans(virtstoraged_t, virtstoraged_tmp_t, { file dir })
18291863
18301864manage_lnk_files_pattern(virtstoraged_t, virt_etc_rw_t, virt_etc_rw_t)
18311865
1866+ manage_files_pattern(virtstoraged_t, virt_image_t, virt_image_t)
1867+
1868+ manage_files_pattern(virtstoraged_t, svirt_image_t, svirt_image_t)
1869+
18321870manage_dirs_pattern(virtstoraged_t, virt_var_lib_t, virt_var_lib_t)
18331871manage_files_pattern(virtstoraged_t, virt_var_lib_t, virt_var_lib_t)
18341872
1835- fs_getattr_xattr_fs(virtstoraged_t)
1873+ corecmd_exec_bin(virtstoraged_t)
1874+
1875+ fs_getattr_all_fs(virtstoraged_t)
18361876
18371877userdom_read_user_home_content_files(virtstoraged_t)
18381878
0 commit comments