+ ##
+@@ -1332,6 +1332,10 @@ files_relabelfrom_home(systemd_tmpfiles_t)
+ files_relabelto_home(systemd_tmpfiles_t)
+ files_relabelto_etc_dirs(systemd_tmpfiles_t)
+ files_setattr_lock_dirs(systemd_tmpfiles_t)
++
++files_manage_non_auth_files(systemd_tmpfiles_t)
++files_relabel_non_auth_files(systemd_tmpfiles_t)
++
+ # for /etc/mtab
+ files_manage_etc_symlinks(systemd_tmpfiles_t)
+
+--
+2.17.1
+
diff --git a/recipes-security/refpolicy/refpolicy/0050-policy-modules-kernel-terminal-allow-loging-to-reset.patch b/recipes-security/refpolicy/refpolicy/0050-policy-modules-kernel-terminal-allow-loging-to-reset.patch
deleted file mode 100644
index e15e57b..0000000
--- a/recipes-security/refpolicy/refpolicy/0050-policy-modules-kernel-terminal-allow-loging-to-reset.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From fb900b71d7e1fa5c3bd997e6deadcaae2b65b05a Mon Sep 17 00:00:00 2001
-From: Yi Zhao
-Date: Mon, 29 Jun 2020 14:27:02 +0800
-Subject: [PATCH] policy/modules/kernel/terminal: allow loging to reset tty
- perms
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Yi Zhao
----
- policy/modules/kernel/terminal.if | 4 +---
- 1 file changed, 1 insertion(+), 3 deletions(-)
-
-diff --git a/policy/modules/kernel/terminal.if b/policy/modules/kernel/terminal.if
-index 8f9578dbc..3821ab9b0 100644
---- a/policy/modules/kernel/terminal.if
-+++ b/policy/modules/kernel/terminal.if
-@@ -119,9 +119,7 @@ interface(`term_user_tty',`
-
- # Debian login is from shadow utils and does not allow resetting the perms.
- # have to fix this!
-- ifdef(`distro_debian',`
-- type_change $1 ttynode:chr_file $2;
-- ')
-+ type_change $1 ttynode:chr_file $2;
-
- tunable_policy(`console_login',`
- # When user logs in from /dev/console, relabel it
---
-2.17.1
-
diff --git a/recipes-security/refpolicy/refpolicy/0050-policy-modules-system-systemd-fix-systemd-resolved-s.patch b/recipes-security/refpolicy/refpolicy/0050-policy-modules-system-systemd-fix-systemd-resolved-s.patch
new file mode 100644
index 0000000..a0dc9f2
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0050-policy-modules-system-systemd-fix-systemd-resolved-s.patch
@@ -0,0 +1,69 @@
+From 8e762e1070e98a4235a70536ee6ca81725858a4b Mon Sep 17 00:00:00 2001
+From: Yi Zhao
+Date: Mon, 25 Jan 2021 14:14:59 +0800
+Subject: [PATCH] policy/modules/system/systemd: fix systemd-resolved startup
+ failures
+
+* Allow systemd_resolved_t to create socket file
+* Allow systemd_resolved_t to manage systemd_resolved_runtime_t link
+ files
+* Allow systemd_resolved_t to send and recevie messages from dhcpc over
+ dbus
+
+Fixes:
+avc: denied { create } for pid=258 comm="systemd-resolve"
+name="io.systemd.Resolve"
+scontext=system_u:system_r:systemd_resolved_t:s0-s15:c0.c1023
+tcontext=system_u:object_r:systemd_resolved_runtime_t:s0
+tclass=sock_file permissive=0
+
+avc: denied { create } for pid=329 comm="systemd-resolve"
+name=".#stub-resolv.conf53cb7f9d1e3aa72b"
+scontext=system_u:system_r:systemd_resolved_t:s0-s15:c0.c1023
+tcontext=system_u:object_r:systemd_resolved_runtime_t:s0 tclass=lnk_file
+permissive=0
+
+avc: denied { send_msg } for msgtype=method_call
+interface=org.freedesktop.resolve1.Manager member=RevertLink
+dest=org.freedesktop.resolve1 spid=340 tpid=345
+scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
+tcontext=system_u:system_r:systemd_resolved_t:s0-s15:c0.c1023
+tclass=dbus permissive=0
+
+avc: denied { send_msg } for msgtype=method_return dest=:1.6 spid=345
+tpid=340 scontext=system_u:system_r:systemd_resolved_t:s0-s15:c0.c1023
+tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023 tclass=dbus
+permissive=0
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Yi Zhao
+---
+ policy/modules/system/systemd.te | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
+index 7da836136..0411729ea 100644
+--- a/policy/modules/system/systemd.te
++++ b/policy/modules/system/systemd.te
+@@ -1164,6 +1164,8 @@ allow systemd_resolved_t systemd_networkd_runtime_t:dir watch;
+
+ manage_dirs_pattern(systemd_resolved_t, systemd_resolved_runtime_t, systemd_resolved_runtime_t)
+ manage_files_pattern(systemd_resolved_t, systemd_resolved_runtime_t, systemd_resolved_runtime_t)
++manage_sock_files_pattern(systemd_resolved_t, systemd_resolved_runtime_t, systemd_resolved_runtime_t)
++manage_lnk_files_pattern(systemd_resolved_t, systemd_resolved_runtime_t, systemd_resolved_runtime_t)
+ init_runtime_filetrans(systemd_resolved_t, systemd_resolved_runtime_t, dir)
+
+ dev_read_sysfs(systemd_resolved_t)
+@@ -1194,6 +1196,8 @@ seutil_read_file_contexts(systemd_resolved_t)
+ systemd_log_parse_environment(systemd_resolved_t)
+ systemd_read_networkd_runtime(systemd_resolved_t)
+
++sysnet_dbus_chat_dhcpc(systemd_resolved_t)
++
+ optional_policy(`
+ dbus_connect_system_bus(systemd_resolved_t)
+ dbus_system_bus_client(systemd_resolved_t)
+--
+2.17.1
+
diff --git a/recipes-security/refpolicy/refpolicy/0051-policy-modules-system-init-add-capability2-bpf-and-p.patch b/recipes-security/refpolicy/refpolicy/0051-policy-modules-system-init-add-capability2-bpf-and-p.patch
new file mode 100644
index 0000000..f7758c5
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0051-policy-modules-system-init-add-capability2-bpf-and-p.patch
@@ -0,0 +1,37 @@
+From 2d932ba7140d91cf2a8386b0240f4f1014124746 Mon Sep 17 00:00:00 2001
+From: Yi Zhao
+Date: Wed, 3 Feb 2021 09:47:59 +0800
+Subject: [PATCH] policy/modules/system/init: add capability2 bpf and perfmon
+ for init_t
+
+Fixes:
+avc: denied { bpf } for pid=1 comm="systemd" capability=39
+scontext=system_u:system_r:init_t tcontext=system_u:system_r:init_t
+tclass=capability2 permissive=0
+avc: denied { perfmon } for pid=1 comm="systemd" capability=38
+scontext=system_u:system_r:init_t tcontext=system_u:system_r:init_t
+tclass=capability2 permissive=0
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Yi Zhao
+---
+ policy/modules/system/init.te | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te
+index e82177938..b7d494398 100644
+--- a/policy/modules/system/init.te
++++ b/policy/modules/system/init.te
+@@ -134,7 +134,7 @@ ifdef(`enable_mls',`
+
+ # Use capabilities. old rule:
+ allow init_t self:capability { chown dac_override dac_read_search fowner fsetid kill setgid setuid setpcap linux_immutable net_bind_service net_broadcast net_admin net_raw ipc_lock ipc_owner sys_rawio sys_chroot sys_ptrace sys_pacct sys_admin sys_boot sys_nice sys_resource sys_time sys_tty_config mknod lease audit_write audit_control setfcap };
+-allow init_t self:capability2 { wake_alarm block_suspend };
++allow init_t self:capability2 { wake_alarm block_suspend bpf perfmon };
+ # is ~sys_module really needed? observed:
+ # sys_boot
+ # sys_tty_config
+--
+2.17.1
+
diff --git a/recipes-security/refpolicy/refpolicy/0051-policy-modules-system-selinuxutil-allow-semanage_t-t.patch b/recipes-security/refpolicy/refpolicy/0051-policy-modules-system-selinuxutil-allow-semanage_t-t.patch
deleted file mode 100644
index d4f996d..0000000
--- a/recipes-security/refpolicy/refpolicy/0051-policy-modules-system-selinuxutil-allow-semanage_t-t.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 2c8464254adf0b2635e5abf4ccc4473c96fa0006 Mon Sep 17 00:00:00 2001
-From: Yi Zhao
-Date: Mon, 29 Jun 2020 14:30:58 +0800
-Subject: [PATCH] policy/modules/system/selinuxutil: allow semanage_t to read
- /var/lib
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Yi Zhao
----
- policy/modules/system/selinuxutil.te | 6 ++----
- 1 file changed, 2 insertions(+), 4 deletions(-)
-
-diff --git a/policy/modules/system/selinuxutil.te b/policy/modules/system/selinuxutil.te
-index fad28f179..09fef149b 100644
---- a/policy/modules/system/selinuxutil.te
-+++ b/policy/modules/system/selinuxutil.te
-@@ -544,10 +544,8 @@ userdom_map_user_home_content_files(semanage_t)
- userdom_read_user_tmp_files(semanage_t)
- userdom_map_user_tmp_files(semanage_t)
-
--ifdef(`distro_debian',`
-- files_read_var_lib_files(semanage_t)
-- files_read_var_lib_symlinks(semanage_t)
--')
-+files_read_var_lib_files(semanage_t)
-+files_read_var_lib_symlinks(semanage_t)
-
- ifdef(`distro_ubuntu',`
- optional_policy(`
---
-2.17.1
-
diff --git a/recipes-security/refpolicy/refpolicy/0052-policy-modules-system-sysnetwork-allow-ifconfig_t-to.patch b/recipes-security/refpolicy/refpolicy/0052-policy-modules-system-sysnetwork-allow-ifconfig_t-to.patch
deleted file mode 100644
index 5e606d7..0000000
--- a/recipes-security/refpolicy/refpolicy/0052-policy-modules-system-sysnetwork-allow-ifconfig_t-to.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From a3e4135c543be8d3a054e6f74629240370d111ed Mon Sep 17 00:00:00 2001
-From: Yi Zhao
-Date: Mon, 27 May 2019 15:55:19 +0800
-Subject: [PATCH] policy/modules/system/sysnetwork: allow ifconfig_t to read
- dhcp client state files
-
-Fixes:
-type=AVC msg=audit(1558942740.789:50): avc: denied { read } for
-pid=221 comm="ip" path="/var/lib/dhcp/dhclient.leases" dev="vda"
-ino=29858 scontext=system_u:system_r:ifconfig_t
-tcontext=system_u:object_r:dhcpc_state_t tclass=file permissive=1
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Yi Zhao
----
- policy/modules/system/sysnetwork.te | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/policy/modules/system/sysnetwork.te b/policy/modules/system/sysnetwork.te
-index bbdbcdc7e..a77738924 100644
---- a/policy/modules/system/sysnetwork.te
-+++ b/policy/modules/system/sysnetwork.te
-@@ -319,6 +319,8 @@ kernel_request_load_module(ifconfig_t)
- kernel_search_network_sysctl(ifconfig_t)
- kernel_rw_net_sysctls(ifconfig_t)
-
-+sysnet_read_dhcpc_state(ifconfig_t)
-+
- corenet_rw_tun_tap_dev(ifconfig_t)
-
- dev_read_sysfs(ifconfig_t)
---
-2.17.1
-
diff --git a/recipes-security/refpolicy/refpolicy/0052-policy-modules-system-systemd-allow-systemd_logind_t.patch b/recipes-security/refpolicy/refpolicy/0052-policy-modules-system-systemd-allow-systemd_logind_t.patch
new file mode 100644
index 0000000..aa49ac7
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0052-policy-modules-system-systemd-allow-systemd_logind_t.patch
@@ -0,0 +1,37 @@
+From 5db5b20728dff6c5e75dc07ea4feb6c507661b62 Mon Sep 17 00:00:00 2001
+From: Yi Zhao
+Date: Wed, 8 Jul 2020 13:53:28 +0800
+Subject: [PATCH] policy/modules/system/systemd: allow systemd_logind_t to
+ watch initrc_runtime_t
+
+Fixes:
+avc: denied { watch } for pid=200 comm="systemd-logind"
+path="/run/utmp" dev="tmpfs" ino=12766
+scontext=system_u:system_r:systemd_logind_t:s0-s15:c0.c1023
+tcontext=system_u:object_r:initrc_runtime_t:s0 tclass=file permissive=0
+
+systemd-logind[200]: Failed to create inotify watch on /var/run/utmp, ignoring: Permission denied
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Yi Zhao
+---
+ policy/modules/system/systemd.te | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
+index 0411729ea..2d9d7d331 100644
+--- a/policy/modules/system/systemd.te
++++ b/policy/modules/system/systemd.te
+@@ -651,6 +651,8 @@ init_stop_all_units(systemd_logind_t)
+ init_start_system(systemd_logind_t)
+ init_stop_system(systemd_logind_t)
+
++allow systemd_logind_t initrc_runtime_t:file watch;
++
+ locallogin_read_state(systemd_logind_t)
+
+ seutil_libselinux_linked(systemd_logind_t)
+--
+2.17.1
+
diff --git a/recipes-security/refpolicy/refpolicy/0053-policy-modules-services-ntp-allow-ntpd_t-to-watch-sy.patch b/recipes-security/refpolicy/refpolicy/0053-policy-modules-services-ntp-allow-ntpd_t-to-watch-sy.patch
deleted file mode 100644
index 85a6d63..0000000
--- a/recipes-security/refpolicy/refpolicy/0053-policy-modules-services-ntp-allow-ntpd_t-to-watch-sy.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From f23bb02c92bcbf7afa0c6b445719df6b06df15ea Mon Sep 17 00:00:00 2001
-From: Yi Zhao
-Date: Mon, 6 Jul 2020 09:06:08 +0800
-Subject: [PATCH] policy/modules/services/ntp: allow ntpd_t to watch system bus
- runtime directories and named sockets
-
-Fixes:
-avc: denied { read } for pid=197 comm="systemd-timesyn" name="dbus"
-dev="tmpfs" ino=14064 scontext=system_u:system_r:ntpd_t:s0-s15:c0.c1023
-tcontext=system_u:object_r:system_dbusd_runtime_t:s0 tclass=dir
-permissive=0
-
-avc: denied { watch } for pid=197 comm="systemd-timesyn"
-path="/run/dbus" dev="tmpfs" ino=14064
-scontext=system_u:system_r:ntpd_t:s0-s15:c0.c1023
-tcontext=system_u:object_r:system_dbusd_runtime_t:s0 tclass=dir
-permissive=0
-
-avc: denied { read } for pid=197 comm="systemd-timesyn"
-name="system_bus_socket" dev="tmpfs" ino=14067
-scontext=system_u:system_r:ntpd_t:s0-s15:c0.c1023
-tcontext=system_u:object_r:system_dbusd_runtime_t:s0 tclass=sock_file
-permissive=0
-
-avc: denied { watch } for pid=197 comm="systemd-timesyn"
-path="/run/dbus/system_bus_socket" dev="tmpfs" ino=14067
-scontext=system_u:system_r:ntpd_t:s0-s15:c0.c1023
-tcontext=system_u:object_r:system_dbusd_runtime_t:s0 tclass=sock_file
-permissive=0
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Yi Zhao
----
- policy/modules/services/ntp.te | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/policy/modules/services/ntp.te b/policy/modules/services/ntp.te
-index 81f8c76bb..75603e16b 100644
---- a/policy/modules/services/ntp.te
-+++ b/policy/modules/services/ntp.te
-@@ -141,6 +141,10 @@ userdom_list_user_home_dirs(ntpd_t)
- ifdef(`init_systemd',`
- allow ntpd_t ntpd_unit_t:file read_file_perms;
-
-+ dbus_watch_system_bus_runtime_dirs(ntpd_t)
-+ allow ntpd_t system_dbusd_runtime_t:dir read;
-+ dbus_watch_system_bus_runtime_named_sockets(ntpd_t)
-+ allow ntpd_t system_dbusd_runtime_t:sock_file read;
- dbus_system_bus_client(ntpd_t)
- dbus_connect_system_bus(ntpd_t)
- init_dbus_chat(ntpd_t)
---
-2.17.1
-
diff --git a/recipes-security/refpolicy/refpolicy/0053-policy-modules-system-logging-set-label-devlog_t-to-.patch b/recipes-security/refpolicy/refpolicy/0053-policy-modules-system-logging-set-label-devlog_t-to-.patch
new file mode 100644
index 0000000..a4b387a
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0053-policy-modules-system-logging-set-label-devlog_t-to-.patch
@@ -0,0 +1,86 @@
+From a92be78e20a0838c2f04cf8d2781dcf918f8d7ab Mon Sep 17 00:00:00 2001
+From: Yi Zhao
+Date: Tue, 14 May 2019 16:02:19 +0800
+Subject: [PATCH] policy/modules/system/logging: set label devlog_t to symlink
+ /dev/log
+
+* Set labe devlog_t to symlink /dev/log
+* Allow syslogd_t to manage devlog_t link file
+
+Fixes:
+avc: denied { unlink } for pid=250 comm="rsyslogd" name="log"
+dev="devtmpfs" ino=10997
+scontext=system_u:system_r:syslogd_t:s15:c0.c1023
+tcontext=system_u:object_r:device_t:s0 tclass=lnk_file permissive=0
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Yi Zhao
+---
+ policy/modules/system/logging.fc | 2 ++
+ policy/modules/system/logging.if | 4 ++++
+ policy/modules/system/logging.te | 1 +
+ 3 files changed, 7 insertions(+)
+
+diff --git a/policy/modules/system/logging.fc b/policy/modules/system/logging.fc
+index a4ecd570a..02f0b6270 100644
+--- a/policy/modules/system/logging.fc
++++ b/policy/modules/system/logging.fc
+@@ -1,4 +1,5 @@
+ /dev/log -s gen_context(system_u:object_r:devlog_t,mls_systemhigh)
++/dev/log -l gen_context(system_u:object_r:devlog_t,s0)
+
+ /etc/rsyslog\.conf -- gen_context(system_u:object_r:syslog_conf_t,s0)
+ /etc/syslog\.conf -- gen_context(system_u:object_r:syslog_conf_t,s0)
+@@ -24,6 +25,7 @@
+ /usr/lib/systemd/system/auditd.* -- gen_context(system_u:object_r:auditd_unit_t,s0)
+ /usr/lib/systemd/system/[^/]*systemd-journal.* -- gen_context(system_u:object_r:syslogd_unit_t,s0)
+ /usr/lib/systemd/system/rsyslog.*\.service -- gen_context(system_u:object_r:syslogd_unit_t,s0)
++/usr/lib/systemd/system/syslog.*\.service -- gen_context(system_u:object_r:syslogd_unit_t,s0)
+ /usr/lib/systemd/systemd-journald -- gen_context(system_u:object_r:syslogd_exec_t,s0)
+ /usr/lib/systemd/systemd-kmsg-syslogd -- gen_context(system_u:object_r:syslogd_exec_t,s0)
+
+diff --git a/policy/modules/system/logging.if b/policy/modules/system/logging.if
+index 9bb3afdb2..7233a108c 100644
+--- a/policy/modules/system/logging.if
++++ b/policy/modules/system/logging.if
+@@ -661,6 +661,7 @@ interface(`logging_send_syslog_msg',`
+ ')
+
+ allow $1 devlog_t:sock_file write_sock_file_perms;
++ allow $1 devlog_t:lnk_file read_lnk_file_perms;
+
+ # systemd journal socket is in /run/systemd/journal/dev-log
+ init_search_run($1)
+@@ -722,6 +723,7 @@ interface(`logging_relabelto_devlog_sock_files',`
+ ')
+
+ allow $1 devlog_t:sock_file relabelto_sock_file_perms;
++ allow $1 devlog_t:lnk_file relabelto_lnk_file_perms;
+ ')
+
+ ########################################
+@@ -741,6 +743,8 @@ interface(`logging_create_devlog',`
+
+ allow $1 devlog_t:sock_file manage_sock_file_perms;
+ dev_filetrans($1, devlog_t, sock_file)
++ allow $1 devlog_t:lnk_file manage_lnk_file_perms;
++ dev_filetrans($1, devlog_t, lnk_file)
+ init_runtime_filetrans($1, devlog_t, sock_file, "syslog")
+ ')
+
+diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te
+index 9b3254f63..d864cfd3d 100644
+--- a/policy/modules/system/logging.te
++++ b/policy/modules/system/logging.te
+@@ -398,6 +398,7 @@ allow syslogd_t syslog_conf_t:dir list_dir_perms;
+
+ # Create and bind to /dev/log or /var/run/log.
+ allow syslogd_t devlog_t:sock_file manage_sock_file_perms;
++allow syslogd_t devlog_t:lnk_file manage_lnk_file_perms;
+ files_runtime_filetrans(syslogd_t, devlog_t, sock_file)
+ init_runtime_filetrans(syslogd_t, devlog_t, sock_file, "dev-log")
+
+--
+2.17.1
+
diff --git a/recipes-security/refpolicy/refpolicy/0054-policy-modules-system-systemd-enable-support-for-sys.patch b/recipes-security/refpolicy/refpolicy/0054-policy-modules-system-systemd-enable-support-for-sys.patch
deleted file mode 100644
index 9dde899..0000000
--- a/recipes-security/refpolicy/refpolicy/0054-policy-modules-system-systemd-enable-support-for-sys.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From 9eee952a306000eaa5e92b578f3caa35b6a35699 Mon Sep 17 00:00:00 2001
-From: Wenzong Fan
-Date: Thu, 4 Feb 2016 06:03:19 -0500
-Subject: [PATCH] policy/modules/system/systemd: enable support for
- systemd-tmpfiles to manage all non-security files
-
-Fixes:
-systemd-tmpfiles[137]: Failed to create directory or subvolume "/var/volatile/log": Permission denied
-systemd-tmpfiles[137]: Failed to create directory or subvolume "/var/volatile/tmp": Permission denied
-systemd-tmpfiles[137]: Failed to create directory or subvolume "/var/log/audit": Permission denied
-
-avc: denied { write } for pid=137 comm="systemd-tmpfile" name="/"
-dev="tmpfs" ino=12400 scontext=system_u:system_r:systemd_tmpfiles_t
-tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=0
-
-avc: denied { read } for pid=137 comm="systemd-tmpfile" name="dbus"
-dev="vda" ino=12363 scontext=system_u:system_r:systemd_tmpfiles_t
-tcontext=system_u:object_r:system_dbusd_var_lib_t tclass=dir
-permissive=0
-
-avc: denied { relabelfrom } for pid=137 comm="systemd-tmpfile"
-name="log" dev="vda" ino=14129
-scontext=system_u:system_r:systemd_tmpfiles_t
-tcontext=system_u:object_r:var_log_t tclass=lnk_file permissive=0
-
-avc: denied { create } for pid=137 comm="systemd-tmpfile"
-name="audit" scontext=system_u:system_r:systemd_tmpfiles_t
-tcontext=system_u:object_r:auditd_log_t tclass=dir permissive=0
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Wenzong Fan
-Signed-off-by: Yi Zhao
----
- policy/modules/system/systemd.te | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
-index 136990d08..c7fe51b62 100644
---- a/policy/modules/system/systemd.te
-+++ b/policy/modules/system/systemd.te
-@@ -10,7 +10,7 @@ policy_module(systemd, 1.9.14)
- ## Enable support for systemd-tmpfiles to manage all non-security files.
- ##
- ##
--gen_tunable(systemd_tmpfiles_manage_all, false)
-+gen_tunable(systemd_tmpfiles_manage_all, true)
-
- ##
- ##
-@@ -1196,6 +1196,10 @@ files_relabel_var_lib_dirs(systemd_tmpfiles_t)
- files_relabelfrom_home(systemd_tmpfiles_t)
- files_relabelto_home(systemd_tmpfiles_t)
- files_relabelto_etc_dirs(systemd_tmpfiles_t)
-+
-+files_manage_non_auth_files(systemd_tmpfiles_t)
-+files_relabel_non_auth_files(systemd_tmpfiles_t)
-+
- # for /etc/mtab
- files_manage_etc_symlinks(systemd_tmpfiles_t)
-
---
-2.17.1
-
diff --git a/recipes-security/refpolicy/refpolicy/0054-policy-modules-system-systemd-support-systemd-user.patch b/recipes-security/refpolicy/refpolicy/0054-policy-modules-system-systemd-support-systemd-user.patch
new file mode 100644
index 0000000..f7abefb
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0054-policy-modules-system-systemd-support-systemd-user.patch
@@ -0,0 +1,189 @@
+From bd77e8e51962bb6a8c5708f3e5362007c915498e Mon Sep 17 00:00:00 2001
+From: Yi Zhao
+Date: Thu, 4 Feb 2021 10:48:54 +0800
+Subject: [PATCH] policy/modules/system/systemd: support systemd --user
+
+Fixes:
+$ systemctl status user@0.service
+* user@0.service - User Manager for UID 0
+ Loaded: loaded (/lib/systemd/system/user@.service; static)
+ Active: failed (Result: exit-code) since Thu 2021-02-04 02:57:32 UTC; 11s ago
+ Docs: man:user@.service(5)
+ Process: 1502 ExecStart=/lib/systemd/systemd --user (code=exited, status=1/FAILURE)
+ Main PID: 1502 (code=exited, status=1/FAILURE)
+
+Feb 04 02:57:32 intel-x86-64 systemd[1]: Starting User Manager for UID 0...
+Feb 04 02:57:32 intel-x86-64 systemd[1502]: selinux_status_open() failed to open the status page, using the netlink fallback.
+Feb 04 02:57:32 intel-x86-64 systemd[1502]: Failed to initialize SELinux labeling handle: Permission denied
+Feb 04 02:57:32 intel-x86-64 systemd[1]: user@0.service: Main process exited, code=exited, status=1/FAILURE
+Feb 04 02:57:32 intel-x86-64 systemd[1]: user@0.service: Failed with result 'exit-code'.
+Feb 04 02:57:32 intel-x86-64 systemd[1]: Failed to start User Manager for UID 0.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Yi Zhao
+---
+ policy/modules/roles/sysadm.te | 2 +
+ policy/modules/system/init.if | 1 +
+ policy/modules/system/logging.te | 5 ++-
+ policy/modules/system/systemd.if | 75 +++++++++++++++++++++++++++++++-
+ 4 files changed, 81 insertions(+), 2 deletions(-)
+
+diff --git a/policy/modules/roles/sysadm.te b/policy/modules/roles/sysadm.te
+index 1642f3b93..1de7e441d 100644
+--- a/policy/modules/roles/sysadm.te
++++ b/policy/modules/roles/sysadm.te
+@@ -81,6 +81,8 @@ ifdef(`init_systemd',`
+ # Allow sysadm to resolve the username of dynamic users by calling
+ # LookupDynamicUserByUID on org.freedesktop.systemd1.
+ init_dbus_chat(sysadm_t)
++
++ systemd_sysadm_user(sysadm_t)
+ ')
+
+ tunable_policy(`allow_ptrace',`
+diff --git a/policy/modules/system/init.if b/policy/modules/system/init.if
+index ba533ba1a..98e94283f 100644
+--- a/policy/modules/system/init.if
++++ b/policy/modules/system/init.if
+@@ -943,6 +943,7 @@ interface(`init_unix_stream_socket_connectto',`
+ ')
+
+ allow $1 init_t:unix_stream_socket connectto;
++ allow $1 initrc_t:unix_stream_socket connectto;
+ ')
+
+ ########################################
+diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te
+index d864cfd3d..bdd97631c 100644
+--- a/policy/modules/system/logging.te
++++ b/policy/modules/system/logging.te
+@@ -519,7 +519,7 @@ ifdef(`init_systemd',`
+ # for systemd-journal
+ allow syslogd_t self:netlink_audit_socket connected_socket_perms;
+ allow syslogd_t self:capability2 audit_read;
+- allow syslogd_t self:capability { chown setgid setuid sys_ptrace };
++ allow syslogd_t self:capability { chown setgid setuid sys_ptrace dac_read_search };
+ allow syslogd_t self:netlink_audit_socket { getattr getopt read setopt write nlmsg_write };
+
+ # remove /run/log/journal when switching to permanent storage
+@@ -555,6 +555,9 @@ ifdef(`init_systemd',`
+ systemd_manage_journal_files(syslogd_t)
+
+ udev_read_runtime_files(syslogd_t)
++
++ userdom_search_user_runtime(syslogd_t)
++ systemd_search_user_runtime(syslogd_t)
+ ')
+
+ ifdef(`distro_gentoo',`
+diff --git a/policy/modules/system/systemd.if b/policy/modules/system/systemd.if
+index 6a66a2d79..152139261 100644
+--- a/policy/modules/system/systemd.if
++++ b/policy/modules/system/systemd.if
+@@ -30,6 +30,7 @@ template(`systemd_role_template',`
+ attribute systemd_user_session_type, systemd_log_parse_env_type;
+ type systemd_user_runtime_t, systemd_user_runtime_notify_t;
+ type systemd_run_exec_t, systemd_analyze_exec_t;
++ type session_dbusd_runtime_t, systemd_user_runtime_dir_t;
+ ')
+
+ #################################
+@@ -55,10 +56,42 @@ template(`systemd_role_template',`
+
+ allow $3 systemd_user_runtime_notify_t:sock_file { manage_sock_file_perms relabel_sock_file_perms };
+
++ allow $1_systemd_t systemd_user_runtime_t:dir { manage_dir_perms relabel_dir_perms };
++ allow $1_systemd_t systemd_user_runtime_t:file { manage_file_perms relabel_file_perms };
++ allow $1_systemd_t systemd_user_runtime_t:lnk_file { manage_lnk_file_perms relabel_lnk_file_perms };
++ allow $1_systemd_t systemd_user_runtime_t:fifo_file { manage_fifo_file_perms relabel_fifo_file_perms };
++ allow $1_systemd_t systemd_user_runtime_t:sock_file { manage_sock_file_perms relabel_sock_file_perms };
++ allow $1_systemd_t systemd_user_runtime_t:blk_file { manage_blk_file_perms relabel_blk_file_perms };
++ allow $1_systemd_t systemd_user_runtime_t:chr_file { manage_chr_file_perms relabel_chr_file_perms };
++ allow $1_systemd_t systemd_user_runtime_notify_t:sock_file { manage_sock_file_perms relabel_sock_file_perms };
++ allow $1_systemd_t session_dbusd_runtime_t:sock_file { manage_sock_file_perms relabel_sock_file_perms };
++ allow $1_systemd_t self:netlink_kobject_uevent_socket getopt;
++ allow $1_systemd_t self:process setrlimit;
++
++ kernel_getattr_proc($1_systemd_t)
++ fs_watch_cgroup_files($1_systemd_t)
++ files_watch_etc_dirs($1_systemd_t)
++
++ userdom_search_user_home_dirs($1_systemd_t)
++ allow $1_systemd_t $3:dir search_dir_perms;
++ allow $1_systemd_t $3:file read_file_perms;
++
++ allow $3 $1_systemd_t:unix_stream_socket { getattr read write };
++
++ allow systemd_user_runtime_dir_t systemd_user_runtime_t:dir { manage_dir_perms relabel_dir_perms };
++ allow systemd_user_runtime_dir_t systemd_user_runtime_t:file { manage_file_perms relabel_file_perms };
++ allow systemd_user_runtime_dir_t systemd_user_runtime_t:lnk_file { manage_lnk_file_perms relabel_lnk_file_perms };
++ allow systemd_user_runtime_dir_t systemd_user_runtime_t:fifo_file { manage_fifo_file_perms relabel_fifo_file_perms };
++ allow systemd_user_runtime_dir_t systemd_user_runtime_t:sock_file { manage_sock_file_perms relabel_sock_file_perms };
++ allow systemd_user_runtime_dir_t systemd_user_runtime_t:blk_file { manage_blk_file_perms relabel_blk_file_perms };
++ allow systemd_user_runtime_dir_t systemd_user_runtime_t:chr_file { manage_chr_file_perms relabel_chr_file_perms };
++ allow systemd_user_runtime_dir_t systemd_user_runtime_notify_t:sock_file { manage_sock_file_perms relabel_sock_file_perms };
++ allow systemd_user_runtime_dir_t session_dbusd_runtime_t:sock_file { manage_sock_file_perms relabel_sock_file_perms };
++
+ # This domain is per-role because of the below transitions.
+ # See the systemd --user section of systemd.te for the
+ # remainder of the rules.
+- allow $1_systemd_t $3:process { setsched rlimitinh };
++ allow $1_systemd_t $3:process { setsched rlimitinh noatsecure siginh };
+ corecmd_shell_domtrans($1_systemd_t, $3)
+ corecmd_bin_domtrans($1_systemd_t, $3)
+ allow $1_systemd_t self:process signal;
+@@ -479,6 +512,7 @@ interface(`systemd_stream_connect_userdb', `
+ init_search_runtime($1)
+ allow $1 systemd_userdb_runtime_t:dir list_dir_perms;
+ allow $1 systemd_userdb_runtime_t:sock_file write_sock_file_perms;
++ allow $1 systemd_userdb_runtime_t:lnk_file read_lnk_file_perms;
+ init_unix_stream_socket_connectto($1)
+ ')
+
+@@ -1353,3 +1387,42 @@ interface(`systemd_use_inherited_machined_ptys', `
+ allow $1 systemd_machined_t:fd use;
+ allow $1 systemd_machined_devpts_t:chr_file rw_inherited_term_perms;
+ ')
++
++#########################################
++##
++## sysadm user for systemd --user
++##
++##
++##
++## Role allowed access.
++##
++##
++#
++interface(`systemd_sysadm_user',`
++ gen_require(`
++ type sysadm_systemd_t;
++ ')
++
++ allow sysadm_systemd_t self:capability { mknod sys_admin };
++ allow sysadm_systemd_t self:capability2 { bpf perfmon };
++ allow $1 sysadm_systemd_t:system reload;
++')
++
++#######################################
++##
++## Search systemd users runtime directories.
++##
++##
++##
++## Domain allowed access.
++##
++##
++#
++interface(`systemd_search_user_runtime',`
++ gen_require(`
++ type systemd_user_runtime_t;
++ ')
++
++ allow $1 systemd_user_runtime_t:dir search_dir_perms;
++ allow $1 systemd_user_runtime_t:lnk_file read_lnk_file_perms;
++')
+--
+2.17.1
+
diff --git a/recipes-security/refpolicy/refpolicy/0055-policy-modules-system-logging-fix-systemd-journald-s.patch b/recipes-security/refpolicy/refpolicy/0055-policy-modules-system-logging-fix-systemd-journald-s.patch
deleted file mode 100644
index 7291d2e..0000000
--- a/recipes-security/refpolicy/refpolicy/0055-policy-modules-system-logging-fix-systemd-journald-s.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From e10a4ea43bb756bdecc30a3c14f0d2fe980405bd Mon Sep 17 00:00:00 2001
-From: Wenzong Fan
-Date: Thu, 4 Feb 2016 02:10:15 -0500
-Subject: [PATCH] policy/modules/system/logging: fix systemd-journald startup
- failures
-
-Fixes:
-avc: denied { search } for pid=233 comm="systemd-journal" name="/"
-dev="tmpfs" ino=12398 scontext=system_u:system_r:syslogd_t
-tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=0
-
-avc: denied { nlmsg_write } for pid=110 comm="systemd-journal"
-scontext=system_u:system_r:syslogd_t
-tcontext=system_u:system_r:syslogd_t tclass=netlink_audit_socket
-permissive=0
-
-avc: denied { audit_control } for pid=109 comm="systemd-journal"
-capability=30 scontext=system_u:system_r:syslogd_t
-tcontext=system_u:system_r:syslogd_t tclass=capability permissive=0
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Wenzong Fan
-Signed-off-by: Yi Zhao
----
- policy/modules/system/logging.fc | 1 +
- policy/modules/system/logging.te | 5 ++++-
- 2 files changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/policy/modules/system/logging.fc b/policy/modules/system/logging.fc
-index a4ecd570a..dee26a9f4 100644
---- a/policy/modules/system/logging.fc
-+++ b/policy/modules/system/logging.fc
-@@ -24,6 +24,7 @@
- /usr/lib/systemd/system/auditd.* -- gen_context(system_u:object_r:auditd_unit_t,s0)
- /usr/lib/systemd/system/[^/]*systemd-journal.* -- gen_context(system_u:object_r:syslogd_unit_t,s0)
- /usr/lib/systemd/system/rsyslog.*\.service -- gen_context(system_u:object_r:syslogd_unit_t,s0)
-+/usr/lib/systemd/system/syslog.*\.service -- gen_context(system_u:object_r:syslogd_unit_t,s0)
- /usr/lib/systemd/systemd-journald -- gen_context(system_u:object_r:syslogd_exec_t,s0)
- /usr/lib/systemd/systemd-kmsg-syslogd -- gen_context(system_u:object_r:syslogd_exec_t,s0)
-
-diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te
-index 95309f334..1d45a5fa9 100644
---- a/policy/modules/system/logging.te
-+++ b/policy/modules/system/logging.te
-@@ -438,6 +438,7 @@ allow syslogd_t syslogd_runtime_t:sock_file { create setattr unlink };
- allow syslogd_t syslogd_runtime_t:file map;
- manage_files_pattern(syslogd_t, syslogd_runtime_t, syslogd_runtime_t)
- files_runtime_filetrans(syslogd_t, syslogd_runtime_t, file)
-+fs_search_tmpfs(syslogd_t)
-
- kernel_read_crypto_sysctls(syslogd_t)
- kernel_read_system_state(syslogd_t)
-@@ -517,6 +518,8 @@ init_use_fds(syslogd_t)
- # cjp: this doesnt make sense
- logging_send_syslog_msg(syslogd_t)
-
-+logging_set_loginuid(syslogd_t)
-+
- miscfiles_read_localization(syslogd_t)
-
- seutil_read_config(syslogd_t)
-@@ -529,7 +532,7 @@ ifdef(`init_systemd',`
- allow syslogd_t self:netlink_audit_socket connected_socket_perms;
- allow syslogd_t self:capability2 audit_read;
- allow syslogd_t self:capability { chown setgid setuid sys_ptrace };
-- allow syslogd_t self:netlink_audit_socket { getattr getopt read setopt write };
-+ allow syslogd_t self:netlink_audit_socket { getattr getopt read setopt write nlmsg_write };
-
- # remove /run/log/journal when switching to permanent storage
- allow syslogd_t var_log_t:dir rmdir;
---
-2.17.1
-
diff --git a/recipes-security/refpolicy/refpolicy/0055-policy-modules-system-systemd-allow-systemd-generato.patch b/recipes-security/refpolicy/refpolicy/0055-policy-modules-system-systemd-allow-systemd-generato.patch
new file mode 100644
index 0000000..9d4bbf7
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0055-policy-modules-system-systemd-allow-systemd-generato.patch
@@ -0,0 +1,69 @@
+From 954a49ec0a4dc64fd9e513abe7a737d956b337ca Mon Sep 17 00:00:00 2001
+From: Yi Zhao
+Date: Tue, 9 Feb 2021 17:50:24 +0800
+Subject: [PATCH] policy/modules/system/systemd: allow systemd-generators to
+ get the attributes of tmpfs and cgroup
+
+* Allow systemd-generators to get the attributes of a tmpfs
+* Allow systemd-generators to get the attributes of cgroup filesystems
+
+Fixes:
+systemd[95]: /lib/systemd/system-generators/systemd-fstab-generator failed with exit status 1.
+
+avc: denied { getattr } for pid=102 comm="systemd-run-gen" name="/"
+dev="tmpfs" ino=11208 scontext=system_u:system_r:systemd_generator_t
+tcontext=system_u:object_r:tmpfs_t tclass=filesystem permissive=0
+
+avc: denied { getattr } for pid=98 comm="systemd-getty-g" name="/"
+dev="tmpfs" ino=11208 scontext=system_u:system_r:systemd_generator_t
+tcontext=system_u:object_r:tmpfs_t tclass=filesystem permissive=0
+
+avc: denied { getattr } for pid=104 comm="systemd-sysv-ge" name="/"
+dev="tmpfs" ino=11208 scontext=system_u:system_r:systemd_generator_t
+tcontext=system_u:object_r:tmpfs_t tclass=filesystem permissive=0
+
+avc: denied { getattr } for pid=97 comm="systemd-fstab-g" name="/"
+dev="tmpfs" ino=11208 scontext=system_u:system_r:systemd_generator_t
+tcontext=system_u:object_r:tmpfs_t tclass=filesystem permissive=0
+
+avc: denied { getattr } for pid=102 comm="systemd-run-gen" name="/"
+dev="cgroup" ino=1 scontext=system_u:system_r:systemd_generator_t
+tcontext=system_u:object_r:cgroup_t tclass=filesystem permissive=0
+
+avc: denied { getattr } for pid=100 comm="systemd-hiberna" name="/"
+dev="cgroup" ino=1 scontext=system_u:system_r:systemd_generator_t
+tcontext=system_u:object_r:cgroup_t tclass=filesystem permissive=0
+
+avc: denied { getattr } for pid=99 comm="systemd-gpt-aut" name="/"
+dev="cgroup2" ino=1 scontext=system_u:system_r:systemd_generator_t
+tcontext=system_u:object_r:cgroup_t tclass=filesystem permissive=0
+
+avc: denied { getattr } for pid=97 comm="systemd-fstab-g"
+path="/var/volatile" dev="vda" ino=37131
+scontext=system_u:system_r:systemd_generator_t
+tcontext=system_u:object_r:unlabeled_t tclass=dir permissive=0
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Yi Zhao
+---
+ policy/modules/system/systemd.te | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
+index 2d9d7d331..c1111198d 100644
+--- a/policy/modules/system/systemd.te
++++ b/policy/modules/system/systemd.te
+@@ -431,6 +431,9 @@ files_list_usr(systemd_generator_t)
+
+ fs_list_efivars(systemd_generator_t)
+ fs_getattr_xattr_fs(systemd_generator_t)
++fs_getattr_tmpfs(systemd_generator_t)
++fs_getattr_cgroup(systemd_generator_t)
++kernel_getattr_unlabeled_dirs(systemd_generator_t)
+
+ init_create_runtime_files(systemd_generator_t)
+ init_manage_runtime_dirs(systemd_generator_t)
+--
+2.17.1
+
diff --git a/recipes-security/refpolicy/refpolicy/0056-policy-modules-roles-sysadm-allow-sysadm_t-to-watch-.patch b/recipes-security/refpolicy/refpolicy/0056-policy-modules-roles-sysadm-allow-sysadm_t-to-watch-.patch
deleted file mode 100644
index 7cf3763..0000000
--- a/recipes-security/refpolicy/refpolicy/0056-policy-modules-roles-sysadm-allow-sysadm_t-to-watch-.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 7fd830d6b2c60dcf5b8ee0b2ff94436de63d5b8c Mon Sep 17 00:00:00 2001
-From: Yi Zhao
-Date: Mon, 29 Jun 2020 10:32:25 +0800
-Subject: [PATCH] policy/modules/roles/sysadm: allow sysadm_t to watch runtime
- dirs
-
-Fixes:
-Failed to add a watch for /run/systemd/ask-password: Permission denied
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Yi Zhao
----
- policy/modules/roles/sysadm.te | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/policy/modules/roles/sysadm.te b/policy/modules/roles/sysadm.te
-index fc0945fe4..07b9faf30 100644
---- a/policy/modules/roles/sysadm.te
-+++ b/policy/modules/roles/sysadm.te
-@@ -83,6 +83,12 @@ ifdef(`init_systemd',`
- # Allow sysadm to resolve the username of dynamic users by calling
- # LookupDynamicUserByUID on org.freedesktop.systemd1.
- init_dbus_chat(sysadm_t)
-+
-+ fs_watch_cgroup_files(sysadm_t)
-+ files_watch_etc_symlinks(sysadm_t)
-+ mount_watch_runtime_dirs(sysadm_t)
-+ systemd_filetrans_passwd_runtime_dirs(sysadm_t)
-+ allow sysadm_t systemd_passwd_runtime_t:dir watch;
- ')
-
- tunable_policy(`allow_ptrace',`
---
-2.17.1
-
diff --git a/recipes-security/refpolicy/refpolicy/0056-policy-modules-system-systemd-allow-systemd_backligh.patch b/recipes-security/refpolicy/refpolicy/0056-policy-modules-system-systemd-allow-systemd_backligh.patch
new file mode 100644
index 0000000..1c1b459
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0056-policy-modules-system-systemd-allow-systemd_backligh.patch
@@ -0,0 +1,35 @@
+From 8b0bb1e349e2ea021acec1639be0802ac4d7d0c2 Mon Sep 17 00:00:00 2001
+From: Yi Zhao
+Date: Thu, 4 Feb 2021 15:13:50 +0800
+Subject: [PATCH] policy/modules/system/systemd: allow systemd_backlight_t to
+ read kernel sysctl
+
+Fixes:
+avc: denied { search } for pid=354 comm="systemd-backlig" name="sys"
+dev="proc" ino=4026531854
+scontext=system_u:system_r:systemd_backlight_t:s0-s15:c0.c1023
+tcontext=system_u:object_r:sysctl_t:s0 tclass=dir permissive=0
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Yi Zhao
+---
+ policy/modules/system/systemd.te | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
+index c1111198d..7d2ba2796 100644
+--- a/policy/modules/system/systemd.te
++++ b/policy/modules/system/systemd.te
+@@ -324,6 +324,8 @@ udev_read_runtime_files(systemd_backlight_t)
+
+ files_search_var_lib(systemd_backlight_t)
+
++kernel_read_kernel_sysctls(systemd_backlight_t)
++
+ #######################################
+ #
+ # Binfmt local policy
+--
+2.17.1
+
diff --git a/recipes-security/refpolicy/refpolicy/0057-policy-modules-system-logging-fix-systemd-journald-s.patch b/recipes-security/refpolicy/refpolicy/0057-policy-modules-system-logging-fix-systemd-journald-s.patch
new file mode 100644
index 0000000..d283879
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0057-policy-modules-system-logging-fix-systemd-journald-s.patch
@@ -0,0 +1,47 @@
+From 5973dc3824b395ce9f6620e3ae432664cc357b66 Mon Sep 17 00:00:00 2001
+From: Wenzong Fan
+Date: Thu, 4 Feb 2016 02:10:15 -0500
+Subject: [PATCH] policy/modules/system/logging: fix systemd-journald startup
+ failures
+
+Fixes:
+avc: denied { audit_control } for pid=109 comm="systemd-journal"
+capability=30 scontext=system_u:system_r:syslogd_t
+tcontext=system_u:system_r:syslogd_t tclass=capability permissive=0
+
+avc: denied { search } for pid=233 comm="systemd-journal" name="/"
+dev="tmpfs" ino=12398 scontext=system_u:system_r:syslogd_t
+tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=0
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Wenzong Fan
+Signed-off-by: Yi Zhao
+---
+ policy/modules/system/logging.te | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te
+index bdd97631c..62caa7a56 100644
+--- a/policy/modules/system/logging.te
++++ b/policy/modules/system/logging.te
+@@ -492,6 +492,7 @@ files_var_lib_filetrans(syslogd_t, syslogd_var_lib_t, { file dir })
+
+ fs_getattr_all_fs(syslogd_t)
+ fs_search_auto_mountpoints(syslogd_t)
++fs_search_tmpfs(syslogd_t)
+
+ mls_file_write_all_levels(syslogd_t) # Need to be able to write to /var/run/ and /var/log directories
+
+@@ -552,6 +553,8 @@ ifdef(`init_systemd',`
+ # needed for systemd-initrd case when syslog socket is unlabelled
+ logging_send_syslog_msg(syslogd_t)
+
++ logging_set_loginuid(syslogd_t)
++
+ systemd_manage_journal_files(syslogd_t)
+
+ udev_read_runtime_files(syslogd_t)
+--
+2.17.1
+
diff --git a/recipes-security/refpolicy/refpolicy/0057-policy-modules-system-systemd-add-capability-mknod-f.patch b/recipes-security/refpolicy/refpolicy/0057-policy-modules-system-systemd-add-capability-mknod-f.patch
deleted file mode 100644
index b1a72d6..0000000
--- a/recipes-security/refpolicy/refpolicy/0057-policy-modules-system-systemd-add-capability-mknod-f.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 4782b27839064438f103b77c31e5db75189025a8 Mon Sep 17 00:00:00 2001
-From: Yi Zhao
-Date: Thu, 18 Jun 2020 16:14:45 +0800
-Subject: [PATCH] policy/modules/system/systemd: add capability mknod for
- systemd_user_runtime_dir_t
-
-Fixes:
-avc: denied { mknod } for pid=266 comm="systemd-user-ru" capability=27
-scontext=system_u:system_r:systemd_user_runtime_dir_t:s0-s15:c0.c1023
-tcontext=system_u:system_r:systemd_user_runtime_dir_t:s0-s15:c0.c1023
-tclass=capability permissive=0
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Yi Zhao
----
- policy/modules/system/systemd.te | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
-index c7fe51b62..f82031a09 100644
---- a/policy/modules/system/systemd.te
-+++ b/policy/modules/system/systemd.te
-@@ -1372,7 +1372,7 @@ seutil_libselinux_linked(systemd_user_session_type)
- # systemd-user-runtime-dir local policy
- #
-
--allow systemd_user_runtime_dir_t self:capability { fowner chown sys_admin dac_read_search dac_override };
-+allow systemd_user_runtime_dir_t self:capability { fowner chown sys_admin dac_read_search dac_override mknod };
- allow systemd_user_runtime_dir_t self:process setfscreate;
-
- domain_obj_id_change_exemption(systemd_user_runtime_dir_t)
---
-2.17.1
-
diff --git a/recipes-security/refpolicy/refpolicy/0058-policy-modules-services-cron-allow-crond_t-to-search.patch b/recipes-security/refpolicy/refpolicy/0058-policy-modules-services-cron-allow-crond_t-to-search.patch
new file mode 100644
index 0000000..b7e7c1d
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0058-policy-modules-services-cron-allow-crond_t-to-search.patch
@@ -0,0 +1,34 @@
+From e8ff96c9bb98305d1b50fccce67025df3ebbf184 Mon Sep 17 00:00:00 2001
+From: Yi Zhao
+Date: Thu, 23 May 2019 15:52:17 +0800
+Subject: [PATCH] policy/modules/services/cron: allow crond_t to search
+ logwatch_cache_t
+
+Fixes:
+avc: denied { search } for pid=234 comm="crond" name="logcheck"
+dev="vda" ino=29080 scontext=system_u:system_r:crond_t:s0-s15:c0.c1023
+tcontext=system_u:object_r:logwatch_cache_t:s0 tclass=dir permissive=0
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Yi Zhao
+---
+ policy/modules/services/cron.te | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/policy/modules/services/cron.te b/policy/modules/services/cron.te
+index 2902820b0..36eb33060 100644
+--- a/policy/modules/services/cron.te
++++ b/policy/modules/services/cron.te
+@@ -318,6 +318,8 @@ miscfiles_read_localization(crond_t)
+
+ userdom_list_user_home_dirs(crond_t)
+
++logwatch_search_cache_dir(crond_t)
++
+ tunable_policy(`cron_userdomain_transition',`
+ dontaudit crond_t cronjob_t:process transition;
+ dontaudit crond_t cronjob_t:fd use;
+--
+2.17.1
+
diff --git a/recipes-security/refpolicy/refpolicy/0058-policy-modules-system-systemd-systemd-gpt-auto-gener.patch b/recipes-security/refpolicy/refpolicy/0058-policy-modules-system-systemd-systemd-gpt-auto-gener.patch
deleted file mode 100644
index fc1684f..0000000
--- a/recipes-security/refpolicy/refpolicy/0058-policy-modules-system-systemd-systemd-gpt-auto-gener.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 0607a935759fe3143f473d4a444f92e01aaa2a45 Mon Sep 17 00:00:00 2001
-From: Yi Zhao
-Date: Tue, 23 Jun 2020 14:52:43 +0800
-Subject: [PATCH] policy/modules/system/systemd: systemd-gpt-auto-generator: do
- not audit attempts to read or write unallocated ttys
-
-Fixes:
-avc: denied { read write } for pid=87 comm="systemd-getty-g"
-name="ttyS0" dev="devtmpfs" ino=10128
-scontext=system_u:system_r:systemd_generator_t
-tcontext=system_u:object_r:tty_device_t tclass=chr_file permissive=0
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Yi Zhao
----
- policy/modules/system/systemd.te | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
-index f82031a09..fb8d4960f 100644
---- a/policy/modules/system/systemd.te
-+++ b/policy/modules/system/systemd.te
-@@ -400,6 +400,8 @@ storage_raw_read_fixed_disk(systemd_generator_t)
-
- systemd_log_parse_environment(systemd_generator_t)
-
-+term_dontaudit_use_unallocated_ttys(systemd_generator_t)
-+
- optional_policy(`
- fstools_exec(systemd_generator_t)
- ')
---
-2.17.1
-
diff --git a/recipes-security/refpolicy/refpolicy/0059-policy-modules-services-crontab-allow-sysadm_r-to-ru.patch b/recipes-security/refpolicy/refpolicy/0059-policy-modules-services-crontab-allow-sysadm_r-to-ru.patch
new file mode 100644
index 0000000..d5e40d0
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0059-policy-modules-services-crontab-allow-sysadm_r-to-ru.patch
@@ -0,0 +1,46 @@
+From 1571e6da8a90bb325a94330dcd130d56bae30b37 Mon Sep 17 00:00:00 2001
+From: Roy Li
+Date: Thu, 20 Feb 2014 17:07:05 +0800
+Subject: [PATCH] policy/modules/services/crontab: allow sysadm_r to run
+ crontab
+
+This permission has been given if release is not redhat; but we want it
+even we define distro_redhat
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Roy Li
+Signed-off-by: Yi Zhao
+---
+ policy/modules/roles/sysadm.te | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/policy/modules/roles/sysadm.te b/policy/modules/roles/sysadm.te
+index 1de7e441d..129e94229 100644
+--- a/policy/modules/roles/sysadm.te
++++ b/policy/modules/roles/sysadm.te
+@@ -1277,6 +1277,10 @@ optional_policy(`
+ zebra_admin(sysadm_t, sysadm_r)
+ ')
+
++optional_policy(`
++ cron_admin_role(sysadm_r, sysadm_t)
++')
++
+ ifndef(`distro_redhat',`
+ optional_policy(`
+ auth_role(sysadm_r, sysadm_t)
+@@ -1295,10 +1299,6 @@ ifndef(`distro_redhat',`
+ chromium_role(sysadm_r, sysadm_t)
+ ')
+
+- optional_policy(`
+- cron_admin_role(sysadm_r, sysadm_t)
+- ')
+-
+ optional_policy(`
+ cryfs_role(sysadm_r, sysadm_t)
+ ')
+--
+2.17.1
+
diff --git a/recipes-security/refpolicy/refpolicy/0059-policy-modules-services-rpc-fix-policy-for-nfsserver.patch b/recipes-security/refpolicy/refpolicy/0059-policy-modules-services-rpc-fix-policy-for-nfsserver.patch
deleted file mode 100644
index d4bdd37..0000000
--- a/recipes-security/refpolicy/refpolicy/0059-policy-modules-services-rpc-fix-policy-for-nfsserver.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-From fbf98576f32e33e55f3babeb9db255a459fad711 Mon Sep 17 00:00:00 2001
-From: Xin Ouyang
-Date: Fri, 23 Aug 2013 12:01:53 +0800
-Subject: [PATCH] policy/modules/services/rpc: fix policy for nfsserver to
- mount nfsd_fs_t
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Xin Ouyang
-Signed-off-by: Joe MacDonald
-Signed-off-by: Yi Zhao
----
- policy/modules/kernel/kernel.te | 2 ++
- policy/modules/services/rpc.fc | 2 ++
- policy/modules/services/rpc.te | 2 ++
- policy/modules/services/rpcbind.te | 6 ++++++
- 4 files changed, 12 insertions(+)
-
-diff --git a/policy/modules/kernel/kernel.te b/policy/modules/kernel/kernel.te
-index c8218bf8c..44c031a39 100644
---- a/policy/modules/kernel/kernel.te
-+++ b/policy/modules/kernel/kernel.te
-@@ -356,6 +356,8 @@ mls_process_read_all_levels(kernel_t)
- mls_process_write_all_levels(kernel_t)
- mls_file_write_all_levels(kernel_t)
- mls_file_read_all_levels(kernel_t)
-+mls_socket_write_all_levels(kernel_t)
-+mls_fd_use_all_levels(kernel_t)
-
- ifdef(`distro_redhat',`
- # Bugzilla 222337
-diff --git a/policy/modules/services/rpc.fc b/policy/modules/services/rpc.fc
-index 6d3c9b68b..75999a57c 100644
---- a/policy/modules/services/rpc.fc
-+++ b/policy/modules/services/rpc.fc
-@@ -1,7 +1,9 @@
- /etc/exports -- gen_context(system_u:object_r:exports_t,s0)
-
- /etc/rc\.d/init\.d/nfs -- gen_context(system_u:object_r:nfsd_initrc_exec_t,s0)
-+/etc/rc\.d/init\.d/nfsserver -- gen_context(system_u:object_r:nfsd_initrc_exec_t,s0)
- /etc/rc\.d/init\.d/nfslock -- gen_context(system_u:object_r:rpcd_initrc_exec_t,s0)
-+/etc/rc\.d/init\.d/nfscommon -- gen_context(system_u:object_r:rpcd_initrc_exec_t,s0)
- /etc/rc\.d/init\.d/rpcidmapd -- gen_context(system_u:object_r:rpcd_initrc_exec_t,s0)
-
- /usr/bin/rpc\..* -- gen_context(system_u:object_r:rpcd_exec_t,s0)
-diff --git a/policy/modules/services/rpc.te b/policy/modules/services/rpc.te
-index c06ff803f..7c0b37ddc 100644
---- a/policy/modules/services/rpc.te
-+++ b/policy/modules/services/rpc.te
-@@ -250,6 +250,8 @@ storage_raw_read_removable_device(nfsd_t)
-
- miscfiles_read_public_files(nfsd_t)
-
-+mls_file_read_to_clearance(nfsd_t)
-+
- tunable_policy(`allow_nfsd_anon_write',`
- miscfiles_manage_public_files(nfsd_t)
- ')
-diff --git a/policy/modules/services/rpcbind.te b/policy/modules/services/rpcbind.te
-index 4f110773a..3cc85a8d5 100644
---- a/policy/modules/services/rpcbind.te
-+++ b/policy/modules/services/rpcbind.te
-@@ -73,6 +73,12 @@ logging_send_syslog_msg(rpcbind_t)
-
- miscfiles_read_localization(rpcbind_t)
-
-+# nfsd_t would not be allowed to send unix_stream_socket to rpcbind_t,
-+# because the are running in different level. So add rules to allow this.
-+mls_socket_read_all_levels(rpcbind_t)
-+mls_socket_write_all_levels(rpcbind_t)
-+mls_file_read_to_clearance(rpcbind_t)
-+
- ifdef(`distro_debian',`
- term_dontaudit_use_unallocated_ttys(rpcbind_t)
- ')
---
-2.17.1
-
diff --git a/recipes-security/refpolicy/refpolicy/0060-policy-modules-services-rpc-make-rpcd_t-MLS-trusted-.patch b/recipes-security/refpolicy/refpolicy/0060-policy-modules-services-rpc-make-rpcd_t-MLS-trusted-.patch
deleted file mode 100644
index 8f68d66..0000000
--- a/recipes-security/refpolicy/refpolicy/0060-policy-modules-services-rpc-make-rpcd_t-MLS-trusted-.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 1c71d74635c2b39a15c449e75eacae23b3d4f1b8 Mon Sep 17 00:00:00 2001
-From: Yi Zhao
-Date: Thu, 30 May 2019 08:30:06 +0800
-Subject: [PATCH] policy/modules/services/rpc: make rpcd_t MLS trusted for
- reading from files up to its clearance
-
-Fixes:
-type=AVC msg=audit(1559176077.169:242): avc: denied { search } for
-pid=374 comm="rpc.statd" name="journal" dev="tmpfs" ino=9854
-scontext=system_u:system_r:rpcd_t:s0-s15:c0.c1023
-tcontext=system_u:object_r:syslogd_var_run_t:s15:c0.c1023 tclass=dir
-permissive=0
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Yi Zhao
----
- policy/modules/services/rpc.te | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/policy/modules/services/rpc.te b/policy/modules/services/rpc.te
-index 7c0b37ddc..ef6cb9b63 100644
---- a/policy/modules/services/rpc.te
-+++ b/policy/modules/services/rpc.te
-@@ -185,6 +185,8 @@ seutil_dontaudit_search_config(rpcd_t)
-
- userdom_signal_all_users(rpcd_t)
-
-+mls_file_read_to_clearance(rpcd_t)
-+
- ifdef(`distro_debian',`
- term_dontaudit_use_unallocated_ttys(rpcd_t)
- ')
---
-2.17.1
-
diff --git a/recipes-security/refpolicy/refpolicy/0060-policy-modules-system-sysnetwork-support-priviledge-.patch b/recipes-security/refpolicy/refpolicy/0060-policy-modules-system-sysnetwork-support-priviledge-.patch
new file mode 100644
index 0000000..64cc90e
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0060-policy-modules-system-sysnetwork-support-priviledge-.patch
@@ -0,0 +1,120 @@
+From ab462f0022c35fde984dbe792ce386f5d507aeeb Mon Sep 17 00:00:00 2001
+From: Yi Zhao
+Date: Thu, 24 Sep 2020 14:05:52 +0800
+Subject: [PATCH] policy/modules/system/sysnetwork: support priviledge
+ separation for dhcpcd
+
+Fixes:
+
+avc: denied { sys_chroot } for pid=332 comm="dhcpcd" capability=18
+scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
+tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023 tclass=capability
+permissive=0
+
+avc: denied { setgid } for pid=332 comm="dhcpcd" capability=6
+scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
+tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023 tclass=capability
+permissive=0
+
+avc: denied { setuid } for pid=332 comm="dhcpcd" capability=7
+scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
+tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023 tclass=capability
+permissive=0
+
+avc: denied { setrlimit } for pid=332 comm="dhcpcd"
+scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
+tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023 tclass=process
+permissive=0
+
+avc: denied { create } for pid=330 comm="dhcpcd"
+scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
+tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
+tclass=netlink_kobject_uevent_socket permissive=0
+
+avc: denied { setopt } for pid=330 comm="dhcpcd"
+scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
+tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
+tclass=netlink_kobject_uevent_socket permissive=0
+
+avc: denied { bind } for pid=330 comm="dhcpcd"
+scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
+tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
+tclass=netlink_kobject_uevent_socket permissive=0
+
+avc: denied { getattr } for pid=330 comm="dhcpcd"
+scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
+tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
+tclass=netlink_kobject_uevent_socket permissive=0
+
+avc: denied { read } for pid=330 comm="dhcpcd" name="n1" dev="tmpfs"
+ino=15616 scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
+tcontext=system_u:object_r:udev_runtime_t:s0 tclass=file permissive=0
+
+avc: denied { open } for pid=330 comm="dhcpcd"
+path="/run/udev/data/n1" dev="tmpfs" ino=15616
+scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
+tcontext=system_u:object_r:udev_runtime_t:s0 tclass=file permissive=0
+
+avc: denied { getattr } for pid=330 comm="dhcpcd"
+path="/run/udev/data/n1" dev="tmpfs" ino=15616
+scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
+tcontext=system_u:object_r:udev_runtime_t:s0 tclass=file permissive=0
+
+avc: denied { connectto } for pid=1600 comm="dhcpcd"
+path="/run/dhcpcd/unpriv.sock"
+scontext=root:sysadm_r:dhcpc_t:s0-s15:c0.c1023
+tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
+tclass=unix_stream_socket permissive=0
+
+avc: denied { kill } for pid=314 comm="dhcpcd" capability=5
+scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
+tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023 tclass=capability
+permissive=0
+
+avc: denied { getattr } for pid=300 comm="dhcpcd"
+path="net:[4026532008]" dev="nsfs" ino=4026532008
+scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
+tcontext=system_u:object_r:nsfs_t:s0 tclass=file permissive=0
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Yi Zhao
+---
+ policy/modules/system/sysnetwork.te | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/policy/modules/system/sysnetwork.te b/policy/modules/system/sysnetwork.te
+index cb1434180..a9297f976 100644
+--- a/policy/modules/system/sysnetwork.te
++++ b/policy/modules/system/sysnetwork.te
+@@ -72,6 +72,11 @@ allow dhcpc_t self:netlink_route_socket create_netlink_socket_perms;
+ allow dhcpc_t self:rawip_socket create_socket_perms;
+ allow dhcpc_t self:unix_dgram_socket { create_socket_perms sendto };
+
++allow dhcpc_t self:capability { setgid setuid sys_chroot kill };
++allow dhcpc_t self:netlink_kobject_uevent_socket create_socket_perms;
++allow dhcpc_t self:process setrlimit;
++allow dhcpc_t self:unix_stream_socket connectto;
++
+ allow dhcpc_t dhcp_etc_t:dir list_dir_perms;
+ read_lnk_files_pattern(dhcpc_t, dhcp_etc_t, dhcp_etc_t)
+ exec_files_pattern(dhcpc_t, dhcp_etc_t, dhcp_etc_t)
+@@ -145,6 +150,7 @@ files_manage_var_files(dhcpc_t)
+ fs_getattr_all_fs(dhcpc_t)
+ fs_search_auto_mountpoints(dhcpc_t)
+ fs_search_cgroup_dirs(dhcpc_t)
++fs_read_nsfs_files(dhcpc_t)
+
+ term_dontaudit_use_all_ttys(dhcpc_t)
+ term_dontaudit_use_all_ptys(dhcpc_t)
+@@ -180,6 +186,7 @@ ifdef(`init_systemd',`
+ init_stream_connect(dhcpc_t)
+ init_get_all_units_status(dhcpc_t)
+ init_search_units(dhcpc_t)
++ udev_read_runtime_files(dhcpc_t)
+ ')
+
+ optional_policy(`
+--
+2.17.1
+
diff --git a/recipes-security/refpolicy/refpolicy/0061-policy-modules-roles-sysadm-MLS-sysadm-rw-to-clearan.patch b/recipes-security/refpolicy/refpolicy/0061-policy-modules-roles-sysadm-MLS-sysadm-rw-to-clearan.patch
deleted file mode 100644
index af7f3ad..0000000
--- a/recipes-security/refpolicy/refpolicy/0061-policy-modules-roles-sysadm-MLS-sysadm-rw-to-clearan.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 0404c4ad3f92408edcdbf46ac0665bf09d4b2516 Mon Sep 17 00:00:00 2001
-From: Xin Ouyang
-Date: Mon, 28 Jan 2019 14:05:18 +0800
-Subject: [PATCH] policy/modules/roles/sysadm: MLS - sysadm rw to clearance
-
-The two new rules make sysadm_t domain MLS trusted for:
- - reading from files at all levels.
- - writing to processes up to its clearance(s0-s15).
-
-With default MLS policy, root user would login in as sysadm_t:s0 by
-default. Most processes will run in sysadm_t:s0 because no
-domtrans/rangetrans rules, as a result, even root could not access
-high level files/processes.
-
-So with the two new rules, root user could work easier in MLS policy.
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Xin Ouyang
-Signed-off-by: Yi Zhao
----
- policy/modules/roles/sysadm.te | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/policy/modules/roles/sysadm.te b/policy/modules/roles/sysadm.te
-index 07b9faf30..ac5239d83 100644
---- a/policy/modules/roles/sysadm.te
-+++ b/policy/modules/roles/sysadm.te
-@@ -42,6 +42,9 @@ dev_read_kmsg(sysadm_t)
-
- mls_process_read_all_levels(sysadm_t)
-
-+mls_file_read_all_levels(sysadm_t)
-+mls_process_write_to_clearance(sysadm_t)
-+
- selinux_read_policy(sysadm_t)
-
- ubac_process_exempt(sysadm_t)
---
-2.17.1
-
diff --git a/recipes-security/refpolicy/refpolicy/0061-policy-modules-services-acpi-allow-acpid-to-watch-th.patch b/recipes-security/refpolicy/refpolicy/0061-policy-modules-services-acpi-allow-acpid-to-watch-th.patch
new file mode 100644
index 0000000..8de3d5f
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0061-policy-modules-services-acpi-allow-acpid-to-watch-th.patch
@@ -0,0 +1,35 @@
+From 7418cd97f2c92579bd4d18cbd9063f811ff9a81e Mon Sep 17 00:00:00 2001
+From: Yi Zhao
+Date: Tue, 9 Feb 2021 16:42:36 +0800
+Subject: [PATCH] policy/modules/services/acpi: allow acpid to watch the
+ directories in /dev
+
+Fixes:
+acpid: inotify_add_watch() failed: Permission denied (13)
+
+avc: denied { watch } for pid=269 comm="acpid" path="/dev/input"
+dev="devtmpfs" ino=35 scontext=system_u:system_r:acpid_t:s0-s15:c0.c1023
+tcontext=system_u:object_r:device_t:s0 tclass=dir permissive=0
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Yi Zhao
+---
+ policy/modules/services/acpi.te | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/policy/modules/services/acpi.te b/policy/modules/services/acpi.te
+index 69f1dab4a..5c22adecd 100644
+--- a/policy/modules/services/acpi.te
++++ b/policy/modules/services/acpi.te
+@@ -105,6 +105,7 @@ dev_rw_acpi_bios(acpid_t)
+ dev_rw_sysfs(acpid_t)
+ dev_dontaudit_getattr_all_chr_files(acpid_t)
+ dev_dontaudit_getattr_all_blk_files(acpid_t)
++dev_watch_dev_dirs(acpid_t)
+
+ files_exec_etc_files(acpid_t)
+ files_read_etc_runtime_files(acpid_t)
+--
+2.17.1
+
diff --git a/recipes-security/refpolicy/refpolicy/0062-policy-modules-system-mount-make-mount_t-domain-MLS-.patch b/recipes-security/refpolicy/refpolicy/0062-policy-modules-system-mount-make-mount_t-domain-MLS-.patch
deleted file mode 100644
index 1e7d963..0000000
--- a/recipes-security/refpolicy/refpolicy/0062-policy-modules-system-mount-make-mount_t-domain-MLS-.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 7789f70ee3506f11b6bc1954469915214bcb9c58 Mon Sep 17 00:00:00 2001
-From: Wenzong Fan
-Date: Sat, 15 Feb 2014 04:22:47 -0500
-Subject: [PATCH] policy/modules/system/mount: make mount_t domain MLS trusted
- for writing to processes up to its clearance
-
-Fixes:
-avc: denied { setsched } for pid=148 comm="mount"
-scontext=system_u:system_r:mount_t:s0-s15:c0.c1023
-tcontext=system_u:system_r:kernel_t:s15:c0.c1023 tclass=process
-permissive=1
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signen-off-by: Wenzong Fan
-Signed-off-by: Yi Zhao
----
- policy/modules/system/mount.te | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/policy/modules/system/mount.te b/policy/modules/system/mount.te
-index 282eb3ada..5bb4fe631 100644
---- a/policy/modules/system/mount.te
-+++ b/policy/modules/system/mount.te
-@@ -116,6 +116,8 @@ fs_dontaudit_write_tmpfs_dirs(mount_t)
- mls_file_read_all_levels(mount_t)
- mls_file_write_all_levels(mount_t)
-
-+mls_process_write_to_clearance(mount_t)
-+
- selinux_get_enforce_mode(mount_t)
-
- storage_raw_read_fixed_disk(mount_t)
---
-2.17.1
-
diff --git a/recipes-security/refpolicy/refpolicy/0062-policy-modules-system-setrans-allow-setrans-to-acces.patch b/recipes-security/refpolicy/refpolicy/0062-policy-modules-system-setrans-allow-setrans-to-acces.patch
new file mode 100644
index 0000000..b692012
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0062-policy-modules-system-setrans-allow-setrans-to-acces.patch
@@ -0,0 +1,42 @@
+From 84c69d220ffdd039b88a34f9afc127274a985541 Mon Sep 17 00:00:00 2001
+From: Roy Li
+Date: Sat, 22 Feb 2014 13:35:38 +0800
+Subject: [PATCH] policy/modules/system/setrans: allow setrans to access
+ /sys/fs/selinux
+
+1. mcstransd failed to boot-up since the below permission is denied
+statfs("/sys/fs/selinux", 0x7ffff2b80370) = -1 EACCES (Permission denied)
+
+2. other programs can not connect to /run/setrans/.setrans-unix
+avc: denied { connectto } for pid=2055 comm="ls"
+path="/run/setrans/.setrans-unix"
+scontext=root:sysadm_r:sysadm_t:s0-s15:c0.c1023
+tcontext=system_u:system_r:setrans_t:s15:c0.c1023
+tclass=unix_stream_socket
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Roy Li
+Signed-off-by: Yi Zhao
+---
+ policy/modules/system/setrans.te | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/policy/modules/system/setrans.te b/policy/modules/system/setrans.te
+index 25aadfc5f..78bd6e2eb 100644
+--- a/policy/modules/system/setrans.te
++++ b/policy/modules/system/setrans.te
+@@ -23,9 +23,7 @@ mls_trusted_object(setrans_runtime_t)
+ type setrans_unit_t;
+ init_unit_file(setrans_unit_t)
+
+-ifdef(`distro_debian',`
+- init_daemon_runtime_file(setrans_runtime_t, dir, "setrans")
+-')
++init_daemon_runtime_file(setrans_runtime_t, dir, "setrans")
+
+ ifdef(`enable_mcs',`
+ init_ranged_daemon_domain(setrans_t, setrans_exec_t, s0 - mcs_systemhigh)
+--
+2.17.1
+
diff --git a/recipes-security/refpolicy/refpolicy/0063-policy-modules-system-modutils-allow-kmod_t-to-write.patch b/recipes-security/refpolicy/refpolicy/0063-policy-modules-system-modutils-allow-kmod_t-to-write.patch
new file mode 100644
index 0000000..b644571
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0063-policy-modules-system-modutils-allow-kmod_t-to-write.patch
@@ -0,0 +1,35 @@
+From 7002b4e33b949b474a0ce0b78a7f2e180dbbc9bb Mon Sep 17 00:00:00 2001
+From: Yi Zhao
+Date: Tue, 9 Feb 2021 17:31:55 +0800
+Subject: [PATCH] policy/modules/system/modutils: allow kmod_t to write keys
+
+Fixes:
+kernel: cfg80211: Problem loading in-kernel X.509 certificate (-13)
+
+avc: denied { write } for pid=219 comm="modprobe"
+scontext=system_u:system_r:kmod_t tcontext=system_u:system_r:kmod_t
+tclass=key permissive=0
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Yi Zhao
+---
+ policy/modules/system/modutils.te | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/policy/modules/system/modutils.te b/policy/modules/system/modutils.te
+index ee249ae04..b8769bc02 100644
+--- a/policy/modules/system/modutils.te
++++ b/policy/modules/system/modutils.te
+@@ -43,6 +43,8 @@ allow kmod_t self:rawip_socket create_socket_perms;
+
+ allow kmod_t self:lockdown confidentiality;
+
++allow kmod_t self:key write;
++
+ # Read module config and dependency information
+ list_dirs_pattern(kmod_t, modules_conf_t, modules_conf_t)
+ read_files_pattern(kmod_t, modules_conf_t, modules_conf_t)
+--
+2.17.1
+
diff --git a/recipes-security/refpolicy/refpolicy/0063-policy-modules-system-setrans-allow-setrans-to-acces.patch b/recipes-security/refpolicy/refpolicy/0063-policy-modules-system-setrans-allow-setrans-to-acces.patch
deleted file mode 100644
index 55d92f0..0000000
--- a/recipes-security/refpolicy/refpolicy/0063-policy-modules-system-setrans-allow-setrans-to-acces.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From fc77db62ce54a33ee04bfc3e4c68b9cbed7251c6 Mon Sep 17 00:00:00 2001
-From: Roy Li
-Date: Sat, 22 Feb 2014 13:35:38 +0800
-Subject: [PATCH] policy/modules/system/setrans: allow setrans to access
- /sys/fs/selinux
-
-1. mcstransd failed to boot-up since the below permission is denied
-statfs("/sys/fs/selinux", 0x7ffff2b80370) = -1 EACCES (Permission denied)
-
-2. other programs can not connect to /run/setrans/.setrans-unix
-avc: denied { connectto } for pid=2055 comm="ls"
-path="/run/setrans/.setrans-unix"
-scontext=root:sysadm_r:sysadm_t:s0-s15:c0.c1023
-tcontext=system_u:system_r:setrans_t:s15:c0.c1023
-tclass=unix_stream_socket
-
-3. allow setrans_t use fd at any level
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Roy Li
-Signed-off-by: Yi Zhao
----
- policy/modules/system/setrans.te | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/policy/modules/system/setrans.te b/policy/modules/system/setrans.te
-index 5f020ef78..7f618f212 100644
---- a/policy/modules/system/setrans.te
-+++ b/policy/modules/system/setrans.te
-@@ -23,9 +23,7 @@ mls_trusted_object(setrans_runtime_t)
- type setrans_unit_t;
- init_unit_file(setrans_unit_t)
-
--ifdef(`distro_debian',`
-- init_daemon_runtime_file(setrans_runtime_t, dir, "setrans")
--')
-+init_daemon_runtime_file(setrans_runtime_t, dir, "setrans")
-
- ifdef(`enable_mcs',`
- init_ranged_daemon_domain(setrans_t, setrans_exec_t, s0 - mcs_systemhigh)
-@@ -73,6 +71,8 @@ mls_net_receive_all_levels(setrans_t)
- mls_socket_write_all_levels(setrans_t)
- mls_process_read_all_levels(setrans_t)
- mls_socket_read_all_levels(setrans_t)
-+mls_fd_use_all_levels(setrans_t)
-+mls_trusted_object(setrans_t)
-
- selinux_compute_access_vector(setrans_t)
-
---
-2.17.1
-
diff --git a/recipes-security/refpolicy/refpolicy/0064-policy-modules-admin-dmesg-make-dmesg_t-MLS-trusted-.patch b/recipes-security/refpolicy/refpolicy/0064-policy-modules-admin-dmesg-make-dmesg_t-MLS-trusted-.patch
deleted file mode 100644
index 4fa9968..0000000
--- a/recipes-security/refpolicy/refpolicy/0064-policy-modules-admin-dmesg-make-dmesg_t-MLS-trusted-.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From a51cec2a8d8f47b7a06c59b8af73d96edcc2a993 Mon Sep 17 00:00:00 2001
-From: Yi Zhao
-Date: Tue, 30 Jun 2020 10:18:20 +0800
-Subject: [PATCH] policy/modules/admin/dmesg: make dmesg_t MLS trusted reading
- from files up to its clearance
-
-Fixes:
-avc: denied { read } for pid=255 comm="dmesg" name="kmsg"
-dev="devtmpfs" ino=10032
-scontext=system_u:system_r:dmesg_t:s0-s15:c0.c1023
-tcontext=system_u:object_r:kmsg_device_t:s15:c0.c1023 tclass=chr_file
-permissive=0
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Yi Zhao
----
- policy/modules/admin/dmesg.te | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/policy/modules/admin/dmesg.te b/policy/modules/admin/dmesg.te
-index 5bbe71b26..228baecd8 100644
---- a/policy/modules/admin/dmesg.te
-+++ b/policy/modules/admin/dmesg.te
-@@ -51,6 +51,8 @@ miscfiles_read_localization(dmesg_t)
- userdom_dontaudit_use_unpriv_user_fds(dmesg_t)
- userdom_use_user_terminals(dmesg_t)
-
-+mls_file_read_to_clearance(dmesg_t)
-+
- optional_policy(`
- seutil_sigchld_newrole(dmesg_t)
- ')
---
-2.17.1
-
diff --git a/recipes-security/refpolicy/refpolicy/0064-policy-modules-roles-sysadm-allow-sysadm_t-to-watch-.patch b/recipes-security/refpolicy/refpolicy/0064-policy-modules-roles-sysadm-allow-sysadm_t-to-watch-.patch
new file mode 100644
index 0000000..dbd1390
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0064-policy-modules-roles-sysadm-allow-sysadm_t-to-watch-.patch
@@ -0,0 +1,33 @@
+From 291d3329c280b6b8b70fcc3092ac4d3399936825 Mon Sep 17 00:00:00 2001
+From: Yi Zhao
+Date: Mon, 29 Jun 2020 10:32:25 +0800
+Subject: [PATCH] policy/modules/roles/sysadm: allow sysadm_t to watch runtime
+ dirs
+
+Fixes:
+Failed to add a watch for /run/systemd/ask-password: Permission denied
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Yi Zhao
+---
+ policy/modules/roles/sysadm.te | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/policy/modules/roles/sysadm.te b/policy/modules/roles/sysadm.te
+index 129e94229..a4abaefe4 100644
+--- a/policy/modules/roles/sysadm.te
++++ b/policy/modules/roles/sysadm.te
+@@ -83,6 +83,9 @@ ifdef(`init_systemd',`
+ init_dbus_chat(sysadm_t)
+
+ systemd_sysadm_user(sysadm_t)
++
++ systemd_filetrans_passwd_runtime_dirs(sysadm_t)
++ allow sysadm_t systemd_passwd_runtime_t:dir watch;
+ ')
+
+ tunable_policy(`allow_ptrace',`
+--
+2.17.1
+
diff --git a/recipes-security/refpolicy/refpolicy/0065-policy-modules-kernel-kernel-make-kernel_t-MLS-trust.patch b/recipes-security/refpolicy/refpolicy/0065-policy-modules-kernel-kernel-make-kernel_t-MLS-trust.patch
deleted file mode 100644
index 3a2c235..0000000
--- a/recipes-security/refpolicy/refpolicy/0065-policy-modules-kernel-kernel-make-kernel_t-MLS-trust.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-From fdc58fd666915aba89cb07fe6e7eb43a7fbec2ec Mon Sep 17 00:00:00 2001
-From: Wenzong Fan
-Date: Fri, 13 Oct 2017 07:20:40 +0000
-Subject: [PATCH] policy/modules/kernel/kernel: make kernel_t MLS trusted for
- lowering the level of files
-
-The boot process hangs with the error while using MLS policy:
-
- [!!!!!!] Failed to mount API filesystems, freezing.
- [ 4.085349] systemd[1]: Freezing execution.
-
-Make kernel_t mls trusted for lowering the level of files to fix below
-avc denials and remove the hang issue.
-
- op=security_validate_transition seresult=denied \
- oldcontext=system_u:object_r:device_t:s15:c0.c1023 \
- newcontext=system_u:object_r:device_t:s0 \
- taskcontext=system_u:system_r:kernel_t:s15:c0.c1023 tclass=dir
- systemd[1]: Unable to fix SELinux security context of /dev: Operation not permitted
-
- avc: denied { create } for pid=1 comm="systemd" name="shm" \
- scontext=system_u:system_r:kernel_t:s15:c0.c1023 \
- tcontext=system_u:object_r:tmpfs_t:s0 tclass=dir permissive=0
- systemd[1]: Failed to mount tmpfs at /dev/shm: No such file or directory
-
- avc: denied { create } for pid=1 comm="systemd" name="pts" \
- scontext=system_u:system_r:kernel_t:s15:c0.c1023 \
- tcontext=system_u:object_r:devpts_t:s0-s15:c0.c1023 tclass=dir permissive=0
-
- op=security_validate_transition seresult=denied \
- oldcontext=system_u:object_r:unlabeled_t:s0 \
- newcontext=system_u:object_r:var_run_t:s0-s15:c0.c1023 \
- taskcontext=system_u:system_r:kernel_t:s15:c0.c1023 tclass=dir
-
- op=security_validate_transition seresult=denied \
- oldcontext=system_u:object_r:tmpfs_t:s15:c0.c1023 \
- newcontext=system_u:object_r:var_run_t:s0-s15:c0.c1023 \
- taskcontext=system_u:system_r:kernel_t:s15:c0.c1023 tclass=dir
- systemd[1]: Unable to fix SELinux security context of /run: Operation not permitted
-
- op=security_validate_transition seresult=denied \
- oldcontext=system_u:object_r:tmpfs_t:s15:c0.c1023 \
- newcontext=system_u:object_r:cgroup_t:s0 \
- taskcontext=system_u:system_r:kernel_t:s15:c0.c1023 tclass=dir
- systemd[1]: Unable to fix SELinux security context of /sys/fs/cgroup: Operation not permitted
-
- avc: denied { create } for pid=1 comm="systemd" name="pstore" \
- scontext=system_u:system_r:kernel_t:s15:c0.c1023 \
- tcontext=system_u:object_r:pstore_t:s0 tclass=dir permissive=0
-
-Reference: https://bugzilla.redhat.com/show_bug.cgi?id=667370
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Wenzong Fan
-Signed-off-by: Yi Zhao
----
- policy/modules/kernel/kernel.te | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/policy/modules/kernel/kernel.te b/policy/modules/kernel/kernel.te
-index 44c031a39..4dffaef76 100644
---- a/policy/modules/kernel/kernel.te
-+++ b/policy/modules/kernel/kernel.te
-@@ -359,6 +359,9 @@ mls_file_read_all_levels(kernel_t)
- mls_socket_write_all_levels(kernel_t)
- mls_fd_use_all_levels(kernel_t)
-
-+# https://bugzilla.redhat.com/show_bug.cgi?id=667370
-+mls_file_downgrade(kernel_t)
-+
- ifdef(`distro_redhat',`
- # Bugzilla 222337
- fs_rw_tmpfs_chr_files(kernel_t)
---
-2.17.1
-
diff --git a/recipes-security/refpolicy/refpolicy/0065-policy-modules-system-selinux-allow-setfiles_t-to-re.patch b/recipes-security/refpolicy/refpolicy/0065-policy-modules-system-selinux-allow-setfiles_t-to-re.patch
new file mode 100644
index 0000000..a824004
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0065-policy-modules-system-selinux-allow-setfiles_t-to-re.patch
@@ -0,0 +1,44 @@
+From bc821718f7e9575a67c4667decad937cbe5f8514 Mon Sep 17 00:00:00 2001
+From: Yi Zhao
+Date: Tue, 2 Mar 2021 14:25:03 +0800
+Subject: [PATCH] policy/modules/system/selinux: allow setfiles_t to read
+ kernel sysctl
+
+Fixes:
+avc: denied { read } for pid=171 comm="restorecon" name="cap_last_cap"
+dev="proc" ino=1241
+scontext=system_u:system_r:setfiles_t:s0-s15:c0.c1023
+tcontext=system_u:object_r:sysctl_kernel_t:s0 tclass=file permissive=0
+
+avc: denied { open } for pid=171 comm="restorecon"
+path="/proc/sys/kernel/cap_last_cap" dev="proc" ino=1241
+scontext=system_u:system_r:setfiles_t:s0-s15:c0.c1023
+tcontext=system_u:object_r:sysctl_kernel_t:s0 tclass=file permissive=0
+
+avc: denied { getattr } for pid=171 comm="restorecon" name="/"
+dev="proc" ino=1 scontext=system_u:system_r:setfiles_t:s0-s15:c0.c1023
+tcontext=system_u:object_r:proc_t:s0 tclass=filesystem permissive=0
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Yi Zhao
+---
+ policy/modules/system/selinuxutil.te | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/policy/modules/system/selinuxutil.te b/policy/modules/system/selinuxutil.te
+index a505b3987..a26f8db03 100644
+--- a/policy/modules/system/selinuxutil.te
++++ b/policy/modules/system/selinuxutil.te
+@@ -597,6 +597,8 @@ kernel_rw_unix_dgram_sockets(setfiles_t)
+ kernel_dontaudit_list_all_proc(setfiles_t)
+ kernel_dontaudit_list_all_sysctls(setfiles_t)
+ kernel_getattr_debugfs(setfiles_t)
++kernel_read_kernel_sysctls(setfiles_t)
++kernel_getattr_proc(setfiles_t)
+
+ dev_read_urand(setfiles_t)
+ dev_relabel_all_dev_nodes(setfiles_t)
+--
+2.17.1
+
diff --git a/recipes-security/refpolicy/refpolicy/0066-policy-modules-system-init-make-init_t-MLS-trusted-f.patch b/recipes-security/refpolicy/refpolicy/0066-policy-modules-system-init-make-init_t-MLS-trusted-f.patch
deleted file mode 100644
index 09e9af2..0000000
--- a/recipes-security/refpolicy/refpolicy/0066-policy-modules-system-init-make-init_t-MLS-trusted-f.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 3aa784896315d269be4f43a281d59ad7671b2d07 Mon Sep 17 00:00:00 2001
-From: Wenzong Fan
-Date: Fri, 15 Jan 2016 03:47:05 -0500
-Subject: [PATCH] policy/modules/system/init: make init_t MLS trusted for
- lowering/raising the leve of files
-
-Fix security_validate_transition issues:
-
- op=security_validate_transition seresult=denied \
- oldcontext=system_u:object_r:device_t:s15:c0.c1023 \
- newcontext=system_u:object_r:device_t:s0 \
- taskcontext=system_u:system_r:init_t:s0-s15:c0.c1023 \
- tclass=dir
-
- op=security_validate_transition seresult=denied \
- oldcontext=system_u:object_r:var_run_t:s0 \
- newcontext=system_u:object_r:var_log_t:s0-s15:c0.c1023 \
- taskcontext=system_u:system_r:init_t:s0-s15:c0.c1023 \
- tclass=dir
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Wenzong Fan
-Signed-off-by: Yi Zhao
----
- policy/modules/system/init.te | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te
-index fe3fcf011..8e85dde72 100644
---- a/policy/modules/system/init.te
-+++ b/policy/modules/system/init.te
-@@ -208,6 +208,10 @@ mls_process_write_all_levels(init_t)
- mls_fd_use_all_levels(init_t)
- mls_process_set_level(init_t)
-
-+# MLS trusted for lowering/raising the level of files
-+mls_file_downgrade(init_t)
-+mls_file_upgrade(init_t)
-+
- # the following one is needed for libselinux:is_selinux_enabled()
- # otherwise the call fails and sysvinit tries to load the policy
- # again when using the initramfs
---
-2.17.1
-
diff --git a/recipes-security/refpolicy/refpolicy/0066-policy-modules-system-mount-make-mount_t-domain-MLS-.patch b/recipes-security/refpolicy/refpolicy/0066-policy-modules-system-mount-make-mount_t-domain-MLS-.patch
new file mode 100644
index 0000000..1d6a3c4
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0066-policy-modules-system-mount-make-mount_t-domain-MLS-.patch
@@ -0,0 +1,36 @@
+From 0d69354886e0b635dd069876b9d53890a5a9cab1 Mon Sep 17 00:00:00 2001
+From: Wenzong Fan
+Date: Sat, 15 Feb 2014 04:22:47 -0500
+Subject: [PATCH] policy/modules/system/mount: make mount_t domain MLS trusted
+ for writing to processes up to its clearance
+
+Fixes:
+avc: denied { setsched } for pid=148 comm="mount"
+scontext=system_u:system_r:mount_t:s0-s15:c0.c1023
+tcontext=system_u:system_r:kernel_t:s15:c0.c1023 tclass=process
+permissive=1
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signen-off-by: Wenzong Fan
+Signed-off-by: Yi Zhao
+---
+ policy/modules/system/mount.te | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/policy/modules/system/mount.te b/policy/modules/system/mount.te
+index b628c3b2f..f55457bb0 100644
+--- a/policy/modules/system/mount.te
++++ b/policy/modules/system/mount.te
+@@ -116,6 +116,8 @@ fs_dontaudit_write_all_image_files(mount_t)
+ mls_file_read_all_levels(mount_t)
+ mls_file_write_all_levels(mount_t)
+
++mls_process_write_to_clearance(mount_t)
++
+ selinux_get_enforce_mode(mount_t)
+
+ storage_raw_read_fixed_disk(mount_t)
+--
+2.17.1
+
diff --git a/recipes-security/refpolicy/refpolicy/0067-policy-modules-roles-sysadm-MLS-sysadm-rw-to-clearan.patch b/recipes-security/refpolicy/refpolicy/0067-policy-modules-roles-sysadm-MLS-sysadm-rw-to-clearan.patch
new file mode 100644
index 0000000..f441742
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0067-policy-modules-roles-sysadm-MLS-sysadm-rw-to-clearan.patch
@@ -0,0 +1,41 @@
+From b83147aa97fe6f51c997256539dff827e3a44edc Mon Sep 17 00:00:00 2001
+From: Xin Ouyang
+Date: Mon, 28 Jan 2019 14:05:18 +0800
+Subject: [PATCH] policy/modules/roles/sysadm: MLS - sysadm rw to clearance
+
+The two new rules make sysadm_t domain MLS trusted for:
+ - reading from files at all levels.
+ - writing to processes up to its clearance(s0-s15).
+
+With default MLS policy, root user would login in as sysadm_t:s0 by
+default. Most processes will run in sysadm_t:s0 because no
+domtrans/rangetrans rules, as a result, even root could not access
+high level files/processes.
+
+So with the two new rules, root user could work easier in MLS policy.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Xin Ouyang
+Signed-off-by: Yi Zhao
+---
+ policy/modules/roles/sysadm.te | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/policy/modules/roles/sysadm.te b/policy/modules/roles/sysadm.te
+index a4abaefe4..aaae73fc3 100644
+--- a/policy/modules/roles/sysadm.te
++++ b/policy/modules/roles/sysadm.te
+@@ -42,6 +42,9 @@ dev_read_kmsg(sysadm_t)
+
+ mls_process_read_all_levels(sysadm_t)
+
++mls_file_read_all_levels(sysadm_t)
++mls_process_write_to_clearance(sysadm_t)
++
+ selinux_read_policy(sysadm_t)
+
+ ubac_process_exempt(sysadm_t)
+--
+2.17.1
+
diff --git a/recipes-security/refpolicy/refpolicy/0067-policy-modules-system-systemd-make-systemd-tmpfiles_.patch b/recipes-security/refpolicy/refpolicy/0067-policy-modules-system-systemd-make-systemd-tmpfiles_.patch
deleted file mode 100644
index b4245ab..0000000
--- a/recipes-security/refpolicy/refpolicy/0067-policy-modules-system-systemd-make-systemd-tmpfiles_.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From fb69dde2c8783e0602dcce3509b69ded9e6331a2 Mon Sep 17 00:00:00 2001
-From: Wenzong Fan
-Date: Thu, 4 Feb 2016 06:03:19 -0500
-Subject: [PATCH] policy/modules/system/systemd: make systemd-tmpfiles_t domain
- MLS trusted for raising/lowering the level of files
-
-Fixes:
- avc: denied { search } for pid=92 comm="systemd-tmpfile" name="1" \
- dev="proc" ino=7987 \
- scontext=system_u:system_r:systemd_tmpfiles_t:s0-s15:c0.c1023 \
- tcontext=system_u:system_r:init_t:s0-s15:c0.c1023 \
- tclass=dir
-
- avc: denied { search } for pid=92 comm="systemd-tmpfile" \
- name="journal" dev="tmpfs" ino=8226 \
- scontext=system_u:system_r:systemd_tmpfiles_t:s0-s15:c0.c1023 \
- tcontext=system_u:object_r:syslogd_var_run_t:s15:c0.c1023 \
- tclass=dir
-
- avc: denied { write } for pid=92 comm="systemd-tmpfile" \
- name="kmsg" dev="devtmpfs" ino=7242 \
- scontext=system_u:system_r:systemd_tmpfiles_t:s0-s15:c0.c1023 \
- tcontext=system_u:object_r:kmsg_device_t:s15:c0.c1023 \
- tclass=chr_file
-
- avc: denied { read } for pid=92 comm="systemd-tmpfile" \
- name="kmod.conf" dev="tmpfs" ino=8660 \
- scontext=system_u:system_r:systemd_tmpfiles_t:s0-s15:c0.c1023 \
- tcontext=system_u:object_r:var_run_t:s0 \
- tclass=file
-
- avc: denied { search } for pid=92 comm="systemd-tmpfile" \
- name="kernel" dev="proc" ino=8731 \
- scontext=system_u:system_r:systemd_tmpfiles_t:s0-s15:c0.c1023 \
- tcontext=system_u:object_r:sysctl_kernel_t:s0 tclass=dir
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Wenzong Fan
-Signed-off-by: Yi Zhao
----
- policy/modules/system/systemd.te | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
-index fb8d4960f..57f4dc40d 100644
---- a/policy/modules/system/systemd.te
-+++ b/policy/modules/system/systemd.te
-@@ -1249,6 +1249,11 @@ sysnet_relabel_config(systemd_tmpfiles_t)
-
- systemd_log_parse_environment(systemd_tmpfiles_t)
-
-+mls_file_write_all_levels(systemd_tmpfiles_t)
-+mls_file_read_all_levels(systemd_tmpfiles_t)
-+mls_file_downgrade(systemd_tmpfiles_t)
-+mls_file_upgrade(systemd_tmpfiles_t)
-+
- userdom_manage_user_runtime_root_dirs(systemd_tmpfiles_t)
- userdom_relabel_user_runtime_root_dirs(systemd_tmpfiles_t)
-
---
-2.17.1
-
diff --git a/recipes-security/refpolicy/refpolicy/0068-policy-modules-services-rpc-make-nfsd_t-domain-MLS-t.patch b/recipes-security/refpolicy/refpolicy/0068-policy-modules-services-rpc-make-nfsd_t-domain-MLS-t.patch
new file mode 100644
index 0000000..4403997
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0068-policy-modules-services-rpc-make-nfsd_t-domain-MLS-t.patch
@@ -0,0 +1,63 @@
+From 7b8290ba52052f90b6221c1b3ccb8f7536f4c41e Mon Sep 17 00:00:00 2001
+From: Xin Ouyang
+Date: Fri, 23 Aug 2013 12:01:53 +0800
+Subject: [PATCH] policy/modules/services/rpc: make nfsd_t domain MLS trusted
+ for reading from files up to its clearance
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Xin Ouyang
+Signed-off-by: Joe MacDonald
+Signed-off-by: Yi Zhao
+---
+ policy/modules/kernel/kernel.te | 2 ++
+ policy/modules/services/rpc.te | 2 ++
+ policy/modules/services/rpcbind.te | 6 ++++++
+ 3 files changed, 10 insertions(+)
+
+diff --git a/policy/modules/kernel/kernel.te b/policy/modules/kernel/kernel.te
+index 5ce6e041b..c1557ddb2 100644
+--- a/policy/modules/kernel/kernel.te
++++ b/policy/modules/kernel/kernel.te
+@@ -356,6 +356,8 @@ mls_process_read_all_levels(kernel_t)
+ mls_process_write_all_levels(kernel_t)
+ mls_file_write_all_levels(kernel_t)
+ mls_file_read_all_levels(kernel_t)
++mls_socket_write_all_levels(kernel_t)
++mls_fd_use_all_levels(kernel_t)
+
+ ifdef(`distro_redhat',`
+ # Bugzilla 222337
+diff --git a/policy/modules/services/rpc.te b/policy/modules/services/rpc.te
+index 87b6b4561..9618df04e 100644
+--- a/policy/modules/services/rpc.te
++++ b/policy/modules/services/rpc.te
+@@ -341,6 +341,8 @@ storage_raw_read_removable_device(nfsd_t)
+
+ miscfiles_read_public_files(nfsd_t)
+
++mls_file_read_to_clearance(nfsd_t)
++
+ tunable_policy(`allow_nfsd_anon_write',`
+ miscfiles_manage_public_files(nfsd_t)
+ ')
+diff --git a/policy/modules/services/rpcbind.te b/policy/modules/services/rpcbind.te
+index 8972980fa..5c89a1343 100644
+--- a/policy/modules/services/rpcbind.te
++++ b/policy/modules/services/rpcbind.te
+@@ -73,6 +73,12 @@ logging_send_syslog_msg(rpcbind_t)
+
+ miscfiles_read_localization(rpcbind_t)
+
++# nfsd_t would not be allowed to send unix_stream_socket to rpcbind_t,
++# because the are running in different level. So add rules to allow this.
++mls_socket_read_all_levels(rpcbind_t)
++mls_socket_write_all_levels(rpcbind_t)
++mls_file_read_to_clearance(rpcbind_t)
++
+ ifdef(`distro_debian',`
+ term_dontaudit_use_unallocated_ttys(rpcbind_t)
+ ')
+--
+2.17.1
+
diff --git a/recipes-security/refpolicy/refpolicy/0068-policy-modules-system-logging-add-the-syslogd_t-to-t.patch b/recipes-security/refpolicy/refpolicy/0068-policy-modules-system-logging-add-the-syslogd_t-to-t.patch
deleted file mode 100644
index 921305e..0000000
--- a/recipes-security/refpolicy/refpolicy/0068-policy-modules-system-logging-add-the-syslogd_t-to-t.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From f5a6c667186850ba8c5057742195c46d9f7ff8cf Mon Sep 17 00:00:00 2001
-From: Xin Ouyang
-Date: Thu, 22 Aug 2013 13:37:23 +0800
-Subject: [PATCH] policy/modules/system/logging: add the syslogd_t to trusted
- object
-
-We add the syslogd_t to trusted object, because other process need
-to have the right to connectto/sendto /dev/log.
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Roy.Li
-Signed-off-by: Xin Ouyang
-Signed-off-by: Joe MacDonald
-Signed-off-by: Yi Zhao
----
- policy/modules/system/logging.te | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te
-index 1d45a5fa9..eec0560d1 100644
---- a/policy/modules/system/logging.te
-+++ b/policy/modules/system/logging.te
-@@ -501,6 +501,10 @@ fs_getattr_all_fs(syslogd_t)
- fs_search_auto_mountpoints(syslogd_t)
-
- mls_file_write_all_levels(syslogd_t) # Need to be able to write to /var/run/ and /var/log directories
-+mls_file_read_all_levels(syslogd_t)
-+mls_socket_write_all_levels(syslogd_t) # Neet to be able to sendto dgram
-+mls_trusted_object(syslogd_t) # Other process need to have the right to connectto/sendto /dev/log
-+mls_fd_use_all_levels(syslogd_t)
-
- term_write_console(syslogd_t)
- # Allow syslog to a terminal
---
-2.17.1
-
diff --git a/recipes-security/refpolicy/refpolicy/0069-policy-modules-admin-dmesg-make-dmesg_t-MLS-trusted-.patch b/recipes-security/refpolicy/refpolicy/0069-policy-modules-admin-dmesg-make-dmesg_t-MLS-trusted-.patch
new file mode 100644
index 0000000..02aa5e3
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0069-policy-modules-admin-dmesg-make-dmesg_t-MLS-trusted-.patch
@@ -0,0 +1,36 @@
+From bc6872d164d09355ee82dc97c4e3d99a6b6669b3 Mon Sep 17 00:00:00 2001
+From: Yi Zhao
+Date: Tue, 30 Jun 2020 10:18:20 +0800
+Subject: [PATCH] policy/modules/admin/dmesg: make dmesg_t MLS trusted reading
+ from files up to its clearance
+
+Fixes:
+avc: denied { read } for pid=255 comm="dmesg" name="kmsg"
+dev="devtmpfs" ino=10032
+scontext=system_u:system_r:dmesg_t:s0-s15:c0.c1023
+tcontext=system_u:object_r:kmsg_device_t:s15:c0.c1023 tclass=chr_file
+permissive=0
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Yi Zhao
+---
+ policy/modules/admin/dmesg.te | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/policy/modules/admin/dmesg.te b/policy/modules/admin/dmesg.te
+index 0f2835575..9f4f11397 100644
+--- a/policy/modules/admin/dmesg.te
++++ b/policy/modules/admin/dmesg.te
+@@ -51,6 +51,8 @@ miscfiles_read_localization(dmesg_t)
+ userdom_dontaudit_use_unpriv_user_fds(dmesg_t)
+ userdom_use_user_terminals(dmesg_t)
+
++mls_file_read_to_clearance(dmesg_t)
++
+ optional_policy(`
+ seutil_sigchld_newrole(dmesg_t)
+ ')
+--
+2.17.1
+
diff --git a/recipes-security/refpolicy/refpolicy/0069-policy-modules-system-init-make-init_t-MLS-trusted-f.patch b/recipes-security/refpolicy/refpolicy/0069-policy-modules-system-init-make-init_t-MLS-trusted-f.patch
deleted file mode 100644
index 74ef580..0000000
--- a/recipes-security/refpolicy/refpolicy/0069-policy-modules-system-init-make-init_t-MLS-trusted-f.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From b74b8052fd654d6a242bf3d8773a42f376d08fed Mon Sep 17 00:00:00 2001
-From: Yi Zhao
-Date: Tue, 28 May 2019 16:41:37 +0800
-Subject: [PATCH] policy/modules/system/init: make init_t MLS trusted for
- writing to keys at all levels
-
-Fixes:
-type=AVC msg=audit(1559024138.454:31): avc: denied { link } for
-pid=190 comm="(mkdir)" scontext=system_u:system_r:init_t:s0-s15:c0.c1023
-tcontext=system_u:system_r:kernel_t:s15:c0.c1023 tclass=key permissive=1
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Yi Zhao
----
- policy/modules/system/init.te | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te
-index 8e85dde72..453ae9b6b 100644
---- a/policy/modules/system/init.te
-+++ b/policy/modules/system/init.te
-@@ -207,6 +207,7 @@ mls_file_write_all_levels(init_t)
- mls_process_write_all_levels(init_t)
- mls_fd_use_all_levels(init_t)
- mls_process_set_level(init_t)
-+mls_key_write_all_levels(init_t)
-
- # MLS trusted for lowering/raising the level of files
- mls_file_downgrade(init_t)
---
-2.17.1
-
diff --git a/recipes-security/refpolicy/refpolicy/0070-policy-modules-kernel-kernel-make-kernel_t-MLS-trust.patch b/recipes-security/refpolicy/refpolicy/0070-policy-modules-kernel-kernel-make-kernel_t-MLS-trust.patch
new file mode 100644
index 0000000..733fbad
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0070-policy-modules-kernel-kernel-make-kernel_t-MLS-trust.patch
@@ -0,0 +1,77 @@
+From e7b9af24946f5f76e8e6831bfeb444c0153298be Mon Sep 17 00:00:00 2001
+From: Wenzong Fan
+Date: Fri, 13 Oct 2017 07:20:40 +0000
+Subject: [PATCH] policy/modules/kernel/kernel: make kernel_t MLS trusted for
+ lowering the level of files
+
+The boot process hangs with the error while using MLS policy:
+
+ [!!!!!!] Failed to mount API filesystems, freezing.
+ [ 4.085349] systemd[1]: Freezing execution.
+
+Make kernel_t mls trusted for lowering the level of files to fix below
+avc denials and remove the hang issue.
+
+ op=security_validate_transition seresult=denied \
+ oldcontext=system_u:object_r:device_t:s15:c0.c1023 \
+ newcontext=system_u:object_r:device_t:s0 \
+ taskcontext=system_u:system_r:kernel_t:s15:c0.c1023 tclass=dir
+ systemd[1]: Unable to fix SELinux security context of /dev: Operation not permitted
+
+ avc: denied { create } for pid=1 comm="systemd" name="shm" \
+ scontext=system_u:system_r:kernel_t:s15:c0.c1023 \
+ tcontext=system_u:object_r:tmpfs_t:s0 tclass=dir permissive=0
+ systemd[1]: Failed to mount tmpfs at /dev/shm: No such file or directory
+
+ avc: denied { create } for pid=1 comm="systemd" name="pts" \
+ scontext=system_u:system_r:kernel_t:s15:c0.c1023 \
+ tcontext=system_u:object_r:devpts_t:s0-s15:c0.c1023 tclass=dir permissive=0
+
+ op=security_validate_transition seresult=denied \
+ oldcontext=system_u:object_r:unlabeled_t:s0 \
+ newcontext=system_u:object_r:var_run_t:s0-s15:c0.c1023 \
+ taskcontext=system_u:system_r:kernel_t:s15:c0.c1023 tclass=dir
+
+ op=security_validate_transition seresult=denied \
+ oldcontext=system_u:object_r:tmpfs_t:s15:c0.c1023 \
+ newcontext=system_u:object_r:var_run_t:s0-s15:c0.c1023 \
+ taskcontext=system_u:system_r:kernel_t:s15:c0.c1023 tclass=dir
+ systemd[1]: Unable to fix SELinux security context of /run: Operation not permitted
+
+ op=security_validate_transition seresult=denied \
+ oldcontext=system_u:object_r:tmpfs_t:s15:c0.c1023 \
+ newcontext=system_u:object_r:cgroup_t:s0 \
+ taskcontext=system_u:system_r:kernel_t:s15:c0.c1023 tclass=dir
+ systemd[1]: Unable to fix SELinux security context of /sys/fs/cgroup: Operation not permitted
+
+ avc: denied { create } for pid=1 comm="systemd" name="pstore" \
+ scontext=system_u:system_r:kernel_t:s15:c0.c1023 \
+ tcontext=system_u:object_r:pstore_t:s0 tclass=dir permissive=0
+
+Reference: https://bugzilla.redhat.com/show_bug.cgi?id=667370
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Wenzong Fan
+Signed-off-by: Yi Zhao
+---
+ policy/modules/kernel/kernel.te | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/policy/modules/kernel/kernel.te b/policy/modules/kernel/kernel.te
+index c1557ddb2..8f67c6ec9 100644
+--- a/policy/modules/kernel/kernel.te
++++ b/policy/modules/kernel/kernel.te
+@@ -359,6 +359,9 @@ mls_file_read_all_levels(kernel_t)
+ mls_socket_write_all_levels(kernel_t)
+ mls_fd_use_all_levels(kernel_t)
+
++# https://bugzilla.redhat.com/show_bug.cgi?id=667370
++mls_file_downgrade(kernel_t)
++
+ ifdef(`distro_redhat',`
+ # Bugzilla 222337
+ fs_rw_tmpfs_chr_files(kernel_t)
+--
+2.17.1
+
diff --git a/recipes-security/refpolicy/refpolicy/0070-policy-modules-system-init-all-init_t-to-read-any-le.patch b/recipes-security/refpolicy/refpolicy/0070-policy-modules-system-init-all-init_t-to-read-any-le.patch
deleted file mode 100644
index 38a8076..0000000
--- a/recipes-security/refpolicy/refpolicy/0070-policy-modules-system-init-all-init_t-to-read-any-le.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 0e29b493136115b9bf397cc59424552c5b354385 Mon Sep 17 00:00:00 2001
-From: Wenzong Fan
-Date: Wed, 3 Feb 2016 04:16:06 -0500
-Subject: [PATCH] policy/modules/system/init: all init_t to read any level
- sockets
-
-Fixes:
- avc: denied { listen } for pid=1 comm="systemd" \
- path="/run/systemd/journal/stdout" \
- scontext=system_u:system_r:init_t:s0-s15:c0.c1023 \
- tcontext=system_u:system_r:syslogd_t:s15:c0.c1023 \
- tclass=unix_stream_socket permissive=1
-
- systemd[1]: Failded to listen on Journal Socket
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Wenzong Fan
-Signed-off-by: Yi Zhao
----
- policy/modules/system/init.te | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te
-index 453ae9b6b..feed5af5f 100644
---- a/policy/modules/system/init.te
-+++ b/policy/modules/system/init.te
-@@ -213,6 +213,9 @@ mls_key_write_all_levels(init_t)
- mls_file_downgrade(init_t)
- mls_file_upgrade(init_t)
-
-+# MLS trusted for reading from sockets at any level
-+mls_socket_read_all_levels(init_t)
-+
- # the following one is needed for libselinux:is_selinux_enabled()
- # otherwise the call fails and sysvinit tries to load the policy
- # again when using the initramfs
---
-2.17.1
-
diff --git a/recipes-security/refpolicy/refpolicy/0071-policy-modules-system-init-make-init_t-MLS-trusted-f.patch b/recipes-security/refpolicy/refpolicy/0071-policy-modules-system-init-make-init_t-MLS-trusted-f.patch
new file mode 100644
index 0000000..74d7428
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0071-policy-modules-system-init-make-init_t-MLS-trusted-f.patch
@@ -0,0 +1,46 @@
+From ee3e2bbaf3b94902aadebbb085c7e86b8d074e98 Mon Sep 17 00:00:00 2001
+From: Wenzong Fan
+Date: Fri, 15 Jan 2016 03:47:05 -0500
+Subject: [PATCH] policy/modules/system/init: make init_t MLS trusted for
+ lowering/raising the leve of files
+
+Fix security_validate_transition issues:
+
+ op=security_validate_transition seresult=denied \
+ oldcontext=system_u:object_r:device_t:s15:c0.c1023 \
+ newcontext=system_u:object_r:device_t:s0 \
+ taskcontext=system_u:system_r:init_t:s0-s15:c0.c1023 \
+ tclass=dir
+
+ op=security_validate_transition seresult=denied \
+ oldcontext=system_u:object_r:var_run_t:s0 \
+ newcontext=system_u:object_r:var_log_t:s0-s15:c0.c1023 \
+ taskcontext=system_u:system_r:init_t:s0-s15:c0.c1023 \
+ tclass=dir
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Wenzong Fan
+Signed-off-by: Yi Zhao
+---
+ policy/modules/system/init.te | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te
+index b7d494398..b6750015e 100644
+--- a/policy/modules/system/init.te
++++ b/policy/modules/system/init.te
+@@ -210,6 +210,10 @@ mls_process_write_all_levels(init_t)
+ mls_fd_use_all_levels(init_t)
+ mls_process_set_level(init_t)
+
++# MLS trusted for lowering/raising the level of files
++mls_file_downgrade(init_t)
++mls_file_upgrade(init_t)
++
+ # the following one is needed for libselinux:is_selinux_enabled()
+ # otherwise the call fails and sysvinit tries to load the policy
+ # again when using the initramfs
+--
+2.17.1
+
diff --git a/recipes-security/refpolicy/refpolicy/0071-policy-modules-system-logging-allow-auditd_t-to-writ.patch b/recipes-security/refpolicy/refpolicy/0071-policy-modules-system-logging-allow-auditd_t-to-writ.patch
deleted file mode 100644
index 2f7eb44..0000000
--- a/recipes-security/refpolicy/refpolicy/0071-policy-modules-system-logging-allow-auditd_t-to-writ.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 71a217de05a084899537462f8b432825b12ab187 Mon Sep 17 00:00:00 2001
-From: Wenzong Fan
-Date: Thu, 25 Feb 2016 04:25:08 -0500
-Subject: [PATCH] policy/modules/system/logging: allow auditd_t to write socket
- at any level
-
-Allow auditd_t to write init_t:unix_stream_socket at any level.
-
-Fixes:
- avc: denied { write } for pid=748 comm="auditd" \
- path="socket:[17371]" dev="sockfs" ino=17371 \
- scontext=system_u:system_r:auditd_t:s15:c0.c1023 \
- tcontext=system_u:system_r:init_t:s0-s15:c0.c1023 \
- tclass=unix_stream_socket permissive=1
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Wenzong Fan
-Signed-off-by: Yi Zhao
----
- policy/modules/system/logging.te | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te
-index eec0560d1..c22613c0b 100644
---- a/policy/modules/system/logging.te
-+++ b/policy/modules/system/logging.te
-@@ -210,6 +210,8 @@ miscfiles_read_localization(auditd_t)
-
- mls_file_read_all_levels(auditd_t)
- mls_file_write_all_levels(auditd_t) # Need to be able to write to /var/run/ directory
-+mls_fd_use_all_levels(auditd_t)
-+mls_socket_write_all_levels(auditd_t)
-
- seutil_dontaudit_read_config(auditd_t)
-
---
-2.17.1
-
diff --git a/recipes-security/refpolicy/refpolicy/0072-policy-modules-kernel-kernel-make-kernel_t-MLS-trust.patch b/recipes-security/refpolicy/refpolicy/0072-policy-modules-kernel-kernel-make-kernel_t-MLS-trust.patch
deleted file mode 100644
index f32bb74..0000000
--- a/recipes-security/refpolicy/refpolicy/0072-policy-modules-kernel-kernel-make-kernel_t-MLS-trust.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 8d1a8ffca75ada3dc576a4013644c9e9cdb45947 Mon Sep 17 00:00:00 2001
-From: Yi Zhao
-Date: Thu, 31 Oct 2019 17:35:59 +0800
-Subject: [PATCH] policy/modules/kernel/kernel: make kernel_t MLS trusted for
- writing to keys at all levels.
-
-Fixes:
-systemd-udevd[216]: regulatory.0: Process '/usr/sbin/crda' failed with exit code 254.
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Yi Zhao
----
- policy/modules/kernel/kernel.te | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/policy/modules/kernel/kernel.te b/policy/modules/kernel/kernel.te
-index 4dffaef76..34444a2f9 100644
---- a/policy/modules/kernel/kernel.te
-+++ b/policy/modules/kernel/kernel.te
-@@ -362,6 +362,8 @@ mls_fd_use_all_levels(kernel_t)
- # https://bugzilla.redhat.com/show_bug.cgi?id=667370
- mls_file_downgrade(kernel_t)
-
-+mls_key_write_all_levels(kernel_t)
-+
- ifdef(`distro_redhat',`
- # Bugzilla 222337
- fs_rw_tmpfs_chr_files(kernel_t)
---
-2.17.1
-
diff --git a/recipes-security/refpolicy/refpolicy/0072-policy-modules-system-systemd-make-systemd-tmpfiles_.patch b/recipes-security/refpolicy/refpolicy/0072-policy-modules-system-systemd-make-systemd-tmpfiles_.patch
new file mode 100644
index 0000000..2832681
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0072-policy-modules-system-systemd-make-systemd-tmpfiles_.patch
@@ -0,0 +1,63 @@
+From 8cdcca3702d69ed5f3aa9ce9d769ad483f977094 Mon Sep 17 00:00:00 2001
+From: Wenzong Fan
+Date: Thu, 4 Feb 2016 06:03:19 -0500
+Subject: [PATCH] policy/modules/system/systemd: make systemd-tmpfiles_t domain
+ MLS trusted for raising/lowering the level of files
+
+Fixes:
+ avc: denied { search } for pid=92 comm="systemd-tmpfile" name="1" \
+ dev="proc" ino=7987 \
+ scontext=system_u:system_r:systemd_tmpfiles_t:s0-s15:c0.c1023 \
+ tcontext=system_u:system_r:init_t:s0-s15:c0.c1023 \
+ tclass=dir
+
+ avc: denied { search } for pid=92 comm="systemd-tmpfile" \
+ name="journal" dev="tmpfs" ino=8226 \
+ scontext=system_u:system_r:systemd_tmpfiles_t:s0-s15:c0.c1023 \
+ tcontext=system_u:object_r:syslogd_var_run_t:s15:c0.c1023 \
+ tclass=dir
+
+ avc: denied { write } for pid=92 comm="systemd-tmpfile" \
+ name="kmsg" dev="devtmpfs" ino=7242 \
+ scontext=system_u:system_r:systemd_tmpfiles_t:s0-s15:c0.c1023 \
+ tcontext=system_u:object_r:kmsg_device_t:s15:c0.c1023 \
+ tclass=chr_file
+
+ avc: denied { read } for pid=92 comm="systemd-tmpfile" \
+ name="kmod.conf" dev="tmpfs" ino=8660 \
+ scontext=system_u:system_r:systemd_tmpfiles_t:s0-s15:c0.c1023 \
+ tcontext=system_u:object_r:var_run_t:s0 \
+ tclass=file
+
+ avc: denied { search } for pid=92 comm="systemd-tmpfile" \
+ name="kernel" dev="proc" ino=8731 \
+ scontext=system_u:system_r:systemd_tmpfiles_t:s0-s15:c0.c1023 \
+ tcontext=system_u:object_r:sysctl_kernel_t:s0 tclass=dir
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Wenzong Fan
+Signed-off-by: Yi Zhao
+---
+ policy/modules/system/systemd.te | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
+index 7d2ba2796..c50a2ba64 100644
+--- a/policy/modules/system/systemd.te
++++ b/policy/modules/system/systemd.te
+@@ -1396,6 +1396,11 @@ sysnet_relabel_config(systemd_tmpfiles_t)
+
+ systemd_log_parse_environment(systemd_tmpfiles_t)
+
++mls_file_write_all_levels(systemd_tmpfiles_t)
++mls_file_read_all_levels(systemd_tmpfiles_t)
++mls_file_downgrade(systemd_tmpfiles_t)
++mls_file_upgrade(systemd_tmpfiles_t)
++
+ userdom_manage_user_runtime_root_dirs(systemd_tmpfiles_t)
+ userdom_relabel_user_runtime_root_dirs(systemd_tmpfiles_t)
+
+--
+2.17.1
+
diff --git a/recipes-security/refpolicy/refpolicy/0073-policy-modules-system-logging-add-the-syslogd_t-to-t.patch b/recipes-security/refpolicy/refpolicy/0073-policy-modules-system-logging-add-the-syslogd_t-to-t.patch
new file mode 100644
index 0000000..d208752
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0073-policy-modules-system-logging-add-the-syslogd_t-to-t.patch
@@ -0,0 +1,37 @@
+From 4e7b0040ff558f2d69c8b9a30e73223acb20f35f Mon Sep 17 00:00:00 2001
+From: Xin Ouyang
+Date: Thu, 22 Aug 2013 13:37:23 +0800
+Subject: [PATCH] policy/modules/system/logging: add the syslogd_t to trusted
+ object
+
+We add the syslogd_t to trusted object, because other process need
+to have the right to connectto/sendto /dev/log.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Roy.Li
+Signed-off-by: Xin Ouyang
+Signed-off-by: Joe MacDonald
+Signed-off-by: Yi Zhao
+---
+ policy/modules/system/logging.te | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te
+index 62caa7a56..e608327fe 100644
+--- a/policy/modules/system/logging.te
++++ b/policy/modules/system/logging.te
+@@ -495,6 +495,10 @@ fs_search_auto_mountpoints(syslogd_t)
+ fs_search_tmpfs(syslogd_t)
+
+ mls_file_write_all_levels(syslogd_t) # Need to be able to write to /var/run/ and /var/log directories
++mls_file_read_all_levels(syslogd_t)
++mls_socket_write_all_levels(syslogd_t) # Neet to be able to sendto dgram
++mls_trusted_object(syslogd_t) # Other process need to have the right to connectto/sendto /dev/log
++mls_fd_use_all_levels(syslogd_t)
+
+ term_write_console(syslogd_t)
+ # Allow syslog to a terminal
+--
+2.17.1
+
diff --git a/recipes-security/refpolicy/refpolicy/0073-policy-modules-system-systemd-make-systemd-logind-do.patch b/recipes-security/refpolicy/refpolicy/0073-policy-modules-system-systemd-make-systemd-logind-do.patch
deleted file mode 100644
index 1e5b474..0000000
--- a/recipes-security/refpolicy/refpolicy/0073-policy-modules-system-systemd-make-systemd-logind-do.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 212156df805a24852a4762737f7040f1c7bb9b9a Mon Sep 17 00:00:00 2001
-From: Wenzong Fan
-Date: Mon, 23 Jan 2017 08:42:44 +0000
-Subject: [PATCH] policy/modules/system/systemd: make systemd-logind domain MLS
- trusted for reading from files up to its clearance.
-
-Fixes:
-avc: denied { search } for pid=184 comm="systemd-logind"
-name="journal" dev="tmpfs" ino=10949
-scontext=system_u:system_r:systemd_logind_t:s0-s15:c0.c1023
-tcontext=system_u:object_r:syslogd_runtime_t:s15:c0.c1023 tclass=dir
-permissive=1
-
-avc: denied { watch } for pid=184 comm="systemd-logind"
-path="/run/utmp" dev="tmpfs" ino=12725
-scontext=system_u:system_r:systemd_logind_t:s0-s15:c0.c1023
-tcontext=system_u:object_r:initrc_runtime_t:s0 tclass=file permissive=1
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Wenzong Fan
-Signed-off-by: Yi Zhao
----
- policy/modules/system/systemd.te | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
-index 57f4dc40d..1449d2808 100644
---- a/policy/modules/system/systemd.te
-+++ b/policy/modules/system/systemd.te
-@@ -621,6 +621,8 @@ userdom_relabelto_user_runtime_dirs(systemd_logind_t)
- userdom_setattr_user_ttys(systemd_logind_t)
- userdom_use_user_ttys(systemd_logind_t)
-
-+mls_file_read_to_clearance(systemd_logind_t)
-+
- # Needed to work around patch not yet merged into the systemd-logind supported on RHEL 7.x
- # The change in systemd by Nicolas Iooss on 02-Feb-2016 with hash 4b51966cf6c06250036e428608da92f8640beb96
- # should fix the problem where user directories in /run/user/$UID/ are not getting the proper context
---
-2.17.1
-
diff --git a/recipes-security/refpolicy/refpolicy/0074-policy-modules-system-init-make-init_t-MLS-trusted-f.patch b/recipes-security/refpolicy/refpolicy/0074-policy-modules-system-init-make-init_t-MLS-trusted-f.patch
new file mode 100644
index 0000000..b7dcaa8
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0074-policy-modules-system-init-make-init_t-MLS-trusted-f.patch
@@ -0,0 +1,33 @@
+From bbb405ac6270ef945db21cfddda63d283ee5d8af Mon Sep 17 00:00:00 2001
+From: Yi Zhao
+Date: Tue, 28 May 2019 16:41:37 +0800
+Subject: [PATCH] policy/modules/system/init: make init_t MLS trusted for
+ writing to keys at all levels
+
+Fixes:
+type=AVC msg=audit(1559024138.454:31): avc: denied { link } for
+pid=190 comm="(mkdir)" scontext=system_u:system_r:init_t:s0-s15:c0.c1023
+tcontext=system_u:system_r:kernel_t:s15:c0.c1023 tclass=key permissive=1
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Yi Zhao
+---
+ policy/modules/system/init.te | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te
+index b6750015e..962c675b0 100644
+--- a/policy/modules/system/init.te
++++ b/policy/modules/system/init.te
+@@ -209,6 +209,7 @@ mls_file_write_all_levels(init_t)
+ mls_process_write_all_levels(init_t)
+ mls_fd_use_all_levels(init_t)
+ mls_process_set_level(init_t)
++mls_key_write_all_levels(init_t)
+
+ # MLS trusted for lowering/raising the level of files
+ mls_file_downgrade(init_t)
+--
+2.17.1
+
diff --git a/recipes-security/refpolicy/refpolicy/0074-policy-modules-system-systemd-systemd-user-sessions-.patch b/recipes-security/refpolicy/refpolicy/0074-policy-modules-system-systemd-systemd-user-sessions-.patch
deleted file mode 100644
index ebe2b52..0000000
--- a/recipes-security/refpolicy/refpolicy/0074-policy-modules-system-systemd-systemd-user-sessions-.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From bea1f53ae2ba7608503051b874db9aecb97d4f00 Mon Sep 17 00:00:00 2001
-From: Yi Zhao
-Date: Thu, 18 Jun 2020 09:39:23 +0800
-Subject: [PATCH] policy/modules/system/systemd: systemd-user-sessions: make
- systemd_sessions_t MLS trusted for reading/writing from files at all levels
-
-Fixes:
-avc: denied { search } for pid=229 comm="systemd-user-se"
-name="journal" dev="tmpfs" ino=10956
-scontext=system_u:system_r:systemd_sessions_t:s0-s15:c0.c1023
-tcontext=system_u:object_r:syslogd_runtime_t:s15:c0.c1023 tclass=dir
-permissive=0
-avc: denied { write } for pid=229 comm="systemd-user-se" name="kmsg"
-dev="devtmpfs" ino=10032
-scontext=system_u:system_r:systemd_sessions_t:s0-s15:c0.c1023
-tcontext=system_u:object_r:kmsg_device_t:s15:c0.c1023 tclass=chr_file
-permissive=0
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Yi Zhao
----
- policy/modules/system/systemd.te | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
-index 1449d2808..6b0f52d15 100644
---- a/policy/modules/system/systemd.te
-+++ b/policy/modules/system/systemd.te
-@@ -1125,6 +1125,8 @@ seutil_read_file_contexts(systemd_sessions_t)
-
- systemd_log_parse_environment(systemd_sessions_t)
-
-+mls_file_read_to_clearance(systemd_sessions_t)
-+mls_file_write_all_levels(systemd_sessions_t)
-
- #########################################
- #
---
-2.17.1
-
diff --git a/recipes-security/refpolicy/refpolicy/0075-policy-modules-system-init-all-init_t-to-read-any-le.patch b/recipes-security/refpolicy/refpolicy/0075-policy-modules-system-init-all-init_t-to-read-any-le.patch
new file mode 100644
index 0000000..de7271f
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0075-policy-modules-system-init-all-init_t-to-read-any-le.patch
@@ -0,0 +1,40 @@
+From 2780811e48663df0265676749a4041c077ae6a89 Mon Sep 17 00:00:00 2001
+From: Wenzong Fan
+Date: Wed, 3 Feb 2016 04:16:06 -0500
+Subject: [PATCH] policy/modules/system/init: all init_t to read any level
+ sockets
+
+Fixes:
+ avc: denied { listen } for pid=1 comm="systemd" \
+ path="/run/systemd/journal/stdout" \
+ scontext=system_u:system_r:init_t:s0-s15:c0.c1023 \
+ tcontext=system_u:system_r:syslogd_t:s15:c0.c1023 \
+ tclass=unix_stream_socket permissive=1
+
+ systemd[1]: Failded to listen on Journal Socket
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Wenzong Fan
+Signed-off-by: Yi Zhao
+---
+ policy/modules/system/init.te | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te
+index 962c675b0..aa57a5661 100644
+--- a/policy/modules/system/init.te
++++ b/policy/modules/system/init.te
+@@ -215,6 +215,9 @@ mls_key_write_all_levels(init_t)
+ mls_file_downgrade(init_t)
+ mls_file_upgrade(init_t)
+
++# MLS trusted for reading from sockets at any level
++mls_socket_read_all_levels(init_t)
++
+ # the following one is needed for libselinux:is_selinux_enabled()
+ # otherwise the call fails and sysvinit tries to load the policy
+ # again when using the initramfs
+--
+2.17.1
+
diff --git a/recipes-security/refpolicy/refpolicy/0075-policy-modules-system-systemd-systemd-networkd-make-.patch b/recipes-security/refpolicy/refpolicy/0075-policy-modules-system-systemd-systemd-networkd-make-.patch
deleted file mode 100644
index addb480..0000000
--- a/recipes-security/refpolicy/refpolicy/0075-policy-modules-system-systemd-systemd-networkd-make-.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From a75847eb2a5a34c18a4fd24383a696d6c077a117 Mon Sep 17 00:00:00 2001
-From: Yi Zhao
-Date: Thu, 18 Jun 2020 09:59:58 +0800
-Subject: [PATCH] policy/modules/system/systemd: systemd-networkd: make
- systemd_networkd_t MLS trusted for reading from files up to its clearance
-
-Fixes:
-avc: denied { search } for pid=219 comm="systemd-network"
-name="journal" dev="tmpfs" ino=10956
-scontext=system_u:system_r:systemd_networkd_t:s0-s15:c0.c1023
-tcontext=system_u:object_r:syslogd_runtime_t:s15:c0.c1023 tclass=dir
-permissive=0
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Yi Zhao
----
- policy/modules/system/systemd.te | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
-index 6b0f52d15..cfbd9196a 100644
---- a/policy/modules/system/systemd.te
-+++ b/policy/modules/system/systemd.te
-@@ -795,6 +795,8 @@ sysnet_read_config(systemd_networkd_t)
-
- systemd_log_parse_environment(systemd_networkd_t)
-
-+mls_file_read_to_clearance(systemd_networkd_t)
-+
- optional_policy(`
- dbus_system_bus_client(systemd_networkd_t)
- dbus_connect_system_bus(systemd_networkd_t)
---
-2.17.1
-
diff --git a/recipes-security/refpolicy/refpolicy/0076-policy-modules-system-logging-allow-auditd_t-to-writ.patch b/recipes-security/refpolicy/refpolicy/0076-policy-modules-system-logging-allow-auditd_t-to-writ.patch
new file mode 100644
index 0000000..cd93c08
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0076-policy-modules-system-logging-allow-auditd_t-to-writ.patch
@@ -0,0 +1,39 @@
+From a74584ba424cd5e392db2a64b4ec66ebb307eb4c Mon Sep 17 00:00:00 2001
+From: Wenzong Fan
+Date: Thu, 25 Feb 2016 04:25:08 -0500
+Subject: [PATCH] policy/modules/system/logging: allow auditd_t to write socket
+ at any level
+
+Allow auditd_t to write init_t:unix_stream_socket at any level.
+
+Fixes:
+ avc: denied { write } for pid=748 comm="auditd" \
+ path="socket:[17371]" dev="sockfs" ino=17371 \
+ scontext=system_u:system_r:auditd_t:s15:c0.c1023 \
+ tcontext=system_u:system_r:init_t:s0-s15:c0.c1023 \
+ tclass=unix_stream_socket permissive=1
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Wenzong Fan