summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYi Zhao <yi.zhao@windriver.com>2021-03-02 16:52:06 +0800
committerJoe MacDonald <joe@deserted.net>2021-03-03 13:55:58 -0500
commite51f84912df15c436d31fea0e3600406f452197d (patch)
treec6da6d471f5ed68342b51568948e240e53c00e67
parentf156bc995b45e8242b8d5e851f988ecdb5505261 (diff)
downloadmeta-selinux-e51f84912df15c436d31fea0e3600406f452197d.tar.gz
refpolicy: upgrade 20200229+git -> 20210203+git
* Update to latest git rev. * Drop obsolete and unused patches. * Rebase patches. * Add patches to make systemd --user work. Signed-off-by: Yi Zhao <yi.zhao@windriver.com> Signed-off-by: Joe MacDonald <joe@deserted.net>
-rw-r--r--recipes-security/refpolicy/refpolicy-minimum_git.bb1
-rw-r--r--recipes-security/refpolicy/refpolicy-targeted_git.bb2
-rw-r--r--recipes-security/refpolicy/refpolicy/0001-fc-subs-volatile-alias-common-var-volatile-paths.patch6
-rw-r--r--recipes-security/refpolicy/refpolicy/0001-refpolicy-minimum-make-sysadmin-module-optional.patch10
-rw-r--r--recipes-security/refpolicy/refpolicy/0001-refpolicy-targeted-make-unconfined_u-the-default-sel.patch20
-rw-r--r--recipes-security/refpolicy/refpolicy/0002-fc-subs-busybox-set-aliases-for-bin-sbin-and-usr.patch6
-rw-r--r--recipes-security/refpolicy/refpolicy/0002-refpolicy-minimum-enable-nscd_use_shm.patch35
-rw-r--r--recipes-security/refpolicy/refpolicy/0003-fc-hostname-apply-policy-to-common-yocto-hostname-al.patch2
-rw-r--r--recipes-security/refpolicy/refpolicy/0004-fc-bash-apply-usr-bin-bash-context-to-bin-bash.bash.patch4
-rw-r--r--recipes-security/refpolicy/refpolicy/0005-fc-resolv.conf-label-resolv.conf-in-var-run-properly.patch6
-rw-r--r--recipes-security/refpolicy/refpolicy/0006-fc-login-apply-login-context-to-login.shadow.patch2
-rw-r--r--recipes-security/refpolicy/refpolicy/0007-fc-bind-fix-real-path-for-bind.patch4
-rw-r--r--recipes-security/refpolicy/refpolicy/0008-fc-hwclock-add-hwclock-alternatives.patch2
-rw-r--r--recipes-security/refpolicy/refpolicy/0009-fc-dmesg-apply-policy-to-dmesg-alternatives.patch2
-rw-r--r--recipes-security/refpolicy/refpolicy/0010-fc-ssh-apply-policy-to-ssh-alternatives.patch2
-rw-r--r--recipes-security/refpolicy/refpolicy/0011-fc-sysnetwork-apply-policy-to-ip-alternatives.patch6
-rw-r--r--recipes-security/refpolicy/refpolicy/0012-fc-udev-apply-policy-to-udevadm-in-libexec.patch6
-rw-r--r--recipes-security/refpolicy/refpolicy/0013-fc-rpm-apply-rpm_exec-policy-to-cpio-binaries.patch4
-rw-r--r--recipes-security/refpolicy/refpolicy/0014-fc-su-apply-policy-to-su-alternatives.patch2
-rw-r--r--recipes-security/refpolicy/refpolicy/0015-fc-fstools-fix-real-path-for-fstools.patch2
-rw-r--r--recipes-security/refpolicy/refpolicy/0016-fc-init-fix-update-alternatives-for-sysvinit.patch6
-rw-r--r--recipes-security/refpolicy/refpolicy/0017-fc-brctl-apply-policy-to-brctl-alternatives.patch2
-rw-r--r--recipes-security/refpolicy/refpolicy/0018-fc-corecommands-apply-policy-to-nologin-alternatives.patch6
-rw-r--r--recipes-security/refpolicy/refpolicy/0019-fc-locallogin-apply-policy-to-sulogin-alternatives.patch2
-rw-r--r--recipes-security/refpolicy/refpolicy/0020-fc-ntp-apply-policy-to-ntpd-alternatives.patch2
-rw-r--r--recipes-security/refpolicy/refpolicy/0021-fc-kerberos-apply-policy-to-kerberos-alternatives.patch2
-rw-r--r--recipes-security/refpolicy/refpolicy/0022-fc-ldap-apply-policy-to-ldap-alternatives.patch2
-rw-r--r--recipes-security/refpolicy/refpolicy/0023-fc-postgresql-apply-policy-to-postgresql-alternative.patch2
-rw-r--r--recipes-security/refpolicy/refpolicy/0024-fc-screen-apply-policy-to-screen-alternatives.patch6
-rw-r--r--recipes-security/refpolicy/refpolicy/0025-fc-usermanage-apply-policy-to-usermanage-alternative.patch2
-rw-r--r--recipes-security/refpolicy/refpolicy/0026-fc-getty-add-file-context-to-start_getty.patch2
-rw-r--r--recipes-security/refpolicy/refpolicy/0027-fc-init-add-file-context-to-etc-network-if-files.patch6
-rw-r--r--recipes-security/refpolicy/refpolicy/0028-fc-vlock-apply-policy-to-vlock-alternatives.patch2
-rw-r--r--recipes-security/refpolicy/refpolicy/0029-fc-cron-apply-policy-to-etc-init.d-crond.patch2
-rw-r--r--recipes-security/refpolicy/refpolicy/0030-fc-sysnetwork-update-file-context-for-ifconfig.patch (renamed from recipes-security/refpolicy/refpolicy/0081-fc-sysnetwork-update-file-context-for-ifconfig.patch)6
-rw-r--r--recipes-security/refpolicy/refpolicy/0031-file_contexts.subs_dist-set-aliase-for-root-director.patch (renamed from recipes-security/refpolicy/refpolicy/0030-file_contexts.subs_dist-set-aliase-for-root-director.patch)6
-rw-r--r--recipes-security/refpolicy/refpolicy/0032-policy-modules-system-logging-add-rules-for-the-syml.patch (renamed from recipes-security/refpolicy/refpolicy/0031-policy-modules-system-logging-add-rules-for-the-syml.patch)43
-rw-r--r--recipes-security/refpolicy/refpolicy/0033-policy-modules-system-logging-add-domain-rules-for-t.patch37
-rw-r--r--recipes-security/refpolicy/refpolicy/0033-policy-modules-system-logging-add-rules-for-syslogd-.patch (renamed from recipes-security/refpolicy/refpolicy/0032-policy-modules-system-logging-add-rules-for-syslogd-.patch)6
-rw-r--r--recipes-security/refpolicy/refpolicy/0034-policy-modules-kernel-files-add-rules-for-the-symlin.patch24
-rw-r--r--recipes-security/refpolicy/refpolicy/0035-policy-modules-kernel-terminal-add-rules-for-bsdpty_.patch124
-rw-r--r--recipes-security/refpolicy/refpolicy/0035-policy-modules-system-logging-fix-auditd-startup-fai.patch64
-rw-r--r--recipes-security/refpolicy/refpolicy/0036-policy-modules-kernel-terminal-don-t-audit-tty_devic.patch4
-rw-r--r--recipes-security/refpolicy/refpolicy/0037-policy-modules-system-modutils-allow-mod_t-to-access.patch67
-rw-r--r--recipes-security/refpolicy/refpolicy/0038-policy-modules-services-avahi-allow-avahi_t-to-watch.patch (renamed from recipes-security/refpolicy/refpolicy/0037-policy-modules-services-avahi-allow-avahi_t-to-watch.patch)8
-rw-r--r--recipes-security/refpolicy/refpolicy/0038-policy-modules-system-getty-allow-getty_t-watch-gett.patch42
-rw-r--r--recipes-security/refpolicy/refpolicy/0039-policy-modules-services-bluetooth-allow-bluetooth_t-.patch65
-rw-r--r--recipes-security/refpolicy/refpolicy/0039-policy-modules-system-getty-allow-getty_t-to-search-.patch32
-rw-r--r--recipes-security/refpolicy/refpolicy/0040-policy-modules-services-bluetooth-fix-bluetoothd-sta.patch88
-rw-r--r--recipes-security/refpolicy/refpolicy/0041-policy-modules-roles-sysadm-allow-sysadm-to-run-rpci.patch (renamed from recipes-security/refpolicy/refpolicy/0040-policy-modules-roles-sysadm-allow-sysadm-to-run-rpci.patch)6
-rw-r--r--recipes-security/refpolicy/refpolicy/0042-policy-modules-services-rpc-add-capability-dac_read_.patch (renamed from recipes-security/refpolicy/refpolicy/0041-policy-modules-services-rpc-add-capability-dac_read_.patch)6
-rw-r--r--recipes-security/refpolicy/refpolicy/0043-policy-modules-services-rpcbind-allow-rpcbind_t-to-c.patch (renamed from recipes-security/refpolicy/refpolicy/0042-policy-modules-services-rpcbind-allow-rpcbind_t-to-c.patch)24
-rw-r--r--recipes-security/refpolicy/refpolicy/0044-policy-modules-services-rngd-fix-security-context-fo.patch (renamed from recipes-security/refpolicy/refpolicy/0043-policy-modules-services-rngd-fix-security-context-fo.patch)29
-rw-r--r--recipes-security/refpolicy/refpolicy/0044-policy-modules-system-authlogin-allow-chkpwd_t-to-ma.patch34
-rw-r--r--recipes-security/refpolicy/refpolicy/0045-policy-modules-services-ssh-allow-ssh_keygen_t-to-re.patch34
-rw-r--r--recipes-security/refpolicy/refpolicy/0045-policy-modules-system-udev-allow-udevadm_t-to-search.patch34
-rw-r--r--recipes-security/refpolicy/refpolicy/0046-policy-modules-services-ssh-make-respective-init-scr.patch (renamed from recipes-security/refpolicy/refpolicy/0049-policy-modules-services-ssh-make-respective-init-scr.patch)4
-rw-r--r--recipes-security/refpolicy/refpolicy/0046-policy-modules-udev-do-not-audit-udevadm_t-to-read-w.patch37
-rw-r--r--recipes-security/refpolicy/refpolicy/0047-policy-modules-kernel-terminal-allow-loging-to-reset.patch (renamed from recipes-security/refpolicy/refpolicy/0050-policy-modules-kernel-terminal-allow-loging-to-reset.patch)4
-rw-r--r--recipes-security/refpolicy/refpolicy/0047-policy-modules-services-rdisc-allow-rdisc_t-to-searc.patch34
-rw-r--r--recipes-security/refpolicy/refpolicy/0048-policy-modules-system-logging-fix-auditd-startup-fai.patch52
-rw-r--r--recipes-security/refpolicy/refpolicy/0048-policy-modules-system-selinuxutil-allow-semanage_t-t.patch (renamed from recipes-security/refpolicy/refpolicy/0051-policy-modules-system-selinuxutil-allow-semanage_t-t.patch)6
-rw-r--r--recipes-security/refpolicy/refpolicy/0049-policy-modules-system-systemd-enable-support-for-sys.patch (renamed from recipes-security/refpolicy/refpolicy/0054-policy-modules-system-systemd-enable-support-for-sys.patch)10
-rw-r--r--recipes-security/refpolicy/refpolicy/0050-policy-modules-system-systemd-fix-systemd-resolved-s.patch69
-rw-r--r--recipes-security/refpolicy/refpolicy/0051-policy-modules-system-init-add-capability2-bpf-and-p.patch37
-rw-r--r--recipes-security/refpolicy/refpolicy/0052-policy-modules-system-sysnetwork-allow-ifconfig_t-to.patch35
-rw-r--r--recipes-security/refpolicy/refpolicy/0052-policy-modules-system-systemd-allow-systemd_logind_t.patch37
-rw-r--r--recipes-security/refpolicy/refpolicy/0053-policy-modules-services-ntp-allow-ntpd_t-to-watch-sy.patch55
-rw-r--r--recipes-security/refpolicy/refpolicy/0053-policy-modules-system-logging-set-label-devlog_t-to-.patch86
-rw-r--r--recipes-security/refpolicy/refpolicy/0054-policy-modules-system-systemd-support-systemd-user.patch189
-rw-r--r--recipes-security/refpolicy/refpolicy/0055-policy-modules-system-logging-fix-systemd-journald-s.patch74
-rw-r--r--recipes-security/refpolicy/refpolicy/0055-policy-modules-system-systemd-allow-systemd-generato.patch69
-rw-r--r--recipes-security/refpolicy/refpolicy/0056-policy-modules-system-systemd-allow-systemd_backligh.patch35
-rw-r--r--recipes-security/refpolicy/refpolicy/0057-policy-modules-system-logging-fix-systemd-journald-s.patch47
-rw-r--r--recipes-security/refpolicy/refpolicy/0057-policy-modules-system-systemd-add-capability-mknod-f.patch35
-rw-r--r--recipes-security/refpolicy/refpolicy/0058-policy-modules-services-cron-allow-crond_t-to-search.patch34
-rw-r--r--recipes-security/refpolicy/refpolicy/0058-policy-modules-system-systemd-systemd-gpt-auto-gener.patch35
-rw-r--r--recipes-security/refpolicy/refpolicy/0059-policy-modules-services-crontab-allow-sysadm_r-to-ru.patch46
-rw-r--r--recipes-security/refpolicy/refpolicy/0060-policy-modules-system-sysnetwork-support-priviledge-.patch120
-rw-r--r--recipes-security/refpolicy/refpolicy/0061-policy-modules-services-acpi-allow-acpid-to-watch-th.patch35
-rw-r--r--recipes-security/refpolicy/refpolicy/0062-policy-modules-system-setrans-allow-setrans-to-acces.patch (renamed from recipes-security/refpolicy/refpolicy/0063-policy-modules-system-setrans-allow-setrans-to-acces.patch)19
-rw-r--r--recipes-security/refpolicy/refpolicy/0063-policy-modules-system-modutils-allow-kmod_t-to-write.patch35
-rw-r--r--recipes-security/refpolicy/refpolicy/0064-policy-modules-roles-sysadm-allow-sysadm_t-to-watch-.patch (renamed from recipes-security/refpolicy/refpolicy/0056-policy-modules-roles-sysadm-allow-sysadm_t-to-watch-.patch)17
-rw-r--r--recipes-security/refpolicy/refpolicy/0065-policy-modules-system-selinux-allow-setfiles_t-to-re.patch44
-rw-r--r--recipes-security/refpolicy/refpolicy/0066-policy-modules-system-mount-make-mount_t-domain-MLS-.patch (renamed from recipes-security/refpolicy/refpolicy/0062-policy-modules-system-mount-make-mount_t-domain-MLS-.patch)6
-rw-r--r--recipes-security/refpolicy/refpolicy/0067-policy-modules-roles-sysadm-MLS-sysadm-rw-to-clearan.patch (renamed from recipes-security/refpolicy/refpolicy/0061-policy-modules-roles-sysadm-MLS-sysadm-rw-to-clearan.patch)4
-rw-r--r--recipes-security/refpolicy/refpolicy/0068-policy-modules-services-rpc-make-nfsd_t-domain-MLS-t.patch (renamed from recipes-security/refpolicy/refpolicy/0059-policy-modules-services-rpc-fix-policy-for-nfsserver.patch)31
-rw-r--r--recipes-security/refpolicy/refpolicy/0069-policy-modules-admin-dmesg-make-dmesg_t-MLS-trusted-.patch (renamed from recipes-security/refpolicy/refpolicy/0064-policy-modules-admin-dmesg-make-dmesg_t-MLS-trusted-.patch)4
-rw-r--r--recipes-security/refpolicy/refpolicy/0070-policy-modules-kernel-kernel-make-kernel_t-MLS-trust.patch (renamed from recipes-security/refpolicy/refpolicy/0065-policy-modules-kernel-kernel-make-kernel_t-MLS-trust.patch)4
-rw-r--r--recipes-security/refpolicy/refpolicy/0071-policy-modules-system-init-make-init_t-MLS-trusted-f.patch (renamed from recipes-security/refpolicy/refpolicy/0066-policy-modules-system-init-make-init_t-MLS-trusted-f.patch)6
-rw-r--r--recipes-security/refpolicy/refpolicy/0072-policy-modules-system-systemd-make-systemd-tmpfiles_.patch (renamed from recipes-security/refpolicy/refpolicy/0067-policy-modules-system-systemd-make-systemd-tmpfiles_.patch)6
-rw-r--r--recipes-security/refpolicy/refpolicy/0073-policy-modules-system-logging-add-the-syslogd_t-to-t.patch (renamed from recipes-security/refpolicy/refpolicy/0068-policy-modules-system-logging-add-the-syslogd_t-to-t.patch)8
-rw-r--r--recipes-security/refpolicy/refpolicy/0074-policy-modules-system-init-make-init_t-MLS-trusted-f.patch (renamed from recipes-security/refpolicy/refpolicy/0069-policy-modules-system-init-make-init_t-MLS-trusted-f.patch)6
-rw-r--r--recipes-security/refpolicy/refpolicy/0075-policy-modules-system-init-all-init_t-to-read-any-le.patch (renamed from recipes-security/refpolicy/refpolicy/0070-policy-modules-system-init-all-init_t-to-read-any-le.patch)6
-rw-r--r--recipes-security/refpolicy/refpolicy/0075-policy-modules-system-systemd-systemd-networkd-make-.patch36
-rw-r--r--recipes-security/refpolicy/refpolicy/0076-policy-modules-system-logging-allow-auditd_t-to-writ.patch (renamed from recipes-security/refpolicy/refpolicy/0071-policy-modules-system-logging-allow-auditd_t-to-writ.patch)6
-rw-r--r--recipes-security/refpolicy/refpolicy/0076-policy-modules-system-systemd-systemd-resolved-make-.patch40
-rw-r--r--recipes-security/refpolicy/refpolicy/0077-policy-modules-kernel-kernel-make-kernel_t-MLS-trust.patch (renamed from recipes-security/refpolicy/refpolicy/0072-policy-modules-kernel-kernel-make-kernel_t-MLS-trust.patch)4
-rw-r--r--recipes-security/refpolicy/refpolicy/0077-policy-modules-system-systemd-make-systemd-modules_t.patch36
-rw-r--r--recipes-security/refpolicy/refpolicy/0078-policy-modules-system-systemd-make-systemd-logind-do.patch (renamed from recipes-security/refpolicy/refpolicy/0073-policy-modules-system-systemd-make-systemd-logind-do.patch)6
-rw-r--r--recipes-security/refpolicy/refpolicy/0078-policy-modules-system-systemd-systemd-gpt-auto-gener.patch70
-rw-r--r--recipes-security/refpolicy/refpolicy/0079-policy-modules-system-systemd-systemd-user-sessions-.patch (renamed from recipes-security/refpolicy/refpolicy/0074-policy-modules-system-systemd-systemd-user-sessions-.patch)6
-rw-r--r--recipes-security/refpolicy/refpolicy/0080-policy-modules-system-systemd-systemd-make-systemd_-.patch162
-rw-r--r--recipes-security/refpolicy/refpolicy/0081-policy-modules-services-ntp-make-nptd_t-MLS-trusted-.patch (renamed from recipes-security/refpolicy/refpolicy/0079-policy-modules-services-ntp-make-nptd_t-MLS-trusted-.patch)6
-rw-r--r--recipes-security/refpolicy/refpolicy/0082-policy-modules-system-setrans-allow-setrans_t-use-fd.patch30
-rw-r--r--recipes-security/refpolicy/refpolicy/0083-policy-modules-services-acpi-make-acpid_t-domain-MLS.patch35
-rw-r--r--recipes-security/refpolicy/refpolicy/0084-policy-modules-services-avahi-make-avahi_t-MLS-trust.patch (renamed from recipes-security/refpolicy/refpolicy/0080-policy-modules-services-avahi-make-avahi_t-MLS-trust.patch)4
-rw-r--r--recipes-security/refpolicy/refpolicy/0085-policy-modules-services-bluetooth-make-bluetooth_t-d.patch36
-rw-r--r--recipes-security/refpolicy/refpolicy/0086-policy-modules-system-sysnetwork-make-dhcpc_t-domain.patch38
-rw-r--r--recipes-security/refpolicy/refpolicy/0087-policy-modules-services-inetd-make-inetd_t-domain-ML.patch36
-rw-r--r--recipes-security/refpolicy/refpolicy/0088-policy-modules-services-bind-make-named_t-domain-MLS.patch38
-rw-r--r--recipes-security/refpolicy/refpolicy/0089-policy-modules-services-rpc-make-rpcd_t-MLS-trusted-.patch (renamed from recipes-security/refpolicy/refpolicy/0060-policy-modules-services-rpc-make-rpcd_t-MLS-trusted-.patch)6
-rw-r--r--recipes-security/refpolicy/refpolicy/0090-policy-modules-system-systemd-make-_systemd_t-MLS-tr.patch42
-rw-r--r--recipes-security/refpolicy/refpolicy_common.inc113
-rw-r--r--recipes-security/refpolicy/refpolicy_git.inc4
115 files changed, 1904 insertions, 1182 deletions
diff --git a/recipes-security/refpolicy/refpolicy-minimum_git.bb b/recipes-security/refpolicy/refpolicy-minimum_git.bb
index dc06ccf..c4c9031 100644
--- a/recipes-security/refpolicy/refpolicy-minimum_git.bb
+++ b/recipes-security/refpolicy/refpolicy-minimum_git.bb
@@ -13,6 +13,7 @@ domains are unconfined. \
13 13
14SRC_URI += " \ 14SRC_URI += " \
15 file://0001-refpolicy-minimum-make-sysadmin-module-optional.patch \ 15 file://0001-refpolicy-minimum-make-sysadmin-module-optional.patch \
16 file://0002-refpolicy-minimum-enable-nscd_use_shm.patch \
16 " 17 "
17 18
18POLICY_NAME = "minimum" 19POLICY_NAME = "minimum"
diff --git a/recipes-security/refpolicy/refpolicy-targeted_git.bb b/recipes-security/refpolicy/refpolicy-targeted_git.bb
index e37a083..de81d46 100644
--- a/recipes-security/refpolicy/refpolicy-targeted_git.bb
+++ b/recipes-security/refpolicy/refpolicy-targeted_git.bb
@@ -6,8 +6,6 @@ domain, so they have the same access to the system as if SELinux was not \
6enabled. \ 6enabled. \
7" 7"
8 8
9FILESEXTRAPATHS_prepend := "${THISDIR}/refpolicy-${PV}:"
10
11POLICY_NAME = "targeted" 9POLICY_NAME = "targeted"
12POLICY_TYPE = "mcs" 10POLICY_TYPE = "mcs"
13POLICY_MLS_SENS = "0" 11POLICY_MLS_SENS = "0"
diff --git a/recipes-security/refpolicy/refpolicy/0001-fc-subs-volatile-alias-common-var-volatile-paths.patch b/recipes-security/refpolicy/refpolicy/0001-fc-subs-volatile-alias-common-var-volatile-paths.patch
index be802ec..9f85980 100644
--- a/recipes-security/refpolicy/refpolicy/0001-fc-subs-volatile-alias-common-var-volatile-paths.patch
+++ b/recipes-security/refpolicy/refpolicy/0001-fc-subs-volatile-alias-common-var-volatile-paths.patch
@@ -1,4 +1,4 @@
1From 7dc492abc2918e770b36099cf079ca9be10598c8 Mon Sep 17 00:00:00 2001 1From 8a6052604e4f39ef9cbab62372006bc6f736dbed Mon Sep 17 00:00:00 2001
2From: Joe MacDonald <joe_macdonald@mentor.com> 2From: Joe MacDonald <joe_macdonald@mentor.com>
3Date: Thu, 28 Mar 2019 16:14:09 -0400 3Date: Thu, 28 Mar 2019 16:14:09 -0400
4Subject: [PATCH] fc/subs/volatile: alias common /var/volatile paths 4Subject: [PATCH] fc/subs/volatile: alias common /var/volatile paths
@@ -15,10 +15,10 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
15 1 file changed, 6 insertions(+) 15 1 file changed, 6 insertions(+)
16 16
17diff --git a/config/file_contexts.subs_dist b/config/file_contexts.subs_dist 17diff --git a/config/file_contexts.subs_dist b/config/file_contexts.subs_dist
18index 346d920e3..aeb25a5bb 100644 18index 653d25d93..652e1dd35 100644
19--- a/config/file_contexts.subs_dist 19--- a/config/file_contexts.subs_dist
20+++ b/config/file_contexts.subs_dist 20+++ b/config/file_contexts.subs_dist
21@@ -31,3 +31,9 @@ 21@@ -32,3 +32,9 @@
22 # not for refpolicy intern, but for /var/run using applications, 22 # not for refpolicy intern, but for /var/run using applications,
23 # like systemd tmpfiles or systemd socket configurations 23 # like systemd tmpfiles or systemd socket configurations
24 /var/run /run 24 /var/run /run
diff --git a/recipes-security/refpolicy/refpolicy/0001-refpolicy-minimum-make-sysadmin-module-optional.patch b/recipes-security/refpolicy/refpolicy/0001-refpolicy-minimum-make-sysadmin-module-optional.patch
index deb27c0..d300edd 100644
--- a/recipes-security/refpolicy/refpolicy/0001-refpolicy-minimum-make-sysadmin-module-optional.patch
+++ b/recipes-security/refpolicy/refpolicy/0001-refpolicy-minimum-make-sysadmin-module-optional.patch
@@ -1,4 +1,4 @@
1From efe4d5472fde3d4f043f4e8660c6cc73c7fc1542 Mon Sep 17 00:00:00 2001 1From dc757d6df2314d82029b23b409df8de22a4df45e Mon Sep 17 00:00:00 2001
2From: Joe MacDonald <joe_macdonald@mentor.com> 2From: Joe MacDonald <joe_macdonald@mentor.com>
3Date: Fri, 5 Apr 2019 11:53:28 -0400 3Date: Fri, 5 Apr 2019 11:53:28 -0400
4Subject: [PATCH] refpolicy-minimum: make sysadmin module optional 4Subject: [PATCH] refpolicy-minimum: make sysadmin module optional
@@ -22,10 +22,10 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
22 2 files changed, 11 insertions(+), 7 deletions(-) 22 2 files changed, 11 insertions(+), 7 deletions(-)
23 23
24diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te 24diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te
25index feed5af5f..6b6b723b8 100644 25index aa57a5661..9b03d3767 100644
26--- a/policy/modules/system/init.te 26--- a/policy/modules/system/init.te
27+++ b/policy/modules/system/init.te 27+++ b/policy/modules/system/init.te
28@@ -515,13 +515,15 @@ ifdef(`init_systemd',` 28@@ -527,13 +527,15 @@ ifdef(`init_systemd',`
29 unconfined_write_keys(init_t) 29 unconfined_write_keys(init_t)
30 ') 30 ')
31 ',` 31 ',`
@@ -48,10 +48,10 @@ index feed5af5f..6b6b723b8 100644
48 ') 48 ')
49 ') 49 ')
50diff --git a/policy/modules/system/locallogin.te b/policy/modules/system/locallogin.te 50diff --git a/policy/modules/system/locallogin.te b/policy/modules/system/locallogin.te
51index f629b0040..971ca40e5 100644 51index 109980e79..313112371 100644
52--- a/policy/modules/system/locallogin.te 52--- a/policy/modules/system/locallogin.te
53+++ b/policy/modules/system/locallogin.te 53+++ b/policy/modules/system/locallogin.te
54@@ -267,7 +267,9 @@ userdom_use_unpriv_users_fds(sulogin_t) 54@@ -265,7 +265,9 @@ userdom_use_unpriv_users_fds(sulogin_t)
55 userdom_search_user_home_dirs(sulogin_t) 55 userdom_search_user_home_dirs(sulogin_t)
56 userdom_use_user_ptys(sulogin_t) 56 userdom_use_user_ptys(sulogin_t)
57 57
diff --git a/recipes-security/refpolicy/refpolicy/0001-refpolicy-targeted-make-unconfined_u-the-default-sel.patch b/recipes-security/refpolicy/refpolicy/0001-refpolicy-targeted-make-unconfined_u-the-default-sel.patch
index f3244c6..89bc68e 100644
--- a/recipes-security/refpolicy/refpolicy/0001-refpolicy-targeted-make-unconfined_u-the-default-sel.patch
+++ b/recipes-security/refpolicy/refpolicy/0001-refpolicy-targeted-make-unconfined_u-the-default-sel.patch
@@ -1,4 +1,4 @@
1From 8613549f3aad37ce3bec8513057f0f893d4cc9bd Mon Sep 17 00:00:00 2001 1From 7ff6cf3766a672c4f2b7bd0dc5efa296bd6aba51 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Mon, 20 Apr 2020 11:50:03 +0800 3Date: Mon, 20 Apr 2020 11:50:03 +0800
4Subject: [PATCH] refpolicy-targeted: make unconfined_u the default selinux 4Subject: [PATCH] refpolicy-targeted: make unconfined_u the default selinux
@@ -43,7 +43,7 @@ index ce614b41b..c0903d98b 100644
43+root:unconfined_u:s0-mcs_systemhigh 43+root:unconfined_u:s0-mcs_systemhigh
44+__default__:unconfined_u:s0 44+__default__:unconfined_u:s0
45diff --git a/policy/modules/roles/sysadm.te b/policy/modules/roles/sysadm.te 45diff --git a/policy/modules/roles/sysadm.te b/policy/modules/roles/sysadm.te
46index ac5239d83..310a4fad2 100644 46index ce7d77d31..1aff2c31a 100644
47--- a/policy/modules/roles/sysadm.te 47--- a/policy/modules/roles/sysadm.te
48+++ b/policy/modules/roles/sysadm.te 48+++ b/policy/modules/roles/sysadm.te
49@@ -53,6 +53,7 @@ ubac_fd_exempt(sysadm_t) 49@@ -53,6 +53,7 @@ ubac_fd_exempt(sysadm_t)
@@ -52,13 +52,13 @@ index ac5239d83..310a4fad2 100644
52 init_admin(sysadm_t) 52 init_admin(sysadm_t)
53+init_script_role_transition(sysadm_r) 53+init_script_role_transition(sysadm_r)
54 54
55 selinux_read_policy(sysadm_t) 55 # Add/remove user home directories
56 56 userdom_manage_user_home_dirs(sysadm_t)
57diff --git a/policy/modules/system/init.if b/policy/modules/system/init.if 57diff --git a/policy/modules/system/init.if b/policy/modules/system/init.if
58index ab24b5d9b..ed441ddef 100644 58index 98e94283f..eb6d5b32d 100644
59--- a/policy/modules/system/init.if 59--- a/policy/modules/system/init.if
60+++ b/policy/modules/system/init.if 60+++ b/policy/modules/system/init.if
61@@ -1798,11 +1798,12 @@ interface(`init_script_file_entry_type',` 61@@ -1821,11 +1821,12 @@ interface(`init_script_file_entry_type',`
62 # 62 #
63 interface(`init_spec_domtrans_script',` 63 interface(`init_spec_domtrans_script',`
64 gen_require(` 64 gen_require(`
@@ -73,7 +73,7 @@ index ab24b5d9b..ed441ddef 100644
73 73
74 ifdef(`distro_gentoo',` 74 ifdef(`distro_gentoo',`
75 gen_require(` 75 gen_require(`
76@@ -1813,11 +1814,11 @@ interface(`init_spec_domtrans_script',` 76@@ -1836,11 +1837,11 @@ interface(`init_spec_domtrans_script',`
77 ') 77 ')
78 78
79 ifdef(`enable_mcs',` 79 ifdef(`enable_mcs',`
@@ -87,7 +87,7 @@ index ab24b5d9b..ed441ddef 100644
87 ') 87 ')
88 ') 88 ')
89 89
90@@ -1834,17 +1835,18 @@ interface(`init_spec_domtrans_script',` 90@@ -1857,17 +1858,18 @@ interface(`init_spec_domtrans_script',`
91 interface(`init_domtrans_script',` 91 interface(`init_domtrans_script',`
92 gen_require(` 92 gen_require(`
93 type initrc_t, initrc_exec_t; 93 type initrc_t, initrc_exec_t;
@@ -108,7 +108,7 @@ index ab24b5d9b..ed441ddef 100644
108 ') 108 ')
109 ') 109 ')
110 110
111@@ -3599,3 +3601,31 @@ interface(`init_getrlimit',` 111@@ -3532,3 +3534,31 @@ interface(`init_getrlimit',`
112 112
113 allow $1 init_t:process getrlimit; 113 allow $1 init_t:process getrlimit;
114 ') 114 ')
@@ -141,7 +141,7 @@ index ab24b5d9b..ed441ddef 100644
141+ role_transition $1 init_script_file_type system_r; 141+ role_transition $1 init_script_file_type system_r;
142+') 142+')
143diff --git a/policy/modules/system/unconfined.te b/policy/modules/system/unconfined.te 143diff --git a/policy/modules/system/unconfined.te b/policy/modules/system/unconfined.te
144index 3d75855b6..5aa4c0b69 100644 144index 385c88695..87adb7e9d 100644
145--- a/policy/modules/system/unconfined.te 145--- a/policy/modules/system/unconfined.te
146+++ b/policy/modules/system/unconfined.te 146+++ b/policy/modules/system/unconfined.te
147@@ -20,6 +20,11 @@ type unconfined_execmem_t alias ada_t; 147@@ -20,6 +20,11 @@ type unconfined_execmem_t alias ada_t;
diff --git a/recipes-security/refpolicy/refpolicy/0002-fc-subs-busybox-set-aliases-for-bin-sbin-and-usr.patch b/recipes-security/refpolicy/refpolicy/0002-fc-subs-busybox-set-aliases-for-bin-sbin-and-usr.patch
index e7b69ef..5907c4d 100644
--- a/recipes-security/refpolicy/refpolicy/0002-fc-subs-busybox-set-aliases-for-bin-sbin-and-usr.patch
+++ b/recipes-security/refpolicy/refpolicy/0002-fc-subs-busybox-set-aliases-for-bin-sbin-and-usr.patch
@@ -1,4 +1,4 @@
1From 2a68b7539104bec76aaf2a18b399770f59d0cb28 Mon Sep 17 00:00:00 2001 1From 0ee7bc5f28ffae30b1a1f40edd96cfed993db667 Mon Sep 17 00:00:00 2001
2From: Joe MacDonald <joe_macdonald@mentor.com> 2From: Joe MacDonald <joe_macdonald@mentor.com>
3Date: Thu, 28 Mar 2019 20:48:10 -0400 3Date: Thu, 28 Mar 2019 20:48:10 -0400
4Subject: [PATCH] fc/subs/busybox: set aliases for bin, sbin and usr 4Subject: [PATCH] fc/subs/busybox: set aliases for bin, sbin and usr
@@ -15,10 +15,10 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
15 1 file changed, 6 insertions(+) 15 1 file changed, 6 insertions(+)
16 16
17diff --git a/config/file_contexts.subs_dist b/config/file_contexts.subs_dist 17diff --git a/config/file_contexts.subs_dist b/config/file_contexts.subs_dist
18index aeb25a5bb..c249c5207 100644 18index 652e1dd35..a38d58e16 100644
19--- a/config/file_contexts.subs_dist 19--- a/config/file_contexts.subs_dist
20+++ b/config/file_contexts.subs_dist 20+++ b/config/file_contexts.subs_dist
21@@ -37,3 +37,9 @@ 21@@ -38,3 +38,9 @@
22 # volatile hierarchy. 22 # volatile hierarchy.
23 /var/volatile/log /var/log 23 /var/volatile/log /var/log
24 /var/volatile/tmp /var/tmp 24 /var/volatile/tmp /var/tmp
diff --git a/recipes-security/refpolicy/refpolicy/0002-refpolicy-minimum-enable-nscd_use_shm.patch b/recipes-security/refpolicy/refpolicy/0002-refpolicy-minimum-enable-nscd_use_shm.patch
new file mode 100644
index 0000000..5598c70
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0002-refpolicy-minimum-enable-nscd_use_shm.patch
@@ -0,0 +1,35 @@
1From d71b79cc9b174181934d588f64baa5637c8e85d1 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Fri, 26 Feb 2021 09:13:23 +0800
4Subject: [PATCH] policy/modules/services/nscd: enable nscd_use_shm
5
6Fixes:
7avc: denied { listen } for pid=199 comm="systemd-resolve"
8path="/run/systemd/resolve/io.systemd.Resolve"
9scontext=system_u:system_r:systemd_resolved_t:s0
10tcontext=system_u:system_r:systemd_resolved_t:s0
11tclass=unix_stream_socket permissive=0
12
13Upstream-Status: Inappropriate [embedded specific]
14
15Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
16---
17 policy/modules/services/nscd.te | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-)
19
20diff --git a/policy/modules/services/nscd.te b/policy/modules/services/nscd.te
21index ada67edb1..9801fc228 100644
22--- a/policy/modules/services/nscd.te
23+++ b/policy/modules/services/nscd.te
24@@ -15,7 +15,7 @@ gen_require(`
25 ## can use nscd shared memory.
26 ## </p>
27 ## </desc>
28-gen_tunable(nscd_use_shm, false)
29+gen_tunable(nscd_use_shm, true)
30
31 attribute_role nscd_roles;
32
33--
342.17.1
35
diff --git a/recipes-security/refpolicy/refpolicy/0003-fc-hostname-apply-policy-to-common-yocto-hostname-al.patch b/recipes-security/refpolicy/refpolicy/0003-fc-hostname-apply-policy-to-common-yocto-hostname-al.patch
index d2e650e..db3f9c3 100644
--- a/recipes-security/refpolicy/refpolicy/0003-fc-hostname-apply-policy-to-common-yocto-hostname-al.patch
+++ b/recipes-security/refpolicy/refpolicy/0003-fc-hostname-apply-policy-to-common-yocto-hostname-al.patch
@@ -1,4 +1,4 @@
1From 9f73ec53a4a5d5bb9b7fa453f3089c55f777c2ce Mon Sep 17 00:00:00 2001 1From e0c34d0feb5305b1397f252d698501b641277517 Mon Sep 17 00:00:00 2001
2From: Xin Ouyang <Xin.Ouyang@windriver.com> 2From: Xin Ouyang <Xin.Ouyang@windriver.com>
3Date: Thu, 22 Aug 2013 13:37:23 +0800 3Date: Thu, 22 Aug 2013 13:37:23 +0800
4Subject: [PATCH] fc/hostname: apply policy to common yocto hostname 4Subject: [PATCH] fc/hostname: apply policy to common yocto hostname
diff --git a/recipes-security/refpolicy/refpolicy/0004-fc-bash-apply-usr-bin-bash-context-to-bin-bash.bash.patch b/recipes-security/refpolicy/refpolicy/0004-fc-bash-apply-usr-bin-bash-context-to-bin-bash.bash.patch
index 3c16ac2..4a6d5eb 100644
--- a/recipes-security/refpolicy/refpolicy/0004-fc-bash-apply-usr-bin-bash-context-to-bin-bash.bash.patch
+++ b/recipes-security/refpolicy/refpolicy/0004-fc-bash-apply-usr-bin-bash-context-to-bin-bash.bash.patch
@@ -1,4 +1,4 @@
1From fda1e656c46b360f1023834636c460c5510acf68 Mon Sep 17 00:00:00 2001 1From 8d2c24bc1e2ef8ddf3cf7a08297cfab8a8a92b0d Mon Sep 17 00:00:00 2001
2From: Joe MacDonald <joe_macdonald@mentor.com> 2From: Joe MacDonald <joe_macdonald@mentor.com>
3Date: Thu, 28 Mar 2019 21:37:32 -0400 3Date: Thu, 28 Mar 2019 21:37:32 -0400
4Subject: [PATCH] fc/bash: apply /usr/bin/bash context to /bin/bash.bash 4Subject: [PATCH] fc/bash: apply /usr/bin/bash context to /bin/bash.bash
@@ -15,7 +15,7 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
15 1 file changed, 1 insertion(+) 15 1 file changed, 1 insertion(+)
16 16
17diff --git a/policy/modules/kernel/corecommands.fc b/policy/modules/kernel/corecommands.fc 17diff --git a/policy/modules/kernel/corecommands.fc b/policy/modules/kernel/corecommands.fc
18index b473850d4..7e199b7b0 100644 18index 4c18154ce..9187e50af 100644
19--- a/policy/modules/kernel/corecommands.fc 19--- a/policy/modules/kernel/corecommands.fc
20+++ b/policy/modules/kernel/corecommands.fc 20+++ b/policy/modules/kernel/corecommands.fc
21@@ -142,6 +142,7 @@ ifdef(`distro_gentoo',` 21@@ -142,6 +142,7 @@ ifdef(`distro_gentoo',`
diff --git a/recipes-security/refpolicy/refpolicy/0005-fc-resolv.conf-label-resolv.conf-in-var-run-properly.patch b/recipes-security/refpolicy/refpolicy/0005-fc-resolv.conf-label-resolv.conf-in-var-run-properly.patch
index 2fe6479..cb36ac4 100644
--- a/recipes-security/refpolicy/refpolicy/0005-fc-resolv.conf-label-resolv.conf-in-var-run-properly.patch
+++ b/recipes-security/refpolicy/refpolicy/0005-fc-resolv.conf-label-resolv.conf-in-var-run-properly.patch
@@ -1,4 +1,4 @@
1From 90a9ef3adb997517f921a3524da99c966e3b00df Mon Sep 17 00:00:00 2001 1From 85a77289d193bb3335c78f6d51b4ae2b81249952 Mon Sep 17 00:00:00 2001
2From: Joe MacDonald <joe_macdonald@mentor.com> 2From: Joe MacDonald <joe_macdonald@mentor.com>
3Date: Thu, 4 Apr 2019 10:45:03 -0400 3Date: Thu, 4 Apr 2019 10:45:03 -0400
4Subject: [PATCH] fc/resolv.conf: label resolv.conf in var/run/ properly 4Subject: [PATCH] fc/resolv.conf: label resolv.conf in var/run/ properly
@@ -13,10 +13,10 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
13 1 file changed, 1 insertion(+) 13 1 file changed, 1 insertion(+)
14 14
15diff --git a/policy/modules/system/sysnetwork.fc b/policy/modules/system/sysnetwork.fc 15diff --git a/policy/modules/system/sysnetwork.fc b/policy/modules/system/sysnetwork.fc
16index fddf9f693..acf539656 100644 16index 14505efe9..c9ec4e5ab 100644
17--- a/policy/modules/system/sysnetwork.fc 17--- a/policy/modules/system/sysnetwork.fc
18+++ b/policy/modules/system/sysnetwork.fc 18+++ b/policy/modules/system/sysnetwork.fc
19@@ -83,6 +83,7 @@ ifdef(`distro_redhat',` 19@@ -84,6 +84,7 @@ ifdef(`distro_redhat',`
20 /run/dhcpcd(/.*)? gen_context(system_u:object_r:dhcpc_runtime_t,s0) 20 /run/dhcpcd(/.*)? gen_context(system_u:object_r:dhcpc_runtime_t,s0)
21 /run/netns -d gen_context(system_u:object_r:ifconfig_runtime_t,s0) 21 /run/netns -d gen_context(system_u:object_r:ifconfig_runtime_t,s0)
22 /run/netns/[^/]+ -- <<none>> 22 /run/netns/[^/]+ -- <<none>>
diff --git a/recipes-security/refpolicy/refpolicy/0006-fc-login-apply-login-context-to-login.shadow.patch b/recipes-security/refpolicy/refpolicy/0006-fc-login-apply-login-context-to-login.shadow.patch
index e187b9e..30bbe07 100644
--- a/recipes-security/refpolicy/refpolicy/0006-fc-login-apply-login-context-to-login.shadow.patch
+++ b/recipes-security/refpolicy/refpolicy/0006-fc-login-apply-login-context-to-login.shadow.patch
@@ -1,4 +1,4 @@
1From 3383027dfb8c672468a99805535eeadffbe7d332 Mon Sep 17 00:00:00 2001 1From 253ab75676232be5522fc628b0819d0c48a08c03 Mon Sep 17 00:00:00 2001
2From: Joe MacDonald <joe_macdonald@mentor.com> 2From: Joe MacDonald <joe_macdonald@mentor.com>
3Date: Thu, 28 Mar 2019 21:43:53 -0400 3Date: Thu, 28 Mar 2019 21:43:53 -0400
4Subject: [PATCH] fc/login: apply login context to login.shadow 4Subject: [PATCH] fc/login: apply login context to login.shadow
diff --git a/recipes-security/refpolicy/refpolicy/0007-fc-bind-fix-real-path-for-bind.patch b/recipes-security/refpolicy/refpolicy/0007-fc-bind-fix-real-path-for-bind.patch
index cfd8dfc..351b30e 100644
--- a/recipes-security/refpolicy/refpolicy/0007-fc-bind-fix-real-path-for-bind.patch
+++ b/recipes-security/refpolicy/refpolicy/0007-fc-bind-fix-real-path-for-bind.patch
@@ -1,4 +1,4 @@
1From fcf91092015155c4a10a1d7c4dd352ead0b5698b Mon Sep 17 00:00:00 2001 1From 7e61e5d715451bafd785ec7db01e24e726e31c35 Mon Sep 17 00:00:00 2001
2From: Joe MacDonald <joe_macdonald@mentor.com> 2From: Joe MacDonald <joe_macdonald@mentor.com>
3Date: Thu, 28 Mar 2019 21:58:53 -0400 3Date: Thu, 28 Mar 2019 21:58:53 -0400
4Subject: [PATCH] fc/bind: fix real path for bind 4Subject: [PATCH] fc/bind: fix real path for bind
@@ -13,7 +13,7 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
13 1 file changed, 2 insertions(+) 13 1 file changed, 2 insertions(+)
14 14
15diff --git a/policy/modules/services/bind.fc b/policy/modules/services/bind.fc 15diff --git a/policy/modules/services/bind.fc b/policy/modules/services/bind.fc
16index 7c1df4895..9f87a21a6 100644 16index ce68a0af9..585103eb9 100644
17--- a/policy/modules/services/bind.fc 17--- a/policy/modules/services/bind.fc
18+++ b/policy/modules/services/bind.fc 18+++ b/policy/modules/services/bind.fc
19@@ -1,8 +1,10 @@ 19@@ -1,8 +1,10 @@
diff --git a/recipes-security/refpolicy/refpolicy/0008-fc-hwclock-add-hwclock-alternatives.patch b/recipes-security/refpolicy/refpolicy/0008-fc-hwclock-add-hwclock-alternatives.patch
index 5a09d4b..75c8e7f 100644
--- a/recipes-security/refpolicy/refpolicy/0008-fc-hwclock-add-hwclock-alternatives.patch
+++ b/recipes-security/refpolicy/refpolicy/0008-fc-hwclock-add-hwclock-alternatives.patch
@@ -1,4 +1,4 @@
1From 2e5be9a910fc07a63efafc87a3c10bd81bd9c052 Mon Sep 17 00:00:00 2001 1From c7e69aa036d16a57709684fd2f72959f9a4ac251 Mon Sep 17 00:00:00 2001
2From: Joe MacDonald <joe_macdonald@mentor.com> 2From: Joe MacDonald <joe_macdonald@mentor.com>
3Date: Thu, 28 Mar 2019 21:59:18 -0400 3Date: Thu, 28 Mar 2019 21:59:18 -0400
4Subject: [PATCH] fc/hwclock: add hwclock alternatives 4Subject: [PATCH] fc/hwclock: add hwclock alternatives
diff --git a/recipes-security/refpolicy/refpolicy/0009-fc-dmesg-apply-policy-to-dmesg-alternatives.patch b/recipes-security/refpolicy/refpolicy/0009-fc-dmesg-apply-policy-to-dmesg-alternatives.patch
index cc7eb7c..3c939de 100644
--- a/recipes-security/refpolicy/refpolicy/0009-fc-dmesg-apply-policy-to-dmesg-alternatives.patch
+++ b/recipes-security/refpolicy/refpolicy/0009-fc-dmesg-apply-policy-to-dmesg-alternatives.patch
@@ -1,4 +1,4 @@
1From 924ecc31c140dcd862d067849d4e11e111284165 Mon Sep 17 00:00:00 2001 1From 0fe5ae0d1b5f4268b04ba6c6134324385bb630a2 Mon Sep 17 00:00:00 2001
2From: Joe MacDonald <joe_macdonald@mentor.com> 2From: Joe MacDonald <joe_macdonald@mentor.com>
3Date: Fri, 29 Mar 2019 08:26:55 -0400 3Date: Fri, 29 Mar 2019 08:26:55 -0400
4Subject: [PATCH] fc/dmesg: apply policy to dmesg alternatives 4Subject: [PATCH] fc/dmesg: apply policy to dmesg alternatives
diff --git a/recipes-security/refpolicy/refpolicy/0010-fc-ssh-apply-policy-to-ssh-alternatives.patch b/recipes-security/refpolicy/refpolicy/0010-fc-ssh-apply-policy-to-ssh-alternatives.patch
index 003af92..2a89acc 100644
--- a/recipes-security/refpolicy/refpolicy/0010-fc-ssh-apply-policy-to-ssh-alternatives.patch
+++ b/recipes-security/refpolicy/refpolicy/0010-fc-ssh-apply-policy-to-ssh-alternatives.patch
@@ -1,4 +1,4 @@
1From 261892950c5b2a40b7c3bb050ede148cbd1c7a84 Mon Sep 17 00:00:00 2001 1From e2d9462c5f26dc02f7d547548d8a94bfd79ea88f Mon Sep 17 00:00:00 2001
2From: Joe MacDonald <joe_macdonald@mentor.com> 2From: Joe MacDonald <joe_macdonald@mentor.com>
3Date: Fri, 29 Mar 2019 09:20:58 -0400 3Date: Fri, 29 Mar 2019 09:20:58 -0400
4Subject: [PATCH] fc/ssh: apply policy to ssh alternatives 4Subject: [PATCH] fc/ssh: apply policy to ssh alternatives
diff --git a/recipes-security/refpolicy/refpolicy/0011-fc-sysnetwork-apply-policy-to-ip-alternatives.patch b/recipes-security/refpolicy/refpolicy/0011-fc-sysnetwork-apply-policy-to-ip-alternatives.patch
index aeb63f7..9d7d71c 100644
--- a/recipes-security/refpolicy/refpolicy/0011-fc-sysnetwork-apply-policy-to-ip-alternatives.patch
+++ b/recipes-security/refpolicy/refpolicy/0011-fc-sysnetwork-apply-policy-to-ip-alternatives.patch
@@ -1,4 +1,4 @@
1From bb8832629e85af2a16800f5cfec97ca0bf8319e6 Mon Sep 17 00:00:00 2001 1From dc3edc3b65dccf57d4cb22eb220498c2a5d9685f Mon Sep 17 00:00:00 2001
2From: Xin Ouyang <Xin.Ouyang@windriver.com> 2From: Xin Ouyang <Xin.Ouyang@windriver.com>
3Date: Tue, 9 Jun 2015 21:22:52 +0530 3Date: Tue, 9 Jun 2015 21:22:52 +0530
4Subject: [PATCH] fc/sysnetwork: apply policy to ip alternatives 4Subject: [PATCH] fc/sysnetwork: apply policy to ip alternatives
@@ -14,10 +14,10 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
14 1 file changed, 3 insertions(+) 14 1 file changed, 3 insertions(+)
15 15
16diff --git a/policy/modules/system/sysnetwork.fc b/policy/modules/system/sysnetwork.fc 16diff --git a/policy/modules/system/sysnetwork.fc b/policy/modules/system/sysnetwork.fc
17index acf539656..d8902d725 100644 17index c9ec4e5ab..c3291962d 100644
18--- a/policy/modules/system/sysnetwork.fc 18--- a/policy/modules/system/sysnetwork.fc
19+++ b/policy/modules/system/sysnetwork.fc 19+++ b/policy/modules/system/sysnetwork.fc
20@@ -59,13 +59,16 @@ ifdef(`distro_redhat',` 20@@ -60,13 +60,16 @@ ifdef(`distro_redhat',`
21 /usr/sbin/dhcpcd -- gen_context(system_u:object_r:dhcpc_exec_t,s0) 21 /usr/sbin/dhcpcd -- gen_context(system_u:object_r:dhcpc_exec_t,s0)
22 /usr/sbin/ethtool -- gen_context(system_u:object_r:ifconfig_exec_t,s0) 22 /usr/sbin/ethtool -- gen_context(system_u:object_r:ifconfig_exec_t,s0)
23 /usr/sbin/ifconfig -- gen_context(system_u:object_r:ifconfig_exec_t,s0) 23 /usr/sbin/ifconfig -- gen_context(system_u:object_r:ifconfig_exec_t,s0)
diff --git a/recipes-security/refpolicy/refpolicy/0012-fc-udev-apply-policy-to-udevadm-in-libexec.patch b/recipes-security/refpolicy/refpolicy/0012-fc-udev-apply-policy-to-udevadm-in-libexec.patch
index d1059df..0bb05e3 100644
--- a/recipes-security/refpolicy/refpolicy/0012-fc-udev-apply-policy-to-udevadm-in-libexec.patch
+++ b/recipes-security/refpolicy/refpolicy/0012-fc-udev-apply-policy-to-udevadm-in-libexec.patch
@@ -1,4 +1,4 @@
1From 02a3c7a06f760d3cae909d2c271d1e4fde07c09b Mon Sep 17 00:00:00 2001 1From 9afd44d1300bc858c1569344fc1271e0468edad9 Mon Sep 17 00:00:00 2001
2From: Joe MacDonald <joe_macdonald@mentor.com> 2From: Joe MacDonald <joe_macdonald@mentor.com>
3Date: Fri, 29 Mar 2019 09:36:08 -0400 3Date: Fri, 29 Mar 2019 09:36:08 -0400
4Subject: [PATCH] fc/udev: apply policy to udevadm in libexec 4Subject: [PATCH] fc/udev: apply policy to udevadm in libexec
@@ -12,10 +12,10 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
12 1 file changed, 2 insertions(+) 12 1 file changed, 2 insertions(+)
13 13
14diff --git a/policy/modules/system/udev.fc b/policy/modules/system/udev.fc 14diff --git a/policy/modules/system/udev.fc b/policy/modules/system/udev.fc
15index 0ae7571cd..ceb5b70b3 100644 15index c88189fb7..ad4c0bba2 100644
16--- a/policy/modules/system/udev.fc 16--- a/policy/modules/system/udev.fc
17+++ b/policy/modules/system/udev.fc 17+++ b/policy/modules/system/udev.fc
18@@ -28,6 +28,8 @@ ifdef(`distro_debian',` 18@@ -24,6 +24,8 @@ ifdef(`distro_debian',`
19 /usr/sbin/udevstart -- gen_context(system_u:object_r:udev_exec_t,s0) 19 /usr/sbin/udevstart -- gen_context(system_u:object_r:udev_exec_t,s0)
20 /usr/sbin/wait_for_sysfs -- gen_context(system_u:object_r:udev_exec_t,s0) 20 /usr/sbin/wait_for_sysfs -- gen_context(system_u:object_r:udev_exec_t,s0)
21 21
diff --git a/recipes-security/refpolicy/refpolicy/0013-fc-rpm-apply-rpm_exec-policy-to-cpio-binaries.patch b/recipes-security/refpolicy/refpolicy/0013-fc-rpm-apply-rpm_exec-policy-to-cpio-binaries.patch
index 3e61f45..55f0444 100644
--- a/recipes-security/refpolicy/refpolicy/0013-fc-rpm-apply-rpm_exec-policy-to-cpio-binaries.patch
+++ b/recipes-security/refpolicy/refpolicy/0013-fc-rpm-apply-rpm_exec-policy-to-cpio-binaries.patch
@@ -1,4 +1,4 @@
1From 117884178c9ba63334f732da6f30e67e22aa898e Mon Sep 17 00:00:00 2001 1From 79e58207060c25d5f2484ed164ab74413d00792a Mon Sep 17 00:00:00 2001
2From: Joe MacDonald <joe_macdonald@mentor.com> 2From: Joe MacDonald <joe_macdonald@mentor.com>
3Date: Fri, 29 Mar 2019 09:54:07 -0400 3Date: Fri, 29 Mar 2019 09:54:07 -0400
4Subject: [PATCH] fc/rpm: apply rpm_exec policy to cpio binaries 4Subject: [PATCH] fc/rpm: apply rpm_exec policy to cpio binaries
@@ -12,7 +12,7 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
12 1 file changed, 2 insertions(+) 12 1 file changed, 2 insertions(+)
13 13
14diff --git a/policy/modules/admin/rpm.fc b/policy/modules/admin/rpm.fc 14diff --git a/policy/modules/admin/rpm.fc b/policy/modules/admin/rpm.fc
15index 6194a4833..ace922ac1 100644 15index aaf530c2b..618b18cec 100644
16--- a/policy/modules/admin/rpm.fc 16--- a/policy/modules/admin/rpm.fc
17+++ b/policy/modules/admin/rpm.fc 17+++ b/policy/modules/admin/rpm.fc
18@@ -66,4 +66,6 @@ ifdef(`distro_redhat',` 18@@ -66,4 +66,6 @@ ifdef(`distro_redhat',`
diff --git a/recipes-security/refpolicy/refpolicy/0014-fc-su-apply-policy-to-su-alternatives.patch b/recipes-security/refpolicy/refpolicy/0014-fc-su-apply-policy-to-su-alternatives.patch
index da05686..8d1c9aa 100644
--- a/recipes-security/refpolicy/refpolicy/0014-fc-su-apply-policy-to-su-alternatives.patch
+++ b/recipes-security/refpolicy/refpolicy/0014-fc-su-apply-policy-to-su-alternatives.patch
@@ -1,4 +1,4 @@
1From 522d08c0dac1cfe9e33f06bc1252b7b672d9ffd3 Mon Sep 17 00:00:00 2001 1From a1281be5b894c0c6dc3471a1e6b6c910bab7aa46 Mon Sep 17 00:00:00 2001
2From: Wenzong Fan <wenzong.fan@windriver.com> 2From: Wenzong Fan <wenzong.fan@windriver.com>
3Date: Thu, 13 Feb 2014 00:33:07 -0500 3Date: Thu, 13 Feb 2014 00:33:07 -0500
4Subject: [PATCH] fc/su: apply policy to su alternatives 4Subject: [PATCH] fc/su: apply policy to su alternatives
diff --git a/recipes-security/refpolicy/refpolicy/0015-fc-fstools-fix-real-path-for-fstools.patch b/recipes-security/refpolicy/refpolicy/0015-fc-fstools-fix-real-path-for-fstools.patch
index 78260e5..a9fbe33 100644
--- a/recipes-security/refpolicy/refpolicy/0015-fc-fstools-fix-real-path-for-fstools.patch
+++ b/recipes-security/refpolicy/refpolicy/0015-fc-fstools-fix-real-path-for-fstools.patch
@@ -1,4 +1,4 @@
1From c4b0ffd60873ecca2cf0b1aa898185f5f3928828 Mon Sep 17 00:00:00 2001 1From 02f6557320c60d895397650a59c39708c8e63d27 Mon Sep 17 00:00:00 2001
2From: Wenzong Fan <wenzong.fan@windriver.com> 2From: Wenzong Fan <wenzong.fan@windriver.com>
3Date: Mon, 27 Jan 2014 03:54:01 -0500 3Date: Mon, 27 Jan 2014 03:54:01 -0500
4Subject: [PATCH] fc/fstools: fix real path for fstools 4Subject: [PATCH] fc/fstools: fix real path for fstools
diff --git a/recipes-security/refpolicy/refpolicy/0016-fc-init-fix-update-alternatives-for-sysvinit.patch b/recipes-security/refpolicy/refpolicy/0016-fc-init-fix-update-alternatives-for-sysvinit.patch
index 1a8e8dc..a2e5762 100644
--- a/recipes-security/refpolicy/refpolicy/0016-fc-init-fix-update-alternatives-for-sysvinit.patch
+++ b/recipes-security/refpolicy/refpolicy/0016-fc-init-fix-update-alternatives-for-sysvinit.patch
@@ -1,4 +1,4 @@
1From 95a843719394827621e3b33c13f2696f7e498e5b Mon Sep 17 00:00:00 2001 1From f7860456e3867e6d9c24a7e07bc9e518f65ec478 Mon Sep 17 00:00:00 2001
2From: Xin Ouyang <Xin.Ouyang@windriver.com> 2From: Xin Ouyang <Xin.Ouyang@windriver.com>
3Date: Thu, 22 Aug 2013 13:37:23 +0800 3Date: Thu, 22 Aug 2013 13:37:23 +0800
4Subject: [PATCH] fc/init: fix update-alternatives for sysvinit 4Subject: [PATCH] fc/init: fix update-alternatives for sysvinit
@@ -26,7 +26,7 @@ index bf51c103f..91ed72be0 100644
26 26
27 /run/shutdown\.pid -- gen_context(system_u:object_r:shutdown_runtime_t,s0) 27 /run/shutdown\.pid -- gen_context(system_u:object_r:shutdown_runtime_t,s0)
28diff --git a/policy/modules/kernel/corecommands.fc b/policy/modules/kernel/corecommands.fc 28diff --git a/policy/modules/kernel/corecommands.fc b/policy/modules/kernel/corecommands.fc
29index 7e199b7b0..157eeb0d0 100644 29index 9187e50af..0ecabe34e 100644
30--- a/policy/modules/kernel/corecommands.fc 30--- a/policy/modules/kernel/corecommands.fc
31+++ b/policy/modules/kernel/corecommands.fc 31+++ b/policy/modules/kernel/corecommands.fc
32@@ -151,6 +151,8 @@ ifdef(`distro_gentoo',` 32@@ -151,6 +151,8 @@ ifdef(`distro_gentoo',`
@@ -39,7 +39,7 @@ index 7e199b7b0..157eeb0d0 100644
39 /usr/bin/sash -- gen_context(system_u:object_r:shell_exec_t,s0) 39 /usr/bin/sash -- gen_context(system_u:object_r:shell_exec_t,s0)
40 /usr/bin/sesh -- gen_context(system_u:object_r:shell_exec_t,s0) 40 /usr/bin/sesh -- gen_context(system_u:object_r:shell_exec_t,s0)
41diff --git a/policy/modules/system/init.fc b/policy/modules/system/init.fc 41diff --git a/policy/modules/system/init.fc b/policy/modules/system/init.fc
42index fee6ff3b6..fe72df22a 100644 42index 63cf195e6..5268bddb2 100644
43--- a/policy/modules/system/init.fc 43--- a/policy/modules/system/init.fc
44+++ b/policy/modules/system/init.fc 44+++ b/policy/modules/system/init.fc
45@@ -40,6 +40,7 @@ ifdef(`distro_gentoo',` 45@@ -40,6 +40,7 @@ ifdef(`distro_gentoo',`
diff --git a/recipes-security/refpolicy/refpolicy/0017-fc-brctl-apply-policy-to-brctl-alternatives.patch b/recipes-security/refpolicy/refpolicy/0017-fc-brctl-apply-policy-to-brctl-alternatives.patch
index 6271a88..9da5acc 100644
--- a/recipes-security/refpolicy/refpolicy/0017-fc-brctl-apply-policy-to-brctl-alternatives.patch
+++ b/recipes-security/refpolicy/refpolicy/0017-fc-brctl-apply-policy-to-brctl-alternatives.patch
@@ -1,4 +1,4 @@
1From 0b05d71fea73c9fc0dc8aac6e7d096b0214db5eb Mon Sep 17 00:00:00 2001 1From 3a83de3883d0e287c0b6647e87a93d2cdc48aa10 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Fri, 15 Nov 2019 10:19:54 +0800 3Date: Fri, 15 Nov 2019 10:19:54 +0800
4Subject: [PATCH] fc/brctl: apply policy to brctl alternatives 4Subject: [PATCH] fc/brctl: apply policy to brctl alternatives
diff --git a/recipes-security/refpolicy/refpolicy/0018-fc-corecommands-apply-policy-to-nologin-alternatives.patch b/recipes-security/refpolicy/refpolicy/0018-fc-corecommands-apply-policy-to-nologin-alternatives.patch
index 442c3d8..4c1ac26 100644
--- a/recipes-security/refpolicy/refpolicy/0018-fc-corecommands-apply-policy-to-nologin-alternatives.patch
+++ b/recipes-security/refpolicy/refpolicy/0018-fc-corecommands-apply-policy-to-nologin-alternatives.patch
@@ -1,4 +1,4 @@
1From 5f759c3d89b52e62607266c4e684d66953803d4d Mon Sep 17 00:00:00 2001 1From 5219bc4e0b3147455fecb1485e8387573207070c Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Fri, 15 Nov 2019 10:21:51 +0800 3Date: Fri, 15 Nov 2019 10:21:51 +0800
4Subject: [PATCH] fc/corecommands: apply policy to nologin alternatives 4Subject: [PATCH] fc/corecommands: apply policy to nologin alternatives
@@ -11,10 +11,10 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
11 1 file changed, 2 insertions(+) 11 1 file changed, 2 insertions(+)
12 12
13diff --git a/policy/modules/kernel/corecommands.fc b/policy/modules/kernel/corecommands.fc 13diff --git a/policy/modules/kernel/corecommands.fc b/policy/modules/kernel/corecommands.fc
14index 157eeb0d0..515948ea9 100644 14index 0ecabe34e..e27e701ef 100644
15--- a/policy/modules/kernel/corecommands.fc 15--- a/policy/modules/kernel/corecommands.fc
16+++ b/policy/modules/kernel/corecommands.fc 16+++ b/policy/modules/kernel/corecommands.fc
17@@ -303,6 +303,8 @@ ifdef(`distro_debian',` 17@@ -304,6 +304,8 @@ ifdef(`distro_debian',`
18 /usr/sbin/insmod_ksymoops_clean -- gen_context(system_u:object_r:bin_t,s0) 18 /usr/sbin/insmod_ksymoops_clean -- gen_context(system_u:object_r:bin_t,s0)
19 /usr/sbin/mkfs\.cramfs -- gen_context(system_u:object_r:bin_t,s0) 19 /usr/sbin/mkfs\.cramfs -- gen_context(system_u:object_r:bin_t,s0)
20 /usr/sbin/nologin -- gen_context(system_u:object_r:shell_exec_t,s0) 20 /usr/sbin/nologin -- gen_context(system_u:object_r:shell_exec_t,s0)
diff --git a/recipes-security/refpolicy/refpolicy/0019-fc-locallogin-apply-policy-to-sulogin-alternatives.patch b/recipes-security/refpolicy/refpolicy/0019-fc-locallogin-apply-policy-to-sulogin-alternatives.patch
index 4303d36..acd2663 100644
--- a/recipes-security/refpolicy/refpolicy/0019-fc-locallogin-apply-policy-to-sulogin-alternatives.patch
+++ b/recipes-security/refpolicy/refpolicy/0019-fc-locallogin-apply-policy-to-sulogin-alternatives.patch
@@ -1,4 +1,4 @@
1From 84f715b8d128bcbfdc95adf18d6bc8eb225f05cd Mon Sep 17 00:00:00 2001 1From 2b3b5d43040e939e836ea5c9803f0b27641e50a4 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Fri, 15 Nov 2019 10:43:28 +0800 3Date: Fri, 15 Nov 2019 10:43:28 +0800
4Subject: [PATCH] fc/locallogin: apply policy to sulogin alternatives 4Subject: [PATCH] fc/locallogin: apply policy to sulogin alternatives
diff --git a/recipes-security/refpolicy/refpolicy/0020-fc-ntp-apply-policy-to-ntpd-alternatives.patch b/recipes-security/refpolicy/refpolicy/0020-fc-ntp-apply-policy-to-ntpd-alternatives.patch
index 49c2f82..c40413a 100644
--- a/recipes-security/refpolicy/refpolicy/0020-fc-ntp-apply-policy-to-ntpd-alternatives.patch
+++ b/recipes-security/refpolicy/refpolicy/0020-fc-ntp-apply-policy-to-ntpd-alternatives.patch
@@ -1,4 +1,4 @@
1From b30d9ad872f613d2b1c3aad45eac65593de37b9b Mon Sep 17 00:00:00 2001 1From 5308969204d535391cb766ba5aa4b5479f64248c Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Fri, 15 Nov 2019 10:45:23 +0800 3Date: Fri, 15 Nov 2019 10:45:23 +0800
4Subject: [PATCH] fc/ntp: apply policy to ntpd alternatives 4Subject: [PATCH] fc/ntp: apply policy to ntpd alternatives
diff --git a/recipes-security/refpolicy/refpolicy/0021-fc-kerberos-apply-policy-to-kerberos-alternatives.patch b/recipes-security/refpolicy/refpolicy/0021-fc-kerberos-apply-policy-to-kerberos-alternatives.patch
index 7fe5c8f..8d9ccd8 100644
--- a/recipes-security/refpolicy/refpolicy/0021-fc-kerberos-apply-policy-to-kerberos-alternatives.patch
+++ b/recipes-security/refpolicy/refpolicy/0021-fc-kerberos-apply-policy-to-kerberos-alternatives.patch
@@ -1,4 +1,4 @@
1From 632dcd7a700049a955082bd24af742c2780dcc38 Mon Sep 17 00:00:00 2001 1From 89a54472ea0195ec19c291374e88e55b40107ff8 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Fri, 15 Nov 2019 10:55:05 +0800 3Date: Fri, 15 Nov 2019 10:55:05 +0800
4Subject: [PATCH] fc/kerberos: apply policy to kerberos alternatives 4Subject: [PATCH] fc/kerberos: apply policy to kerberos alternatives
diff --git a/recipes-security/refpolicy/refpolicy/0022-fc-ldap-apply-policy-to-ldap-alternatives.patch b/recipes-security/refpolicy/refpolicy/0022-fc-ldap-apply-policy-to-ldap-alternatives.patch
index c3bcabe..c88dcd9 100644
--- a/recipes-security/refpolicy/refpolicy/0022-fc-ldap-apply-policy-to-ldap-alternatives.patch
+++ b/recipes-security/refpolicy/refpolicy/0022-fc-ldap-apply-policy-to-ldap-alternatives.patch
@@ -1,4 +1,4 @@
1From a580b0154da9dd07369b172ed459046197e388c7 Mon Sep 17 00:00:00 2001 1From 1130a43390bf41adb7747d0cc62c85c4320806cb Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Fri, 15 Nov 2019 11:06:13 +0800 3Date: Fri, 15 Nov 2019 11:06:13 +0800
4Subject: [PATCH] fc/ldap: apply policy to ldap alternatives 4Subject: [PATCH] fc/ldap: apply policy to ldap alternatives
diff --git a/recipes-security/refpolicy/refpolicy/0023-fc-postgresql-apply-policy-to-postgresql-alternative.patch b/recipes-security/refpolicy/refpolicy/0023-fc-postgresql-apply-policy-to-postgresql-alternative.patch
index 0fc608b..ddd78b0 100644
--- a/recipes-security/refpolicy/refpolicy/0023-fc-postgresql-apply-policy-to-postgresql-alternative.patch
+++ b/recipes-security/refpolicy/refpolicy/0023-fc-postgresql-apply-policy-to-postgresql-alternative.patch
@@ -1,4 +1,4 @@
1From 926401518bca5a1e63b7f2c2cbae4a3bc42bf342 Mon Sep 17 00:00:00 2001 1From 184f1dfe4cbff9c5ff2cbe865d4e7427f100ff59 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Fri, 15 Nov 2019 11:13:16 +0800 3Date: Fri, 15 Nov 2019 11:13:16 +0800
4Subject: [PATCH] fc/postgresql: apply policy to postgresql alternatives 4Subject: [PATCH] fc/postgresql: apply policy to postgresql alternatives
diff --git a/recipes-security/refpolicy/refpolicy/0024-fc-screen-apply-policy-to-screen-alternatives.patch b/recipes-security/refpolicy/refpolicy/0024-fc-screen-apply-policy-to-screen-alternatives.patch
index b529bbf..7ae54d9 100644
--- a/recipes-security/refpolicy/refpolicy/0024-fc-screen-apply-policy-to-screen-alternatives.patch
+++ b/recipes-security/refpolicy/refpolicy/0024-fc-screen-apply-policy-to-screen-alternatives.patch
@@ -1,4 +1,4 @@
1From f3f6f0cb4857954afd8a025a1cd3f14b8a11b64d Mon Sep 17 00:00:00 2001 1From e114e09928232dd9eed568a4717dca2094f6e4ad Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Fri, 15 Nov 2019 11:15:33 +0800 3Date: Fri, 15 Nov 2019 11:15:33 +0800
4Subject: [PATCH] fc/screen: apply policy to screen alternatives 4Subject: [PATCH] fc/screen: apply policy to screen alternatives
@@ -11,10 +11,10 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
11 1 file changed, 1 insertion(+) 11 1 file changed, 1 insertion(+)
12 12
13diff --git a/policy/modules/apps/screen.fc b/policy/modules/apps/screen.fc 13diff --git a/policy/modules/apps/screen.fc b/policy/modules/apps/screen.fc
14index 7196c598e..cada9944e 100644 14index e51e01d97..238dc263e 100644
15--- a/policy/modules/apps/screen.fc 15--- a/policy/modules/apps/screen.fc
16+++ b/policy/modules/apps/screen.fc 16+++ b/policy/modules/apps/screen.fc
17@@ -6,4 +6,5 @@ HOME_DIR/\.tmux\.conf -- gen_context(system_u:object_r:screen_home_t,s0) 17@@ -7,4 +7,5 @@ HOME_DIR/\.tmux\.conf -- gen_context(system_u:object_r:screen_home_t,s0)
18 /run/tmux(/.*)? gen_context(system_u:object_r:screen_runtime_t,s0) 18 /run/tmux(/.*)? gen_context(system_u:object_r:screen_runtime_t,s0)
19 19
20 /usr/bin/screen -- gen_context(system_u:object_r:screen_exec_t,s0) 20 /usr/bin/screen -- gen_context(system_u:object_r:screen_exec_t,s0)
diff --git a/recipes-security/refpolicy/refpolicy/0025-fc-usermanage-apply-policy-to-usermanage-alternative.patch b/recipes-security/refpolicy/refpolicy/0025-fc-usermanage-apply-policy-to-usermanage-alternative.patch
index 76278c9..e6fbba0 100644
--- a/recipes-security/refpolicy/refpolicy/0025-fc-usermanage-apply-policy-to-usermanage-alternative.patch
+++ b/recipes-security/refpolicy/refpolicy/0025-fc-usermanage-apply-policy-to-usermanage-alternative.patch
@@ -1,4 +1,4 @@
1From 0656c4b988cb700f322fb03e6639fe0b64e08d63 Mon Sep 17 00:00:00 2001 1From 62a5f9dee28411f1d88a2101e507c15780467b2f Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Fri, 15 Nov 2019 11:25:34 +0800 3Date: Fri, 15 Nov 2019 11:25:34 +0800
4Subject: [PATCH] fc/usermanage: apply policy to usermanage alternatives 4Subject: [PATCH] fc/usermanage: apply policy to usermanage alternatives
diff --git a/recipes-security/refpolicy/refpolicy/0026-fc-getty-add-file-context-to-start_getty.patch b/recipes-security/refpolicy/refpolicy/0026-fc-getty-add-file-context-to-start_getty.patch
index 5f45438..d51faa5 100644
--- a/recipes-security/refpolicy/refpolicy/0026-fc-getty-add-file-context-to-start_getty.patch
+++ b/recipes-security/refpolicy/refpolicy/0026-fc-getty-add-file-context-to-start_getty.patch
@@ -1,4 +1,4 @@
1From cc8da498e20518cc9e8f59d1a4570e073f19e88b Mon Sep 17 00:00:00 2001 1From 7be59b4d42165f7e12ccb8b2409304a2640eb898 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Fri, 15 Nov 2019 16:07:30 +0800 3Date: Fri, 15 Nov 2019 16:07:30 +0800
4Subject: [PATCH] fc/getty: add file context to start_getty 4Subject: [PATCH] fc/getty: add file context to start_getty
diff --git a/recipes-security/refpolicy/refpolicy/0027-fc-init-add-file-context-to-etc-network-if-files.patch b/recipes-security/refpolicy/refpolicy/0027-fc-init-add-file-context-to-etc-network-if-files.patch
index e54777c..e34abe6 100644
--- a/recipes-security/refpolicy/refpolicy/0027-fc-init-add-file-context-to-etc-network-if-files.patch
+++ b/recipes-security/refpolicy/refpolicy/0027-fc-init-add-file-context-to-etc-network-if-files.patch
@@ -1,4 +1,4 @@
1From 1d6f9b62082188992bfb681632dff15d5ad608c9 Mon Sep 17 00:00:00 2001 1From ac335f80d09f9ce4756f2e58944a975a12441fa7 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Tue, 19 Nov 2019 14:33:28 +0800 3Date: Tue, 19 Nov 2019 14:33:28 +0800
4Subject: [PATCH] fc/init: add file context to /etc/network/if-* files 4Subject: [PATCH] fc/init: add file context to /etc/network/if-* files
@@ -11,10 +11,10 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
11 1 file changed, 2 insertions(+), 1 deletion(-) 11 1 file changed, 2 insertions(+), 1 deletion(-)
12 12
13diff --git a/policy/modules/system/init.fc b/policy/modules/system/init.fc 13diff --git a/policy/modules/system/init.fc b/policy/modules/system/init.fc
14index fe72df22a..a9d8f343a 100644 14index 5268bddb2..a6762bd00 100644
15--- a/policy/modules/system/init.fc 15--- a/policy/modules/system/init.fc
16+++ b/policy/modules/system/init.fc 16+++ b/policy/modules/system/init.fc
17@@ -70,11 +70,12 @@ ifdef(`distro_redhat',` 17@@ -75,11 +75,12 @@ ifdef(`distro_redhat',`
18 ifdef(`distro_debian',` 18 ifdef(`distro_debian',`
19 /run/hotkey-setup -- gen_context(system_u:object_r:initrc_runtime_t,s0) 19 /run/hotkey-setup -- gen_context(system_u:object_r:initrc_runtime_t,s0)
20 /run/kdm/.* -- gen_context(system_u:object_r:initrc_runtime_t,s0) 20 /run/kdm/.* -- gen_context(system_u:object_r:initrc_runtime_t,s0)
diff --git a/recipes-security/refpolicy/refpolicy/0028-fc-vlock-apply-policy-to-vlock-alternatives.patch b/recipes-security/refpolicy/refpolicy/0028-fc-vlock-apply-policy-to-vlock-alternatives.patch
index 8017392..d0bd7b4 100644
--- a/recipes-security/refpolicy/refpolicy/0028-fc-vlock-apply-policy-to-vlock-alternatives.patch
+++ b/recipes-security/refpolicy/refpolicy/0028-fc-vlock-apply-policy-to-vlock-alternatives.patch
@@ -1,4 +1,4 @@
1From 8d8858bd8569db106f0feb44a0912daa872954ec Mon Sep 17 00:00:00 2001 1From 1ee2b12fa1585bf765370e3e787081fe01ad990f Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Wed, 18 Dec 2019 15:04:41 +0800 3Date: Wed, 18 Dec 2019 15:04:41 +0800
4Subject: [PATCH] fc/vlock: apply policy to vlock alternatives 4Subject: [PATCH] fc/vlock: apply policy to vlock alternatives
diff --git a/recipes-security/refpolicy/refpolicy/0029-fc-cron-apply-policy-to-etc-init.d-crond.patch b/recipes-security/refpolicy/refpolicy/0029-fc-cron-apply-policy-to-etc-init.d-crond.patch
index 294f999..be57060 100644
--- a/recipes-security/refpolicy/refpolicy/0029-fc-cron-apply-policy-to-etc-init.d-crond.patch
+++ b/recipes-security/refpolicy/refpolicy/0029-fc-cron-apply-policy-to-etc-init.d-crond.patch
@@ -1,4 +1,4 @@
1From 25701662f7149743556bb2d5edb5c69e6de2744f Mon Sep 17 00:00:00 2001 1From a14d7d6fc54e7cf82d977c4b5c2df961c5eb1fe0 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Tue, 30 Jun 2020 10:45:57 +0800 3Date: Tue, 30 Jun 2020 10:45:57 +0800
4Subject: [PATCH] fc/cron: apply policy to /etc/init.d/crond 4Subject: [PATCH] fc/cron: apply policy to /etc/init.d/crond
diff --git a/recipes-security/refpolicy/refpolicy/0081-fc-sysnetwork-update-file-context-for-ifconfig.patch b/recipes-security/refpolicy/refpolicy/0030-fc-sysnetwork-update-file-context-for-ifconfig.patch
index eaecf40..6a659b2 100644
--- a/recipes-security/refpolicy/refpolicy/0081-fc-sysnetwork-update-file-context-for-ifconfig.patch
+++ b/recipes-security/refpolicy/refpolicy/0030-fc-sysnetwork-update-file-context-for-ifconfig.patch
@@ -1,4 +1,4 @@
1From e6b303444988717c725a71db7b21417839321463 Mon Sep 17 00:00:00 2001 1From b3d2611360ddf21a3f8729766a1e4b64117ea710 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Tue, 4 Aug 2020 16:48:12 +0800 3Date: Tue, 4 Aug 2020 16:48:12 +0800
4Subject: [PATCH] fc/sysnetwork: update file context for ifconfig 4Subject: [PATCH] fc/sysnetwork: update file context for ifconfig
@@ -15,10 +15,10 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
15 1 file changed, 1 insertion(+) 15 1 file changed, 1 insertion(+)
16 16
17diff --git a/policy/modules/system/sysnetwork.fc b/policy/modules/system/sysnetwork.fc 17diff --git a/policy/modules/system/sysnetwork.fc b/policy/modules/system/sysnetwork.fc
18index d8902d725..9ec4eefb7 100644 18index c3291962d..4ca151524 100644
19--- a/policy/modules/system/sysnetwork.fc 19--- a/policy/modules/system/sysnetwork.fc
20+++ b/policy/modules/system/sysnetwork.fc 20+++ b/policy/modules/system/sysnetwork.fc
21@@ -43,6 +43,7 @@ ifdef(`distro_redhat',` 21@@ -44,6 +44,7 @@ ifdef(`distro_redhat',`
22 /usr/bin/dhcpcd -- gen_context(system_u:object_r:dhcpc_exec_t,s0) 22 /usr/bin/dhcpcd -- gen_context(system_u:object_r:dhcpc_exec_t,s0)
23 /usr/bin/ethtool -- gen_context(system_u:object_r:ifconfig_exec_t,s0) 23 /usr/bin/ethtool -- gen_context(system_u:object_r:ifconfig_exec_t,s0)
24 /usr/bin/ifconfig -- gen_context(system_u:object_r:ifconfig_exec_t,s0) 24 /usr/bin/ifconfig -- gen_context(system_u:object_r:ifconfig_exec_t,s0)
diff --git a/recipes-security/refpolicy/refpolicy/0030-file_contexts.subs_dist-set-aliase-for-root-director.patch b/recipes-security/refpolicy/refpolicy/0031-file_contexts.subs_dist-set-aliase-for-root-director.patch
index 8331955..f65d1be 100644
--- a/recipes-security/refpolicy/refpolicy/0030-file_contexts.subs_dist-set-aliase-for-root-director.patch
+++ b/recipes-security/refpolicy/refpolicy/0031-file_contexts.subs_dist-set-aliase-for-root-director.patch
@@ -1,4 +1,4 @@
1From 9260b04d257cdddf42d0267456d3ba2b38dc22d4 Mon Sep 17 00:00:00 2001 1From 8c733eff8089c24fe6885977d2bdcdfb0c453726 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Sun, 5 Apr 2020 22:03:45 +0800 3Date: Sun, 5 Apr 2020 22:03:45 +0800
4Subject: [PATCH] file_contexts.subs_dist: set aliase for /root directory 4Subject: [PATCH] file_contexts.subs_dist: set aliase for /root directory
@@ -14,10 +14,10 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
14 1 file changed, 4 insertions(+) 14 1 file changed, 4 insertions(+)
15 15
16diff --git a/config/file_contexts.subs_dist b/config/file_contexts.subs_dist 16diff --git a/config/file_contexts.subs_dist b/config/file_contexts.subs_dist
17index c249c5207..67f476868 100644 17index a38d58e16..3e4c5720f 100644
18--- a/config/file_contexts.subs_dist 18--- a/config/file_contexts.subs_dist
19+++ b/config/file_contexts.subs_dist 19+++ b/config/file_contexts.subs_dist
20@@ -43,3 +43,7 @@ 20@@ -44,3 +44,7 @@
21 /usr/lib/busybox/bin /usr/bin 21 /usr/lib/busybox/bin /usr/bin
22 /usr/lib/busybox/sbin /usr/sbin 22 /usr/lib/busybox/sbin /usr/sbin
23 /usr/lib/busybox/usr /usr 23 /usr/lib/busybox/usr /usr
diff --git a/recipes-security/refpolicy/refpolicy/0031-policy-modules-system-logging-add-rules-for-the-syml.patch b/recipes-security/refpolicy/refpolicy/0032-policy-modules-system-logging-add-rules-for-the-syml.patch
index b05f037..a80bf03 100644
--- a/recipes-security/refpolicy/refpolicy/0031-policy-modules-system-logging-add-rules-for-the-syml.patch
+++ b/recipes-security/refpolicy/refpolicy/0032-policy-modules-system-logging-add-rules-for-the-syml.patch
@@ -1,4 +1,4 @@
1From e4bdbb101fd2af2d4fd8b87794443097b58d20ff Mon Sep 17 00:00:00 2001 1From 456bb92237aa637f506fcc56b190eb534d745e41 Mon Sep 17 00:00:00 2001
2From: Xin Ouyang <Xin.Ouyang@windriver.com> 2From: Xin Ouyang <Xin.Ouyang@windriver.com>
3Date: Thu, 22 Aug 2013 13:37:23 +0800 3Date: Thu, 22 Aug 2013 13:37:23 +0800
4Subject: [PATCH] policy/modules/system/logging: add rules for the symlink of 4Subject: [PATCH] policy/modules/system/logging: add rules for the symlink of
@@ -15,8 +15,7 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
15--- 15---
16 policy/modules/system/logging.fc | 1 + 16 policy/modules/system/logging.fc | 1 +
17 policy/modules/system/logging.if | 9 +++++++++ 17 policy/modules/system/logging.if | 9 +++++++++
18 policy/modules/system/logging.te | 2 ++ 18 2 files changed, 10 insertions(+)
19 3 files changed, 12 insertions(+)
20 19
21diff --git a/policy/modules/system/logging.fc b/policy/modules/system/logging.fc 20diff --git a/policy/modules/system/logging.fc b/policy/modules/system/logging.fc
22index 5681acb51..a4ecd570a 100644 21index 5681acb51..a4ecd570a 100644
@@ -31,10 +30,10 @@ index 5681acb51..a4ecd570a 100644
31 /var/log/dmesg -- gen_context(system_u:object_r:var_log_t,s0) 30 /var/log/dmesg -- gen_context(system_u:object_r:var_log_t,s0)
32 /var/log/syslog -- gen_context(system_u:object_r:var_log_t,s0) 31 /var/log/syslog -- gen_context(system_u:object_r:var_log_t,s0)
33diff --git a/policy/modules/system/logging.if b/policy/modules/system/logging.if 32diff --git a/policy/modules/system/logging.if b/policy/modules/system/logging.if
34index e5f4080ac..e3cbe4f1a 100644 33index 10dee6563..9bb3afdb2 100644
35--- a/policy/modules/system/logging.if 34--- a/policy/modules/system/logging.if
36+++ b/policy/modules/system/logging.if 35+++ b/policy/modules/system/logging.if
37@@ -1066,10 +1066,12 @@ interface(`logging_append_all_inherited_logs',` 36@@ -1065,10 +1065,12 @@ interface(`logging_append_all_inherited_logs',`
38 interface(`logging_read_all_logs',` 37 interface(`logging_read_all_logs',`
39 gen_require(` 38 gen_require(`
40 attribute logfile; 39 attribute logfile;
@@ -47,7 +46,7 @@ index e5f4080ac..e3cbe4f1a 100644
47 read_files_pattern($1, logfile, logfile) 46 read_files_pattern($1, logfile, logfile)
48 ') 47 ')
49 48
50@@ -1088,10 +1090,12 @@ interface(`logging_read_all_logs',` 49@@ -1087,10 +1089,12 @@ interface(`logging_read_all_logs',`
51 interface(`logging_exec_all_logs',` 50 interface(`logging_exec_all_logs',`
52 gen_require(` 51 gen_require(`
53 attribute logfile; 52 attribute logfile;
@@ -60,7 +59,7 @@ index e5f4080ac..e3cbe4f1a 100644
60 can_exec($1, logfile) 59 can_exec($1, logfile)
61 ') 60 ')
62 61
63@@ -1153,6 +1157,7 @@ interface(`logging_manage_generic_log_dirs',` 62@@ -1152,6 +1156,7 @@ interface(`logging_manage_generic_log_dirs',`
64 63
65 files_search_var($1) 64 files_search_var($1)
66 allow $1 var_log_t:dir manage_dir_perms; 65 allow $1 var_log_t:dir manage_dir_perms;
@@ -68,15 +67,15 @@ index e5f4080ac..e3cbe4f1a 100644
68 ') 67 ')
69 68
70 ######################################## 69 ########################################
71@@ -1173,6 +1178,7 @@ interface(`logging_relabel_generic_log_dirs',` 70@@ -1172,6 +1177,7 @@ interface(`logging_relabel_generic_log_dirs',`
72 71
73 files_search_var($1) 72 files_search_var($1)
74 allow $1 var_log_t:dir { relabelfrom relabelto }; 73 allow $1 var_log_t:dir relabel_dir_perms;
75+ allow $1 var_log_t:lnk_file read_lnk_file_perms; 74+ allow $1 var_log_t:lnk_file read_lnk_file_perms;
76 ') 75 ')
77 76
78 ######################################## 77 ########################################
79@@ -1193,6 +1199,7 @@ interface(`logging_read_generic_logs',` 78@@ -1192,6 +1198,7 @@ interface(`logging_read_generic_logs',`
80 79
81 files_search_var($1) 80 files_search_var($1)
82 allow $1 var_log_t:dir list_dir_perms; 81 allow $1 var_log_t:dir list_dir_perms;
@@ -84,7 +83,7 @@ index e5f4080ac..e3cbe4f1a 100644
84 read_files_pattern($1, var_log_t, var_log_t) 83 read_files_pattern($1, var_log_t, var_log_t)
85 ') 84 ')
86 85
87@@ -1294,6 +1301,7 @@ interface(`logging_manage_generic_logs',` 86@@ -1293,6 +1300,7 @@ interface(`logging_manage_generic_logs',`
88 87
89 files_search_var($1) 88 files_search_var($1)
90 manage_files_pattern($1, var_log_t, var_log_t) 89 manage_files_pattern($1, var_log_t, var_log_t)
@@ -92,7 +91,7 @@ index e5f4080ac..e3cbe4f1a 100644
92 ') 91 ')
93 92
94 ######################################## 93 ########################################
95@@ -1312,6 +1320,7 @@ interface(`logging_watch_generic_logs_dir',` 94@@ -1311,6 +1319,7 @@ interface(`logging_watch_generic_logs_dir',`
96 ') 95 ')
97 96
98 allow $1 var_log_t:dir watch; 97 allow $1 var_log_t:dir watch;
@@ -100,26 +99,6 @@ index e5f4080ac..e3cbe4f1a 100644
100 ') 99 ')
101 100
102 ######################################## 101 ########################################
103diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te
104index 3702d441a..513d811ef 100644
105--- a/policy/modules/system/logging.te
106+++ b/policy/modules/system/logging.te
107@@ -161,6 +161,7 @@ manage_files_pattern(auditd_t, auditd_log_t, auditd_log_t)
108 allow auditd_t auditd_log_t:dir setattr;
109 manage_lnk_files_pattern(auditd_t, auditd_log_t, auditd_log_t)
110 allow auditd_t var_log_t:dir search_dir_perms;
111+allow auditd_t var_log_t:lnk_file read_lnk_file_perms;
112
113 manage_files_pattern(auditd_t, auditd_runtime_t, auditd_runtime_t)
114 manage_sock_files_pattern(auditd_t, auditd_runtime_t, auditd_runtime_t)
115@@ -288,6 +289,7 @@ allow audisp_remote_t self:capability { setpcap setuid };
116 allow audisp_remote_t self:process { getcap setcap };
117 allow audisp_remote_t self:tcp_socket create_socket_perms;
118 allow audisp_remote_t var_log_t:dir search_dir_perms;
119+allow audisp_remote_t var_log_t:lnk_file read_lnk_file_perms;
120
121 manage_dirs_pattern(audisp_remote_t, audit_spool_t, audit_spool_t)
122 manage_files_pattern(audisp_remote_t, audit_spool_t, audit_spool_t)
123-- 102--
1242.17.1 1032.17.1
125 104
diff --git a/recipes-security/refpolicy/refpolicy/0033-policy-modules-system-logging-add-domain-rules-for-t.patch b/recipes-security/refpolicy/refpolicy/0033-policy-modules-system-logging-add-domain-rules-for-t.patch
deleted file mode 100644
index 90995dc..0000000
--- a/recipes-security/refpolicy/refpolicy/0033-policy-modules-system-logging-add-domain-rules-for-t.patch
+++ /dev/null
@@ -1,37 +0,0 @@
1From 0385f2374297ab2b8799fe1ec28d12e1682ec074 Mon Sep 17 00:00:00 2001
2From: Xin Ouyang <Xin.Ouyang@windriver.com>
3Date: Fri, 23 Aug 2013 11:20:00 +0800
4Subject: [PATCH] policy/modules/system/logging: add domain rules for the
5 subdir symlinks in /var/
6
7Except /var/log,/var/run,/var/lock, there still other subdir symlinks in
8/var for poky, so we need allow rules for all domains to read these
9symlinks. Domains still need their practical allow rules to read the
10contents, so this is still a secure relax.
11
12Upstream-Status: Inappropriate [embedded specific]
13
14Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
15Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
16Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
17---
18 policy/modules/kernel/domain.te | 3 +++
19 1 file changed, 3 insertions(+)
20
21diff --git a/policy/modules/kernel/domain.te b/policy/modules/kernel/domain.te
22index 4e43a208d..7e5d2b458 100644
23--- a/policy/modules/kernel/domain.te
24+++ b/policy/modules/kernel/domain.te
25@@ -110,6 +110,9 @@ term_use_controlling_term(domain)
26 # list the root directory
27 files_list_root(domain)
28
29+# Yocto/oe-core use some var volatile links
30+files_read_var_symlinks(domain)
31+
32 ifdef(`hide_broken_symptoms',`
33 # This check is in the general socket
34 # listen code, before protocol-specific
35--
362.17.1
37
diff --git a/recipes-security/refpolicy/refpolicy/0032-policy-modules-system-logging-add-rules-for-syslogd-.patch b/recipes-security/refpolicy/refpolicy/0033-policy-modules-system-logging-add-rules-for-syslogd-.patch
index c81bee7..4e5ee51 100644
--- a/recipes-security/refpolicy/refpolicy/0032-policy-modules-system-logging-add-rules-for-syslogd-.patch
+++ b/recipes-security/refpolicy/refpolicy/0033-policy-modules-system-logging-add-rules-for-syslogd-.patch
@@ -1,4 +1,4 @@
1From aaa818cd6d0b1d7a3ad99f911c6c21d5b30b9f49 Mon Sep 17 00:00:00 2001 1From 275597cbb54eb8007c07fc06c3d9bd3d3090f7f2 Mon Sep 17 00:00:00 2001
2From: Joe MacDonald <joe_macdonald@mentor.com> 2From: Joe MacDonald <joe_macdonald@mentor.com>
3Date: Fri, 29 Mar 2019 10:33:18 -0400 3Date: Fri, 29 Mar 2019 10:33:18 -0400
4Subject: [PATCH] policy/modules/system/logging: add rules for syslogd symlink 4Subject: [PATCH] policy/modules/system/logging: add rules for syslogd symlink
@@ -18,10 +18,10 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
18 1 file changed, 1 insertion(+) 18 1 file changed, 1 insertion(+)
19 19
20diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te 20diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te
21index 513d811ef..2d9f65d2d 100644 21index 031e2f40f..673046781 100644
22--- a/policy/modules/system/logging.te 22--- a/policy/modules/system/logging.te
23+++ b/policy/modules/system/logging.te 23+++ b/policy/modules/system/logging.te
24@@ -414,6 +414,7 @@ files_search_spool(syslogd_t) 24@@ -404,6 +404,7 @@ files_search_spool(syslogd_t)
25 25
26 # Allow access for syslog-ng 26 # Allow access for syslog-ng
27 allow syslogd_t var_log_t:dir { create setattr }; 27 allow syslogd_t var_log_t:dir { create setattr };
diff --git a/recipes-security/refpolicy/refpolicy/0034-policy-modules-kernel-files-add-rules-for-the-symlin.patch b/recipes-security/refpolicy/refpolicy/0034-policy-modules-kernel-files-add-rules-for-the-symlin.patch
index 33dc366..da42fdd 100644
--- a/recipes-security/refpolicy/refpolicy/0034-policy-modules-kernel-files-add-rules-for-the-symlin.patch
+++ b/recipes-security/refpolicy/refpolicy/0034-policy-modules-kernel-files-add-rules-for-the-symlin.patch
@@ -1,4 +1,4 @@
1From 3ff1a004b77f44857dadfef3b78a49a55d90c665 Mon Sep 17 00:00:00 2001 1From 491783f2ae026ac969c9f6ef6eea1bd75ac7e2a5 Mon Sep 17 00:00:00 2001
2From: Xin Ouyang <Xin.Ouyang@windriver.com> 2From: Xin Ouyang <Xin.Ouyang@windriver.com>
3Date: Thu, 22 Aug 2013 13:37:23 +0800 3Date: Thu, 22 Aug 2013 13:37:23 +0800
4Subject: [PATCH] policy/modules/kernel/files: add rules for the symlink of 4Subject: [PATCH] policy/modules/kernel/files: add rules for the symlink of
@@ -18,10 +18,10 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
18 2 files changed, 9 insertions(+) 18 2 files changed, 9 insertions(+)
19 19
20diff --git a/policy/modules/kernel/files.fc b/policy/modules/kernel/files.fc 20diff --git a/policy/modules/kernel/files.fc b/policy/modules/kernel/files.fc
21index a3993f5cc..f69900945 100644 21index 826722f4e..677ae96c3 100644
22--- a/policy/modules/kernel/files.fc 22--- a/policy/modules/kernel/files.fc
23+++ b/policy/modules/kernel/files.fc 23+++ b/policy/modules/kernel/files.fc
24@@ -176,6 +176,7 @@ HOME_ROOT/lost\+found/.* <<none>> 24@@ -172,6 +172,7 @@ HOME_ROOT/lost\+found/.* <<none>>
25 # /tmp 25 # /tmp
26 # 26 #
27 /tmp -d gen_context(system_u:object_r:tmp_t,s0-mls_systemhigh) 27 /tmp -d gen_context(system_u:object_r:tmp_t,s0-mls_systemhigh)
@@ -30,10 +30,10 @@ index a3993f5cc..f69900945 100644
30 /tmp/\.journal <<none>> 30 /tmp/\.journal <<none>>
31 31
32diff --git a/policy/modules/kernel/files.if b/policy/modules/kernel/files.if 32diff --git a/policy/modules/kernel/files.if b/policy/modules/kernel/files.if
33index 6a53f886b..ad19738b3 100644 33index 34a9cd66d..7fc7e922f 100644
34--- a/policy/modules/kernel/files.if 34--- a/policy/modules/kernel/files.if
35+++ b/policy/modules/kernel/files.if 35+++ b/policy/modules/kernel/files.if
36@@ -4451,6 +4451,7 @@ interface(`files_search_tmp',` 36@@ -4533,6 +4533,7 @@ interface(`files_search_tmp',`
37 ') 37 ')
38 38
39 allow $1 tmp_t:dir search_dir_perms; 39 allow $1 tmp_t:dir search_dir_perms;
@@ -41,7 +41,7 @@ index 6a53f886b..ad19738b3 100644
41 ') 41 ')
42 42
43 ######################################## 43 ########################################
44@@ -4487,6 +4488,7 @@ interface(`files_list_tmp',` 44@@ -4569,6 +4570,7 @@ interface(`files_list_tmp',`
45 ') 45 ')
46 46
47 allow $1 tmp_t:dir list_dir_perms; 47 allow $1 tmp_t:dir list_dir_perms;
@@ -49,7 +49,7 @@ index 6a53f886b..ad19738b3 100644
49 ') 49 ')
50 50
51 ######################################## 51 ########################################
52@@ -4523,6 +4525,7 @@ interface(`files_delete_tmp_dir_entry',` 52@@ -4605,6 +4607,7 @@ interface(`files_delete_tmp_dir_entry',`
53 ') 53 ')
54 54
55 allow $1 tmp_t:dir del_entry_dir_perms; 55 allow $1 tmp_t:dir del_entry_dir_perms;
@@ -57,7 +57,7 @@ index 6a53f886b..ad19738b3 100644
57 ') 57 ')
58 58
59 ######################################## 59 ########################################
60@@ -4541,6 +4544,7 @@ interface(`files_read_generic_tmp_files',` 60@@ -4623,6 +4626,7 @@ interface(`files_read_generic_tmp_files',`
61 ') 61 ')
62 62
63 read_files_pattern($1, tmp_t, tmp_t) 63 read_files_pattern($1, tmp_t, tmp_t)
@@ -65,7 +65,7 @@ index 6a53f886b..ad19738b3 100644
65 ') 65 ')
66 66
67 ######################################## 67 ########################################
68@@ -4559,6 +4563,7 @@ interface(`files_manage_generic_tmp_dirs',` 68@@ -4641,6 +4645,7 @@ interface(`files_manage_generic_tmp_dirs',`
69 ') 69 ')
70 70
71 manage_dirs_pattern($1, tmp_t, tmp_t) 71 manage_dirs_pattern($1, tmp_t, tmp_t)
@@ -73,7 +73,7 @@ index 6a53f886b..ad19738b3 100644
73 ') 73 ')
74 74
75 ######################################## 75 ########################################
76@@ -4577,6 +4582,7 @@ interface(`files_manage_generic_tmp_files',` 76@@ -4659,6 +4664,7 @@ interface(`files_manage_generic_tmp_files',`
77 ') 77 ')
78 78
79 manage_files_pattern($1, tmp_t, tmp_t) 79 manage_files_pattern($1, tmp_t, tmp_t)
@@ -81,7 +81,7 @@ index 6a53f886b..ad19738b3 100644
81 ') 81 ')
82 82
83 ######################################## 83 ########################################
84@@ -4613,6 +4619,7 @@ interface(`files_rw_generic_tmp_sockets',` 84@@ -4695,6 +4701,7 @@ interface(`files_rw_generic_tmp_sockets',`
85 ') 85 ')
86 86
87 rw_sock_files_pattern($1, tmp_t, tmp_t) 87 rw_sock_files_pattern($1, tmp_t, tmp_t)
@@ -89,7 +89,7 @@ index 6a53f886b..ad19738b3 100644
89 ') 89 ')
90 90
91 ######################################## 91 ########################################
92@@ -4820,6 +4827,7 @@ interface(`files_tmp_filetrans',` 92@@ -4902,6 +4909,7 @@ interface(`files_tmp_filetrans',`
93 ') 93 ')
94 94
95 filetrans_pattern($1, tmp_t, $2, $3, $4) 95 filetrans_pattern($1, tmp_t, $2, $3, $4)
diff --git a/recipes-security/refpolicy/refpolicy/0035-policy-modules-kernel-terminal-add-rules-for-bsdpty_.patch b/recipes-security/refpolicy/refpolicy/0035-policy-modules-kernel-terminal-add-rules-for-bsdpty_.patch
deleted file mode 100644
index c6fb34f..0000000
--- a/recipes-security/refpolicy/refpolicy/0035-policy-modules-kernel-terminal-add-rules-for-bsdpty_.patch
+++ /dev/null
@@ -1,124 +0,0 @@
1From cc8505dc9613a98ee8215854ece31a4aca103e8d Mon Sep 17 00:00:00 2001
2From: Xin Ouyang <Xin.Ouyang@windriver.com>
3Date: Thu, 22 Aug 2013 13:37:23 +0800
4Subject: [PATCH] policy/modules/kernel/terminal: add rules for bsdpty_device_t
5 to complete pty devices
6
7Upstream-Status: Inappropriate [embedded specific]
8
9Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
10Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
11Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
12---
13 policy/modules/kernel/terminal.if | 16 ++++++++++++++++
14 1 file changed, 16 insertions(+)
15
16diff --git a/policy/modules/kernel/terminal.if b/policy/modules/kernel/terminal.if
17index 4bd4884f8..f70e51525 100644
18--- a/policy/modules/kernel/terminal.if
19+++ b/policy/modules/kernel/terminal.if
20@@ -623,9 +623,11 @@ interface(`term_getattr_generic_ptys',`
21 interface(`term_dontaudit_getattr_generic_ptys',`
22 gen_require(`
23 type devpts_t;
24+ type bsdpty_device_t;
25 ')
26
27 dontaudit $1 devpts_t:chr_file getattr;
28+ dontaudit $1 bsdpty_device_t:chr_file getattr;
29 ')
30 ########################################
31 ## <summary>
32@@ -641,11 +643,13 @@ interface(`term_dontaudit_getattr_generic_ptys',`
33 interface(`term_ioctl_generic_ptys',`
34 gen_require(`
35 type devpts_t;
36+ type bsdpty_device_t;
37 ')
38
39 dev_list_all_dev_nodes($1)
40 allow $1 devpts_t:dir search;
41 allow $1 devpts_t:chr_file ioctl;
42+ allow $1 bsdpty_device_t:chr_file ioctl;
43 ')
44
45 ########################################
46@@ -663,9 +667,11 @@ interface(`term_ioctl_generic_ptys',`
47 interface(`term_setattr_generic_ptys',`
48 gen_require(`
49 type devpts_t;
50+ type bsdpty_device_t;
51 ')
52
53 allow $1 devpts_t:chr_file setattr;
54+ allow $1 bsdpty_device_t:chr_file setattr;
55 ')
56
57 ########################################
58@@ -683,9 +689,11 @@ interface(`term_setattr_generic_ptys',`
59 interface(`term_dontaudit_setattr_generic_ptys',`
60 gen_require(`
61 type devpts_t;
62+ type bsdpty_device_t;
63 ')
64
65 dontaudit $1 devpts_t:chr_file setattr;
66+ dontaudit $1 bsdpty_device_t:chr_file setattr;
67 ')
68
69 ########################################
70@@ -703,11 +711,13 @@ interface(`term_dontaudit_setattr_generic_ptys',`
71 interface(`term_use_generic_ptys',`
72 gen_require(`
73 type devpts_t;
74+ type bsdpty_device_t;
75 ')
76
77 dev_list_all_dev_nodes($1)
78 allow $1 devpts_t:dir list_dir_perms;
79 allow $1 devpts_t:chr_file { rw_term_perms lock append };
80+ allow $1 bsdpty_device_t:chr_file { rw_term_perms lock append };
81 ')
82
83 ########################################
84@@ -725,9 +735,11 @@ interface(`term_use_generic_ptys',`
85 interface(`term_dontaudit_use_generic_ptys',`
86 gen_require(`
87 type devpts_t;
88+ type bsdpty_device_t;
89 ')
90
91 dontaudit $1 devpts_t:chr_file { getattr read write ioctl };
92+ dontaudit $1 bsdpty_device_t:chr_file { getattr read write ioctl };
93 ')
94
95 #######################################
96@@ -764,10 +776,12 @@ interface(`term_create_controlling_term',`
97 interface(`term_setattr_controlling_term',`
98 gen_require(`
99 type devtty_t;
100+ type bsdpty_device_t;
101 ')
102
103 dev_list_all_dev_nodes($1)
104 allow $1 devtty_t:chr_file setattr;
105+ allow $1 bsdpty_device_t:chr_file setattr;
106 ')
107
108 ########################################
109@@ -784,10 +798,12 @@ interface(`term_setattr_controlling_term',`
110 interface(`term_use_controlling_term',`
111 gen_require(`
112 type devtty_t;
113+ type bsdpty_device_t;
114 ')
115
116 dev_list_all_dev_nodes($1)
117 allow $1 devtty_t:chr_file { rw_term_perms lock append };
118+ allow $1 bsdpty_device_t:chr_file { rw_term_perms lock append };
119 ')
120
121 #######################################
122--
1232.17.1
124
diff --git a/recipes-security/refpolicy/refpolicy/0035-policy-modules-system-logging-fix-auditd-startup-fai.patch b/recipes-security/refpolicy/refpolicy/0035-policy-modules-system-logging-fix-auditd-startup-fai.patch
new file mode 100644
index 0000000..9856fcd
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0035-policy-modules-system-logging-fix-auditd-startup-fai.patch
@@ -0,0 +1,64 @@
1From 25036d5f5c41e4215d071d9c1eb77760a0eca87c Mon Sep 17 00:00:00 2001
2From: Xin Ouyang <Xin.Ouyang@windriver.com>
3Date: Thu, 22 Aug 2013 13:37:23 +0800
4Subject: [PATCH] policy/modules/system/logging: fix auditd startup failures
5
6Fixes:
7avc: denied { getattr } for pid=322 comm="auditd"
8path="/sbin/audisp-remote" dev="vda" ino=1115
9scontext=system_u:system_r:auditd_t
10tcontext=system_u:object_r:audisp_remote_exec_t tclass=file permissive=0
11
12avc: denied { read } for pid=321 comm="auditd" name="log" dev="vda"
13ino=12552 scontext=system_u:system_r:auditd_t
14tcontext=system_u:object_r:var_log_t tclass=lnk_file permissive=0
15
16avc: denied { getattr } for pid=183 comm="auditctl" name="/"
17dev="proc" ino=1 scontext=system_u:system_r:auditctl_t
18tcontext=system_u:object_r:proc_t tclass=filesystem permissive=0
19
20Upstream-Status: Inappropriate [embedded specific]
21
22Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
23Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
24---
25 policy/modules/system/logging.te | 5 +++++
26 1 file changed, 5 insertions(+)
27
28diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te
29index 673046781..9b3254f63 100644
30--- a/policy/modules/system/logging.te
31+++ b/policy/modules/system/logging.te
32@@ -117,6 +117,7 @@ files_read_etc_files(auditctl_t)
33 kernel_read_kernel_sysctls(auditctl_t)
34 kernel_read_proc_symlinks(auditctl_t)
35 kernel_setsched(auditctl_t)
36+kernel_getattr_proc(auditctl_t)
37
38 domain_read_all_domains_state(auditctl_t)
39 domain_use_interactive_fds(auditctl_t)
40@@ -157,10 +158,13 @@ allow auditd_t auditd_etc_t:dir list_dir_perms;
41 allow auditd_t auditd_etc_t:file read_file_perms;
42 dontaudit auditd_t auditd_etc_t:file map;
43
44+allow auditd_t audisp_remote_exec_t:file getattr;
45+
46 manage_files_pattern(auditd_t, auditd_log_t, auditd_log_t)
47 allow auditd_t auditd_log_t:dir setattr;
48 manage_lnk_files_pattern(auditd_t, auditd_log_t, auditd_log_t)
49 allow auditd_t var_log_t:dir search_dir_perms;
50+allow auditd_t var_log_t:lnk_file read_lnk_file_perms;
51
52 manage_files_pattern(auditd_t, auditd_runtime_t, auditd_runtime_t)
53 manage_sock_files_pattern(auditd_t, auditd_runtime_t, auditd_runtime_t)
54@@ -284,6 +288,7 @@ allow audisp_remote_t self:capability { setpcap setuid };
55 allow audisp_remote_t self:process { getcap setcap };
56 allow audisp_remote_t self:tcp_socket create_socket_perms;
57 allow audisp_remote_t var_log_t:dir search_dir_perms;
58+allow audisp_remote_t var_log_t:lnk_file read_lnk_file_perms;
59
60 manage_dirs_pattern(audisp_remote_t, audit_spool_t, audit_spool_t)
61 manage_files_pattern(audisp_remote_t, audit_spool_t, audit_spool_t)
62--
632.17.1
64
diff --git a/recipes-security/refpolicy/refpolicy/0036-policy-modules-kernel-terminal-don-t-audit-tty_devic.patch b/recipes-security/refpolicy/refpolicy/0036-policy-modules-kernel-terminal-don-t-audit-tty_devic.patch
index cc018fa..855aae6 100644
--- a/recipes-security/refpolicy/refpolicy/0036-policy-modules-kernel-terminal-don-t-audit-tty_devic.patch
+++ b/recipes-security/refpolicy/refpolicy/0036-policy-modules-kernel-terminal-don-t-audit-tty_devic.patch
@@ -1,4 +1,4 @@
1From a9aebca531f52818fe77b9b21f0cad425da78e43 Mon Sep 17 00:00:00 2001 1From 15773d54215587284f937b9a37b08c682949e7ab Mon Sep 17 00:00:00 2001
2From: Xin Ouyang <Xin.Ouyang@windriver.com> 2From: Xin Ouyang <Xin.Ouyang@windriver.com>
3Date: Thu, 22 Aug 2013 13:37:23 +0800 3Date: Thu, 22 Aug 2013 13:37:23 +0800
4Subject: [PATCH] policy/modules/kernel/terminal: don't audit tty_device_t in 4Subject: [PATCH] policy/modules/kernel/terminal: don't audit tty_device_t in
@@ -17,7 +17,7 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
17 1 file changed, 3 insertions(+) 17 1 file changed, 3 insertions(+)
18 18
19diff --git a/policy/modules/kernel/terminal.if b/policy/modules/kernel/terminal.if 19diff --git a/policy/modules/kernel/terminal.if b/policy/modules/kernel/terminal.if
20index f70e51525..8f9578dbc 100644 20index 55c18dffb..e8c0735eb 100644
21--- a/policy/modules/kernel/terminal.if 21--- a/policy/modules/kernel/terminal.if
22+++ b/policy/modules/kernel/terminal.if 22+++ b/policy/modules/kernel/terminal.if
23@@ -335,9 +335,12 @@ interface(`term_use_console',` 23@@ -335,9 +335,12 @@ interface(`term_use_console',`
diff --git a/recipes-security/refpolicy/refpolicy/0037-policy-modules-system-modutils-allow-mod_t-to-access.patch b/recipes-security/refpolicy/refpolicy/0037-policy-modules-system-modutils-allow-mod_t-to-access.patch
new file mode 100644
index 0000000..da03017
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0037-policy-modules-system-modutils-allow-mod_t-to-access.patch
@@ -0,0 +1,67 @@
1From 1126ee6883d7e107b103a18d255416d542ca50f2 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Mon, 24 Aug 2020 11:29:09 +0800
4Subject: [PATCH] policy/modules/system/modutils: allow mod_t to access
5 confidentiality of class lockdown
6
7The SELinux lockdown implementation was introduced since kernel 5.6 by
8commit 59438b46471ae6cdfb761afc8c9beaf1e428a331. We need to allow mod_t
9and udev_t to access confidentiality of class lockdown to mount tracefs.
10
11Fixes:
12kernel: Could not create tracefs 'iwlwifi_data/filter' entry
13kernel: Could not create tracefs 'enable' entry
14kernel: Could not create tracefs 'id' entry
15kernel: Could not create tracefs 'filter' entry
16kernel: Could not create tracefs 'trigger' entry
17kernel: Could not create tracefs 'format' entry
18
19audit[170]: AVC avc: denied { confidentiality } for pid=170
20comm="modprobe" lockdown_reason="use of tracefs"
21scontext=system_u:system_r:kmod_t:s15:c0.c1023
22tcontext=system_u:system_r:kmod_t:s15:c0.c1023 tclass=lockdown
23permissive=0
24
25audit[190]: AVC avc: denied { confidentiality } for pid=190
26comm="systemd-udevd" lockdown_reason="use of tracefs"
27scontext=system_u:system_r:udev_t:s0-s15:c0.c1023
28tcontext=system_u:system_r:udev_t:s0-s15:c0.c1023 tclass=lockdown
29permissive=0
30
31Upstream-Status: Inappropriate [embedded specific]
32
33Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
34---
35 policy/modules/system/modutils.te | 2 ++
36 policy/modules/system/udev.te | 2 ++
37 2 files changed, 4 insertions(+)
38
39diff --git a/policy/modules/system/modutils.te b/policy/modules/system/modutils.te
40index ef5de835e..ee249ae04 100644
41--- a/policy/modules/system/modutils.te
42+++ b/policy/modules/system/modutils.te
43@@ -41,6 +41,8 @@ dontaudit kmod_t self:capability sys_admin;
44 allow kmod_t self:udp_socket create_socket_perms;
45 allow kmod_t self:rawip_socket create_socket_perms;
46
47+allow kmod_t self:lockdown confidentiality;
48+
49 # Read module config and dependency information
50 list_dirs_pattern(kmod_t, modules_conf_t, modules_conf_t)
51 read_files_pattern(kmod_t, modules_conf_t, modules_conf_t)
52diff --git a/policy/modules/system/udev.te b/policy/modules/system/udev.te
53index 4a2283b6c..daf64482f 100644
54--- a/policy/modules/system/udev.te
55+++ b/policy/modules/system/udev.te
56@@ -61,6 +61,8 @@ allow udev_t self:rawip_socket create_socket_perms;
57 # for systemd-udevd to rename interfaces
58 allow udev_t self:netlink_route_socket nlmsg_write;
59
60+allow udev_t self:lockdown confidentiality;
61+
62 can_exec(udev_t, udev_exec_t)
63
64 allow udev_t udev_helper_exec_t:dir list_dir_perms;
65--
662.17.1
67
diff --git a/recipes-security/refpolicy/refpolicy/0037-policy-modules-services-avahi-allow-avahi_t-to-watch.patch b/recipes-security/refpolicy/refpolicy/0038-policy-modules-services-avahi-allow-avahi_t-to-watch.patch
index 52887e5..1b0391d 100644
--- a/recipes-security/refpolicy/refpolicy/0037-policy-modules-services-avahi-allow-avahi_t-to-watch.patch
+++ b/recipes-security/refpolicy/refpolicy/0038-policy-modules-services-avahi-allow-avahi_t-to-watch.patch
@@ -1,8 +1,8 @@
1From 4316f85adb1ab6e0278fb8e8ff68b358f36a933e Mon Sep 17 00:00:00 2001 1From 92571e7c066b3d91634a4c1f55542cb528f5bac4 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Tue, 23 Jun 2020 08:19:16 +0800 3Date: Tue, 23 Jun 2020 08:19:16 +0800
4Subject: [PATCH] policy/modules/services/avahi: allow avahi_t to watch /etc 4Subject: [PATCH] policy/modules/services/avahi: allow avahi_t to watch
5 directory 5 /etc/avahi directory
6 6
7Fixes: 7Fixes:
8type=AVC msg=audit(1592813140.176:24): avc: denied { watch } for 8type=AVC msg=audit(1592813140.176:24): avc: denied { watch } for
@@ -18,7 +18,7 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
18 1 file changed, 1 insertion(+) 18 1 file changed, 1 insertion(+)
19 19
20diff --git a/policy/modules/services/avahi.te b/policy/modules/services/avahi.te 20diff --git a/policy/modules/services/avahi.te b/policy/modules/services/avahi.te
21index f77e5546d..5643349e3 100644 21index af838d8b0..674cdcb81 100644
22--- a/policy/modules/services/avahi.te 22--- a/policy/modules/services/avahi.te
23+++ b/policy/modules/services/avahi.te 23+++ b/policy/modules/services/avahi.te
24@@ -76,6 +76,7 @@ domain_use_interactive_fds(avahi_t) 24@@ -76,6 +76,7 @@ domain_use_interactive_fds(avahi_t)
diff --git a/recipes-security/refpolicy/refpolicy/0038-policy-modules-system-getty-allow-getty_t-watch-gett.patch b/recipes-security/refpolicy/refpolicy/0038-policy-modules-system-getty-allow-getty_t-watch-gett.patch
deleted file mode 100644
index 3be2cdc..0000000
--- a/recipes-security/refpolicy/refpolicy/0038-policy-modules-system-getty-allow-getty_t-watch-gett.patch
+++ /dev/null
@@ -1,42 +0,0 @@
1From 383a70a87049ef5065bba4c2c4d4bc3cff914358 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Tue, 23 Jun 2020 08:39:44 +0800
4Subject: [PATCH] policy/modules/system/getty: allow getty_t watch
5 getty_runtime_t file
6
7Fixes:
8type=AVC msg=audit(1592813140.280:26): avc: denied { watch } for
9pid=385 comm="getty" path="/run/agetty.reload" dev="tmpfs" ino=12247
10scontext=system_u:system_r:getty_t
11tcontext=system_u:object_r:getty_runtime_t tclass=file permissive=1
12
13Upstream-Status: Inappropriate [embedded specific]
14
15Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
16---
17 policy/modules/system/getty.te | 2 ++
18 1 file changed, 2 insertions(+)
19
20diff --git a/policy/modules/system/getty.te b/policy/modules/system/getty.te
21index f5316c30a..39e27e5f1 100644
22--- a/policy/modules/system/getty.te
23+++ b/policy/modules/system/getty.te
24@@ -47,6 +47,7 @@ allow getty_t getty_log_t:file { append_file_perms create_file_perms setattr_fil
25 logging_log_filetrans(getty_t, getty_log_t, file)
26
27 allow getty_t getty_runtime_t:dir watch;
28+allow getty_t getty_runtime_t:file watch;
29 manage_files_pattern(getty_t, getty_runtime_t, getty_runtime_t)
30 files_runtime_filetrans(getty_t, getty_runtime_t, file)
31
32@@ -65,6 +66,7 @@ dev_read_sysfs(getty_t)
33 files_read_etc_runtime_files(getty_t)
34 files_read_etc_files(getty_t)
35 files_search_spool(getty_t)
36+fs_search_tmpfs(getty_t)
37
38 fs_search_auto_mountpoints(getty_t)
39 # for error condition handling
40--
412.17.1
42
diff --git a/recipes-security/refpolicy/refpolicy/0039-policy-modules-services-bluetooth-allow-bluetooth_t-.patch b/recipes-security/refpolicy/refpolicy/0039-policy-modules-services-bluetooth-allow-bluetooth_t-.patch
deleted file mode 100644
index 39e72e8..0000000
--- a/recipes-security/refpolicy/refpolicy/0039-policy-modules-services-bluetooth-allow-bluetooth_t-.patch
+++ /dev/null
@@ -1,65 +0,0 @@
1From dfc3e78dfee0709bcbfc2d1959e5b7c27922b1b7 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Tue, 23 Jun 2020 08:54:20 +0800
4Subject: [PATCH] policy/modules/services/bluetooth: allow bluetooth_t to
5 create and use bluetooth_socket
6
7Fixes:
8type=AVC msg=audit(1592813138.485:17): avc: denied { create } for
9pid=324 comm="bluetoothd" scontext=system_u:system_r:bluetooth_t
10tcontext=system_u:system_r:bluetooth_t tclass=bluetooth_socket
11permissive=1
12type=AVC msg=audit(1592813138.485:18): avc: denied { bind } for
13pid=324 comm="bluetoothd" scontext=system_u:system_r:bluetooth_t
14tcontext=system_u:system_r:bluetooth_t tclass=bluetooth_socket
15permissive=1
16type=AVC msg=audit(1592813138.485:19): avc: denied { write } for
17pid=324 comm="bluetoothd" scontext=system_u:system_r:bluetooth_t
18tcontext=system_u:system_r:bluetooth_t tclass=bluetooth_socket
19permissive=1
20type=AVC msg=audit(1592813138.488:20): avc: denied { getattr } for
21pid=324 comm="bluetoothd" path="socket:[11771]" dev="sockfs" ino=11771
22scontext=system_u:system_r:bluetooth_t
23tcontext=system_u:system_r:bluetooth_t tclass=bluetooth_socket
24permissive=1
25type=AVC msg=audit(1592813138.488:21): avc: denied { listen } for
26pid=324 comm="bluetoothd" scontext=system_u:system_r:bluetooth_t
27tcontext=system_u:system_r:bluetooth_t tclass=bluetooth_socket
28permissive=1
29type=AVC msg=audit(1592813138.498:22): avc: denied { read } for
30pid=324 comm="bluetoothd" path="socket:[11771]" dev="sockfs" ino=11771
31scontext=system_u:system_r:bluetooth_t
32tcontext=system_u:system_r:bluetooth_t tclass=bluetooth_socket
33permissive=1
34
35Upstream-Status: Inappropriate [embedded specific]
36
37Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
38---
39 policy/modules/services/bluetooth.te | 3 +++
40 1 file changed, 3 insertions(+)
41
42diff --git a/policy/modules/services/bluetooth.te b/policy/modules/services/bluetooth.te
43index 025eff444..63e50aeda 100644
44--- a/policy/modules/services/bluetooth.te
45+++ b/policy/modules/services/bluetooth.te
46@@ -60,6 +60,7 @@ allow bluetooth_t self:socket create_stream_socket_perms;
47 allow bluetooth_t self:unix_stream_socket { accept connectto listen };
48 allow bluetooth_t self:tcp_socket { accept listen };
49 allow bluetooth_t self:netlink_kobject_uevent_socket create_socket_perms;
50+allow bluetooth_t self:bluetooth_socket create_stream_socket_perms;
51
52 read_files_pattern(bluetooth_t, bluetooth_conf_t, bluetooth_conf_t)
53
54@@ -127,6 +128,8 @@ userdom_dontaudit_use_unpriv_user_fds(bluetooth_t)
55 userdom_dontaudit_use_user_terminals(bluetooth_t)
56 userdom_dontaudit_search_user_home_dirs(bluetooth_t)
57
58+init_dbus_send_script(bluetooth_t)
59+
60 optional_policy(`
61 dbus_system_bus_client(bluetooth_t)
62 dbus_connect_system_bus(bluetooth_t)
63--
642.17.1
65
diff --git a/recipes-security/refpolicy/refpolicy/0039-policy-modules-system-getty-allow-getty_t-to-search-.patch b/recipes-security/refpolicy/refpolicy/0039-policy-modules-system-getty-allow-getty_t-to-search-.patch
new file mode 100644
index 0000000..d673d54
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0039-policy-modules-system-getty-allow-getty_t-to-search-.patch
@@ -0,0 +1,32 @@
1From f23178d9d89bf39895f75867c29bda4dfb27e786 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Tue, 23 Jun 2020 08:39:44 +0800
4Subject: [PATCH] policy/modules/system/getty: allow getty_t to search tmpfs
5
6Fixes:
7avc: denied { search } for pid=211 comm="agetty" name="/" dev="tmpfs"
8ino=1 scontext=system_u:system_r:getty_t
9tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=0
10
11Upstream-Status: Inappropriate [embedded specific]
12
13Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
14---
15 policy/modules/system/getty.te | 1 +
16 1 file changed, 1 insertion(+)
17
18diff --git a/policy/modules/system/getty.te b/policy/modules/system/getty.te
19index 95b1ec632..0415e1ee7 100644
20--- a/policy/modules/system/getty.te
21+++ b/policy/modules/system/getty.te
22@@ -66,6 +66,7 @@ dev_read_sysfs(getty_t)
23 files_read_etc_runtime_files(getty_t)
24 files_read_etc_files(getty_t)
25 files_search_spool(getty_t)
26+fs_search_tmpfs(getty_t)
27
28 fs_search_auto_mountpoints(getty_t)
29 # for error condition handling
30--
312.17.1
32
diff --git a/recipes-security/refpolicy/refpolicy/0040-policy-modules-services-bluetooth-fix-bluetoothd-sta.patch b/recipes-security/refpolicy/refpolicy/0040-policy-modules-services-bluetooth-fix-bluetoothd-sta.patch
new file mode 100644
index 0000000..8532a24
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0040-policy-modules-services-bluetooth-fix-bluetoothd-sta.patch
@@ -0,0 +1,88 @@
1From 21c60a1ed37aef0427dbd49f602896b09b875bca Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Tue, 23 Jun 2020 08:54:20 +0800
4Subject: [PATCH] policy/modules/services/bluetooth: fix bluetoothd startup
5 failures
6
7* Allow bluetooth_t to create and use bluetooth_socket
8* Allow bluetooth_t to create alg_socket
9* Allow bluetooth_t to send and receive messages from systemd hostnamed
10 over dbus
11
12Fixes:
13avc: denied { create } for pid=324 comm="bluetoothd"
14scontext=system_u:system_r:bluetooth_t
15tcontext=system_u:system_r:bluetooth_t tclass=bluetooth_socket
16permissive=0
17
18avc: denied { bind } for pid=324 comm="bluetoothd"
19scontext=system_u:system_r:bluetooth_t
20tcontext=system_u:system_r:bluetooth_t tclass=bluetooth_socket
21permissive=0
22
23avc: denied { write } for pid=324 comm="bluetoothd"
24scontext=system_u:system_r:bluetooth_t
25tcontext=system_u:system_r:bluetooth_t tclass=bluetooth_socket
26permissive=0
27
28avc: denied { getattr } for pid=324 comm="bluetoothd"
29path="socket:[11771]" dev="sockfs" ino=11771
30scontext=system_u:system_r:bluetooth_t
31tcontext=system_u:system_r:bluetooth_t tclass=bluetooth_socket
32permissive=0
33
34avc: denied { listen } for pid=324 comm="bluetoothd"
35scontext=system_u:system_r:bluetooth_t
36tcontext=system_u:system_r:bluetooth_t tclass=bluetooth_socket
37permissive=0
38
39avc: denied { read } for pid=324 comm="bluetoothd" path="socket:[11771]"
40dev="sockfs" ino=11771 scontext=system_u:system_r:bluetooth_t
41tcontext=system_u:system_r:bluetooth_t tclass=bluetooth_socket
42permissive=0
43
44avc: denied { create } for pid=268 comm="bluetoothd"
45scontext=system_u:system_r:bluetooth_t:s0-s15:c0.c1023
46tcontext=system_u:system_r:bluetooth_t:s0-s15:c0.c1023 tclass=alg_socket
47permissive=0
48
49avc: denied { send_msg } for msgtype=method_call
50interface=org.freedesktop.DBus.Properties member=GetAll
51dest=org.freedesktop.hostname1 spid=266 tpid=312
52scontext=system_u:system_r:bluetooth_t:s0-s15:c0.c1023
53tcontext=system_u:system_r:systemd_hostnamed_t:s0-s15:c0.c1023
54tclass=dbus permissive=0
55
56Upstream-Status: Inappropriate [embedded specific]
57
58Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
59---
60 policy/modules/services/bluetooth.te | 5 +++++
61 1 file changed, 5 insertions(+)
62
63diff --git a/policy/modules/services/bluetooth.te b/policy/modules/services/bluetooth.te
64index 69a38543e..b3df695db 100644
65--- a/policy/modules/services/bluetooth.te
66+++ b/policy/modules/services/bluetooth.te
67@@ -60,6 +60,8 @@ allow bluetooth_t self:socket create_stream_socket_perms;
68 allow bluetooth_t self:unix_stream_socket { accept connectto listen };
69 allow bluetooth_t self:tcp_socket { accept listen };
70 allow bluetooth_t self:netlink_kobject_uevent_socket create_socket_perms;
71+allow bluetooth_t self:bluetooth_socket create_stream_socket_perms;
72+allow bluetooth_t self:alg_socket create;
73
74 read_files_pattern(bluetooth_t, bluetooth_conf_t, bluetooth_conf_t)
75
76@@ -127,6 +129,9 @@ userdom_dontaudit_use_unpriv_user_fds(bluetooth_t)
77 userdom_dontaudit_use_user_terminals(bluetooth_t)
78 userdom_dontaudit_search_user_home_dirs(bluetooth_t)
79
80+init_dbus_send_script(bluetooth_t)
81+systemd_dbus_chat_hostnamed(bluetooth_t)
82+
83 optional_policy(`
84 dbus_system_bus_client(bluetooth_t)
85 dbus_connect_system_bus(bluetooth_t)
86--
872.17.1
88
diff --git a/recipes-security/refpolicy/refpolicy/0040-policy-modules-roles-sysadm-allow-sysadm-to-run-rpci.patch b/recipes-security/refpolicy/refpolicy/0041-policy-modules-roles-sysadm-allow-sysadm-to-run-rpci.patch
index e5ad291..bd06065 100644
--- a/recipes-security/refpolicy/refpolicy/0040-policy-modules-roles-sysadm-allow-sysadm-to-run-rpci.patch
+++ b/recipes-security/refpolicy/refpolicy/0041-policy-modules-roles-sysadm-allow-sysadm-to-run-rpci.patch
@@ -1,4 +1,4 @@
1From 354389c93e26bb8d8e8c1c126b01d838a6a214c8 Mon Sep 17 00:00:00 2001 1From e67fe4fa79d59be7bcefd256c1966ea8c034a3d9 Mon Sep 17 00:00:00 2001
2From: Roy Li <rongqing.li@windriver.com> 2From: Roy Li <rongqing.li@windriver.com>
3Date: Sat, 15 Feb 2014 09:45:00 +0800 3Date: Sat, 15 Feb 2014 09:45:00 +0800
4Subject: [PATCH] policy/modules/roles/sysadm: allow sysadm to run rpcinfo 4Subject: [PATCH] policy/modules/roles/sysadm: allow sysadm to run rpcinfo
@@ -22,10 +22,10 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
22 1 file changed, 1 insertion(+) 22 1 file changed, 1 insertion(+)
23 23
24diff --git a/policy/modules/roles/sysadm.te b/policy/modules/roles/sysadm.te 24diff --git a/policy/modules/roles/sysadm.te b/policy/modules/roles/sysadm.te
25index f0370b426..fc0945fe4 100644 25index ddf973693..1642f3b93 100644
26--- a/policy/modules/roles/sysadm.te 26--- a/policy/modules/roles/sysadm.te
27+++ b/policy/modules/roles/sysadm.te 27+++ b/policy/modules/roles/sysadm.te
28@@ -962,6 +962,7 @@ optional_policy(` 28@@ -947,6 +947,7 @@ optional_policy(`
29 ') 29 ')
30 30
31 optional_policy(` 31 optional_policy(`
diff --git a/recipes-security/refpolicy/refpolicy/0041-policy-modules-services-rpc-add-capability-dac_read_.patch b/recipes-security/refpolicy/refpolicy/0042-policy-modules-services-rpc-add-capability-dac_read_.patch
index 074647d..534c280 100644
--- a/recipes-security/refpolicy/refpolicy/0041-policy-modules-services-rpc-add-capability-dac_read_.patch
+++ b/recipes-security/refpolicy/refpolicy/0042-policy-modules-services-rpc-add-capability-dac_read_.patch
@@ -1,4 +1,4 @@
1From fbc8f3140bf6b519bad568fc1d840c9043fc13db Mon Sep 17 00:00:00 2001 1From 7c94b6aa3c679dc201ed5a907f713c0857d8b8ca Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Tue, 14 May 2019 15:22:08 +0800 3Date: Tue, 14 May 2019 15:22:08 +0800
4Subject: [PATCH] policy/modules/services/rpc: add capability dac_read_search 4Subject: [PATCH] policy/modules/services/rpc: add capability dac_read_search
@@ -17,10 +17,10 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
17 1 file changed, 1 insertion(+), 1 deletion(-) 17 1 file changed, 1 insertion(+), 1 deletion(-)
18 18
19diff --git a/policy/modules/services/rpc.te b/policy/modules/services/rpc.te 19diff --git a/policy/modules/services/rpc.te b/policy/modules/services/rpc.te
20index 020dbc4ad..c06ff803f 100644 20index c3e37177b..87b6b4561 100644
21--- a/policy/modules/services/rpc.te 21--- a/policy/modules/services/rpc.te
22+++ b/policy/modules/services/rpc.te 22+++ b/policy/modules/services/rpc.te
23@@ -142,7 +142,7 @@ optional_policy(` 23@@ -232,7 +232,7 @@ optional_policy(`
24 # Local policy 24 # Local policy
25 # 25 #
26 26
diff --git a/recipes-security/refpolicy/refpolicy/0042-policy-modules-services-rpcbind-allow-rpcbind_t-to-c.patch b/recipes-security/refpolicy/refpolicy/0043-policy-modules-services-rpcbind-allow-rpcbind_t-to-c.patch
index 7ef81fe..408df05 100644
--- a/recipes-security/refpolicy/refpolicy/0042-policy-modules-services-rpcbind-allow-rpcbind_t-to-c.patch
+++ b/recipes-security/refpolicy/refpolicy/0043-policy-modules-services-rpcbind-allow-rpcbind_t-to-c.patch
@@ -1,9 +1,12 @@
1From dfe79338ee9915527afd9e0943ed84e0347c4d66 Mon Sep 17 00:00:00 2001 1From 40101e4da939fcea2eebe3e4800d0de4e551ca26 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Wed, 1 Jul 2020 08:44:07 +0800 3Date: Wed, 1 Jul 2020 08:44:07 +0800
4Subject: [PATCH] policy/modules/services/rpcbind: allow rpcbind_t to create 4Subject: [PATCH] policy/modules/services/rpcbind: allow rpcbind_t to create
5 directory with label rpcbind_runtime_t 5 directory with label rpcbind_runtime_t
6 6
7* Allow rpcbind_t to create directory with label rpcbind_runtime_t
8* Set context for nfsserver and nfscommon
9
7Fixes: 10Fixes:
8avc: denied { create } for pid=136 comm="rpcbind" name="rpcbind" 11avc: denied { create } for pid=136 comm="rpcbind" name="rpcbind"
9scontext=system_u:system_r:rpcbind_t:s0-s15:c0.c1023 12scontext=system_u:system_r:rpcbind_t:s0-s15:c0.c1023
@@ -13,11 +16,26 @@ Upstream-Status: Inappropriate [embedded specific]
13 16
14Signed-off-by: Yi Zhao <yi.zhao@windriver.com> 17Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
15--- 18---
19 policy/modules/services/rpc.fc | 2 ++
16 policy/modules/services/rpcbind.te | 5 +++-- 20 policy/modules/services/rpcbind.te | 5 +++--
17 1 file changed, 3 insertions(+), 2 deletions(-) 21 2 files changed, 5 insertions(+), 2 deletions(-)
18 22
23diff --git a/policy/modules/services/rpc.fc b/policy/modules/services/rpc.fc
24index 88d2acaf0..d9c0a4aa7 100644
25--- a/policy/modules/services/rpc.fc
26+++ b/policy/modules/services/rpc.fc
27@@ -1,7 +1,9 @@
28 /etc/exports -- gen_context(system_u:object_r:exports_t,s0)
29
30 /etc/rc\.d/init\.d/nfs -- gen_context(system_u:object_r:nfsd_initrc_exec_t,s0)
31+/etc/rc\.d/init\.d/nfsserver -- gen_context(system_u:object_r:nfsd_initrc_exec_t,s0)
32 /etc/rc\.d/init\.d/nfslock -- gen_context(system_u:object_r:rpcd_initrc_exec_t,s0)
33+/etc/rc\.d/init\.d/nfscommon -- gen_context(system_u:object_r:rpcd_initrc_exec_t,s0)
34 /etc/rc\.d/init\.d/rpcidmapd -- gen_context(system_u:object_r:rpcd_initrc_exec_t,s0)
35
36 /usr/bin/rpc\..* -- gen_context(system_u:object_r:rpcd_exec_t,s0)
19diff --git a/policy/modules/services/rpcbind.te b/policy/modules/services/rpcbind.te 37diff --git a/policy/modules/services/rpcbind.te b/policy/modules/services/rpcbind.te
20index 69ed49d8b..4f110773a 100644 38index 370c9bce6..8972980fa 100644
21--- a/policy/modules/services/rpcbind.te 39--- a/policy/modules/services/rpcbind.te
22+++ b/policy/modules/services/rpcbind.te 40+++ b/policy/modules/services/rpcbind.te
23@@ -25,16 +25,17 @@ files_type(rpcbind_var_lib_t) 41@@ -25,16 +25,17 @@ files_type(rpcbind_var_lib_t)
diff --git a/recipes-security/refpolicy/refpolicy/0043-policy-modules-services-rngd-fix-security-context-fo.patch b/recipes-security/refpolicy/refpolicy/0044-policy-modules-services-rngd-fix-security-context-fo.patch
index 491cf02..7bd1402 100644
--- a/recipes-security/refpolicy/refpolicy/0043-policy-modules-services-rngd-fix-security-context-fo.patch
+++ b/recipes-security/refpolicy/refpolicy/0044-policy-modules-services-rngd-fix-security-context-fo.patch
@@ -1,23 +1,24 @@
1From 617b8b558674a77cd2b1eff9155f276985456684 Mon Sep 17 00:00:00 2001 1From 5dbfff582a9c7745f8517adefb27c5f90653f8fa Mon Sep 17 00:00:00 2001
2From: Wenzong Fan <wenzong.fan@windriver.com> 2From: Wenzong Fan <wenzong.fan@windriver.com>
3Date: Wed, 25 May 2016 03:16:24 -0400 3Date: Wed, 25 May 2016 03:16:24 -0400
4Subject: [PATCH] policy/modules/services/rngd: fix security context for 4Subject: [PATCH] policy/modules/services/rngd: fix security context for
5 rng-tools 5 rng-tools
6 6
7* fix security context for /etc/init.d/rng-tools 7* Fix security context for /etc/init.d/rng-tools
8* allow rngd_t to search /run/systemd/journal 8* Allow rngd_t to read sysfs
9 9
10Fixes: 10Fixes:
11audit: type=1400 audit(1592874699.503:11): avc: denied { read } for 11avc: denied { read } for pid=355 comm="rngd" name="cpu" dev="sysfs"
12pid=355 comm="rngd" name="cpu" dev="sysfs" ino=36 12ino=36 scontext=system_u:system_r:rngd_t
13scontext=system_u:system_r:rngd_t tcontext=system_u:object_r:sysfs_t 13tcontext=system_u:object_r:sysfs_t tclass=dir permissive=1
14tclass=dir permissive=1 14
15audit: type=1400 audit(1592874699.505:12): avc: denied { getsched } 15avc: denied { getsched } for pid=355 comm="rngd"
16for pid=355 comm="rngd" scontext=system_u:system_r:rngd_t 16scontext=system_u:system_r:rngd_t tcontext=system_u:system_r:rngd_t
17tcontext=system_u:system_r:rngd_t tclass=process permissive=1 17tclass=process permissive=1
18audit: type=1400 audit(1592874699.508:13): avc: denied { setsched } 18
19for pid=355 comm="rngd" scontext=system_u:system_r:rngd_t 19avc: denied { setsched } for pid=355 comm="rngd"
20tcontext=system_u:system_r:rngd_t tclass=process permissive=1 20scontext=system_u:system_r:rngd_t tcontext=system_u:system_r:rngd_t
21tclass=process permissive=1
21 22
22Upstream-Status: Inappropriate [embedded specific] 23Upstream-Status: Inappropriate [embedded specific]
23 24
@@ -39,7 +40,7 @@ index 382c067f9..0ecc5acc4 100644
39 /usr/bin/rngd -- gen_context(system_u:object_r:rngd_exec_t,s0) 40 /usr/bin/rngd -- gen_context(system_u:object_r:rngd_exec_t,s0)
40 41
41diff --git a/policy/modules/services/rngd.te b/policy/modules/services/rngd.te 42diff --git a/policy/modules/services/rngd.te b/policy/modules/services/rngd.te
42index 839813216..c4ffafb5d 100644 43index 4540e4ec7..48f08fb48 100644
43--- a/policy/modules/services/rngd.te 44--- a/policy/modules/services/rngd.te
44+++ b/policy/modules/services/rngd.te 45+++ b/policy/modules/services/rngd.te
45@@ -21,7 +21,7 @@ files_runtime_file(rngd_runtime_t) 46@@ -21,7 +21,7 @@ files_runtime_file(rngd_runtime_t)
diff --git a/recipes-security/refpolicy/refpolicy/0044-policy-modules-system-authlogin-allow-chkpwd_t-to-ma.patch b/recipes-security/refpolicy/refpolicy/0044-policy-modules-system-authlogin-allow-chkpwd_t-to-ma.patch
deleted file mode 100644
index f929df2..0000000
--- a/recipes-security/refpolicy/refpolicy/0044-policy-modules-system-authlogin-allow-chkpwd_t-to-ma.patch
+++ /dev/null
@@ -1,34 +0,0 @@
1From 0e3199f243a47853452a877ebad5360bc8c1f2f1 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Thu, 21 Nov 2019 13:58:28 +0800
4Subject: [PATCH] policy/modules/system/authlogin: allow chkpwd_t to map
5 shadow_t
6
7Fixes:
8avc: denied { map } for pid=244 comm="unix_chkpwd" path="/etc/shadow"
9dev="vda" ino=443 scontext=system_u:system_r:chkpwd_t
10tcontext=system_u:object_r:shadow_t tclass=file permissive=0
11
12Upstream-Status: Inappropriate [embedded specific]
13
14Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
15---
16 policy/modules/system/authlogin.te | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19diff --git a/policy/modules/system/authlogin.te b/policy/modules/system/authlogin.te
20index 0fc5951e9..e999fa798 100644
21--- a/policy/modules/system/authlogin.te
22+++ b/policy/modules/system/authlogin.te
23@@ -100,7 +100,7 @@ allow chkpwd_t self:capability { dac_override setuid };
24 dontaudit chkpwd_t self:capability sys_tty_config;
25 allow chkpwd_t self:process { getattr signal };
26
27-allow chkpwd_t shadow_t:file read_file_perms;
28+allow chkpwd_t shadow_t:file { read_file_perms map };
29 files_list_etc(chkpwd_t)
30
31 kernel_read_crypto_sysctls(chkpwd_t)
32--
332.17.1
34
diff --git a/recipes-security/refpolicy/refpolicy/0045-policy-modules-services-ssh-allow-ssh_keygen_t-to-re.patch b/recipes-security/refpolicy/refpolicy/0045-policy-modules-services-ssh-allow-ssh_keygen_t-to-re.patch
new file mode 100644
index 0000000..4b7e2b5
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0045-policy-modules-services-ssh-allow-ssh_keygen_t-to-re.patch
@@ -0,0 +1,34 @@
1From be61411d6d7d3bb2c700ec24f42661ce9c728df4 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Fri, 29 Jan 2021 10:32:00 +0800
4Subject: [PATCH] policy/modules/services/ssh: allow ssh_keygen_t to read
5 proc_t
6
7Fixes:
8avc: denied { read } for pid=353 comm="ssh-keygen" name="filesystems"
9dev="proc" ino=4026532078 scontext=system_u:system_r:ssh_keygen_t
10tcontext=system_u:object_r:proc_t tclass=file permissive=0
11
12Upstream-Status: Inappropriate [embedded specific]
13
14Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
15---
16 policy/modules/services/ssh.te | 2 ++
17 1 file changed, 2 insertions(+)
18
19diff --git a/policy/modules/services/ssh.te b/policy/modules/services/ssh.te
20index 238c45ed8..2bbf50e84 100644
21--- a/policy/modules/services/ssh.te
22+++ b/policy/modules/services/ssh.te
23@@ -330,6 +330,8 @@ allow ssh_keygen_t self:process { sigchld sigkill sigstop signull signal };
24
25 allow ssh_keygen_t self:unix_stream_socket create_stream_socket_perms;
26
27+allow ssh_keygen_t proc_t:file read_file_perms;
28+
29 allow ssh_keygen_t sshd_key_t:file manage_file_perms;
30 files_etc_filetrans(ssh_keygen_t, sshd_key_t, file)
31
32--
332.17.1
34
diff --git a/recipes-security/refpolicy/refpolicy/0045-policy-modules-system-udev-allow-udevadm_t-to-search.patch b/recipes-security/refpolicy/refpolicy/0045-policy-modules-system-udev-allow-udevadm_t-to-search.patch
deleted file mode 100644
index 03d9552..0000000
--- a/recipes-security/refpolicy/refpolicy/0045-policy-modules-system-udev-allow-udevadm_t-to-search.patch
+++ /dev/null
@@ -1,34 +0,0 @@
1From bd03c34ab3c193d6c21a6c0b951e89dd4e24eee6 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Fri, 19 Jun 2020 15:21:26 +0800
4Subject: [PATCH] policy/modules/system/udev: allow udevadm_t to search bin dir
5
6Fixes:
7audit: type=1400 audit(1592894099.930:6): avc: denied { search } for
8pid=153 comm="udevadm" name="bin" dev="vda" ino=13
9scontext=system_u:system_r:udevadm_t tcontext=system_u:object_r:bin_t
10tclass=dir permissive=0
11
12Upstream-Status: Inappropriate [embedded specific]
13
14Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
15---
16 policy/modules/system/udev.te | 2 ++
17 1 file changed, 2 insertions(+)
18
19diff --git a/policy/modules/system/udev.te b/policy/modules/system/udev.te
20index 52da11acd..3a4d7362c 100644
21--- a/policy/modules/system/udev.te
22+++ b/policy/modules/system/udev.te
23@@ -415,6 +415,8 @@ dev_read_urand(udevadm_t)
24 files_read_etc_files(udevadm_t)
25 files_read_usr_files(udevadm_t)
26
27+corecmd_search_bin(udevadm_t)
28+
29 init_list_runtime(udevadm_t)
30 init_read_state(udevadm_t)
31
32--
332.17.1
34
diff --git a/recipes-security/refpolicy/refpolicy/0049-policy-modules-services-ssh-make-respective-init-scr.patch b/recipes-security/refpolicy/refpolicy/0046-policy-modules-services-ssh-make-respective-init-scr.patch
index 86df765..fd8d527 100644
--- a/recipes-security/refpolicy/refpolicy/0049-policy-modules-services-ssh-make-respective-init-scr.patch
+++ b/recipes-security/refpolicy/refpolicy/0046-policy-modules-services-ssh-make-respective-init-scr.patch
@@ -1,4 +1,4 @@
1From 878f3eb8e0716764ea4d42b996f58ea9072204fc Mon Sep 17 00:00:00 2001 1From 20e6395a7e8bce552fb0190dbc57d836d763fc18 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Sun, 28 Jun 2020 16:14:45 +0800 3Date: Sun, 28 Jun 2020 16:14:45 +0800
4Subject: [PATCH] policy/modules/services/ssh: make respective init scripts 4Subject: [PATCH] policy/modules/services/ssh: make respective init scripts
@@ -14,7 +14,7 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
14 1 file changed, 1 insertion(+), 3 deletions(-) 14 1 file changed, 1 insertion(+), 3 deletions(-)
15 15
16diff --git a/policy/modules/services/ssh.te b/policy/modules/services/ssh.te 16diff --git a/policy/modules/services/ssh.te b/policy/modules/services/ssh.te
17index fefca0c20..db62eaa18 100644 17index 2bbf50e84..ad0a1b7ad 100644
18--- a/policy/modules/services/ssh.te 18--- a/policy/modules/services/ssh.te
19+++ b/policy/modules/services/ssh.te 19+++ b/policy/modules/services/ssh.te
20@@ -80,9 +80,7 @@ userdom_user_home_content(ssh_home_t) 20@@ -80,9 +80,7 @@ userdom_user_home_content(ssh_home_t)
diff --git a/recipes-security/refpolicy/refpolicy/0046-policy-modules-udev-do-not-audit-udevadm_t-to-read-w.patch b/recipes-security/refpolicy/refpolicy/0046-policy-modules-udev-do-not-audit-udevadm_t-to-read-w.patch
deleted file mode 100644
index 9397287..0000000
--- a/recipes-security/refpolicy/refpolicy/0046-policy-modules-udev-do-not-audit-udevadm_t-to-read-w.patch
+++ /dev/null
@@ -1,37 +0,0 @@
1From 8b5eb5b2e01a7686c43ba7b53cc76f465f9e8f56 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Tue, 30 Jun 2020 09:27:45 +0800
4Subject: [PATCH] policy/modules/udev: do not audit udevadm_t to read/write
5 /dev/console
6
7Fixes:
8avc: denied { read write } for pid=162 comm="udevadm"
9path="/dev/console" dev="devtmpfs" ino=10034
10scontext=system_u:system_r:udevadm_t:s0-s15:c0.c1023
11tcontext=system_u:object_r:console_device_t:s0 tclass=chr_file
12permissive=0
13avc: denied { use } for pid=162 comm="udevadm" path="/dev/console"
14dev="devtmpfs" ino=10034
15scontext=system_u:system_r:udevadm_t:s0-s15:c0.c1023
16tcontext=system_u:system_r:init_t:s0-s15:c0.c1023 tclass=fd permissive=0
17
18Upstream-Status: Inappropriate [embedded specific]
19
20Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
21---
22 policy/modules/system/udev.te | 2 ++
23 1 file changed, 2 insertions(+)
24
25diff --git a/policy/modules/system/udev.te b/policy/modules/system/udev.te
26index 3a4d7362c..e483d63d3 100644
27--- a/policy/modules/system/udev.te
28+++ b/policy/modules/system/udev.te
29@@ -425,3 +425,5 @@ kernel_read_system_state(udevadm_t)
30
31 seutil_read_file_contexts(udevadm_t)
32
33+init_dontaudit_use_fds(udevadm_t)
34+term_dontaudit_use_console(udevadm_t)
35--
362.17.1
37
diff --git a/recipes-security/refpolicy/refpolicy/0050-policy-modules-kernel-terminal-allow-loging-to-reset.patch b/recipes-security/refpolicy/refpolicy/0047-policy-modules-kernel-terminal-allow-loging-to-reset.patch
index e15e57b..cafdd61 100644
--- a/recipes-security/refpolicy/refpolicy/0050-policy-modules-kernel-terminal-allow-loging-to-reset.patch
+++ b/recipes-security/refpolicy/refpolicy/0047-policy-modules-kernel-terminal-allow-loging-to-reset.patch
@@ -1,4 +1,4 @@
1From fb900b71d7e1fa5c3bd997e6deadcaae2b65b05a Mon Sep 17 00:00:00 2001 1From f0249cb5802af7f9113786940d0c49e786f774ae Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Mon, 29 Jun 2020 14:27:02 +0800 3Date: Mon, 29 Jun 2020 14:27:02 +0800
4Subject: [PATCH] policy/modules/kernel/terminal: allow loging to reset tty 4Subject: [PATCH] policy/modules/kernel/terminal: allow loging to reset tty
@@ -12,7 +12,7 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
12 1 file changed, 1 insertion(+), 3 deletions(-) 12 1 file changed, 1 insertion(+), 3 deletions(-)
13 13
14diff --git a/policy/modules/kernel/terminal.if b/policy/modules/kernel/terminal.if 14diff --git a/policy/modules/kernel/terminal.if b/policy/modules/kernel/terminal.if
15index 8f9578dbc..3821ab9b0 100644 15index e8c0735eb..9ccecfa0d 100644
16--- a/policy/modules/kernel/terminal.if 16--- a/policy/modules/kernel/terminal.if
17+++ b/policy/modules/kernel/terminal.if 17+++ b/policy/modules/kernel/terminal.if
18@@ -119,9 +119,7 @@ interface(`term_user_tty',` 18@@ -119,9 +119,7 @@ interface(`term_user_tty',`
diff --git a/recipes-security/refpolicy/refpolicy/0047-policy-modules-services-rdisc-allow-rdisc_t-to-searc.patch b/recipes-security/refpolicy/refpolicy/0047-policy-modules-services-rdisc-allow-rdisc_t-to-searc.patch
deleted file mode 100644
index bfb50cc..0000000
--- a/recipes-security/refpolicy/refpolicy/0047-policy-modules-services-rdisc-allow-rdisc_t-to-searc.patch
+++ /dev/null
@@ -1,34 +0,0 @@
1From 6bcf62e310931e8be943520a7e1a5686f54a8e34 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Tue, 23 Jun 2020 15:44:43 +0800
4Subject: [PATCH] policy/modules/services/rdisc: allow rdisc_t to search sbin
5 dir
6
7Fixes:
8avc: denied { search } for pid=225 comm="rdisc" name="sbin" dev="vda"
9ino=1478 scontext=system_u:system_r:rdisc_t
10tcontext=system_u:object_r:bin_t tclass=dir permissive=0
11
12Upstream-Status: Inappropriate [embedded specific]
13
14Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
15---
16 policy/modules/services/rdisc.te | 2 ++
17 1 file changed, 2 insertions(+)
18
19diff --git a/policy/modules/services/rdisc.te b/policy/modules/services/rdisc.te
20index 82d54dbb7..1dd458f8e 100644
21--- a/policy/modules/services/rdisc.te
22+++ b/policy/modules/services/rdisc.te
23@@ -47,6 +47,8 @@ sysnet_read_config(rdisc_t)
24
25 userdom_dontaudit_use_unpriv_user_fds(rdisc_t)
26
27+corecmd_search_bin(rdisc_t)
28+
29 optional_policy(`
30 seutil_sigchld_newrole(rdisc_t)
31 ')
32--
332.17.1
34
diff --git a/recipes-security/refpolicy/refpolicy/0048-policy-modules-system-logging-fix-auditd-startup-fai.patch b/recipes-security/refpolicy/refpolicy/0048-policy-modules-system-logging-fix-auditd-startup-fai.patch
deleted file mode 100644
index cb5b88d..0000000
--- a/recipes-security/refpolicy/refpolicy/0048-policy-modules-system-logging-fix-auditd-startup-fai.patch
+++ /dev/null
@@ -1,52 +0,0 @@
1From b585008cec90386903e7613a4a22286c0a94be8c Mon Sep 17 00:00:00 2001
2From: Wenzong Fan <wenzong.fan@windriver.com>
3Date: Tue, 24 Jan 2017 08:45:35 +0000
4Subject: [PATCH] policy/modules/system/logging: fix auditd startup failures
5
6Fixes:
7 avc: denied { getcap } for pid=849 comm="auditctl" \
8 scontext=system_u:system_r:auditctl_t:s0-s15:c0.c1023 \
9 tcontext=system_u:system_r:auditctl_t:s0-s15:c0.c1023 \
10 tclass=process
11
12 avc: denied { setattr } for pid=848 comm="auditd" \
13 name="audit" dev="tmpfs" ino=9569 \
14 scontext=system_u:system_r:auditd_t:s15:c0.c1023 \
15 tcontext=system_u:object_r:auditd_log_t:s15:c0.c1023 \
16 tclass=dir
17
18 avc: denied { search } for pid=731 comm="auditd" \
19 name="/" dev="tmpfs" ino=9399 \
20 scontext=system_u:system_r:auditd_t:s15:c0.c1023 \
21 tcontext=system_u:object_r:tmpfs_t:s0 tclass=dir
22
23Upstream-Status: Inappropriate [embedded specific]
24
25Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
26---
27 policy/modules/system/logging.te | 2 ++
28 1 file changed, 2 insertions(+)
29
30diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te
31index 2d9f65d2d..95309f334 100644
32--- a/policy/modules/system/logging.te
33+++ b/policy/modules/system/logging.te
34@@ -157,6 +157,7 @@ allow auditd_t auditd_etc_t:dir list_dir_perms;
35 allow auditd_t auditd_etc_t:file read_file_perms;
36 dontaudit auditd_t auditd_etc_t:file map;
37
38+manage_dirs_pattern(auditd_t, auditd_log_t, auditd_log_t)
39 manage_files_pattern(auditd_t, auditd_log_t, auditd_log_t)
40 allow auditd_t auditd_log_t:dir setattr;
41 manage_lnk_files_pattern(auditd_t, auditd_log_t, auditd_log_t)
42@@ -177,6 +178,7 @@ dev_read_sysfs(auditd_t)
43 fs_getattr_all_fs(auditd_t)
44 fs_search_auto_mountpoints(auditd_t)
45 fs_rw_anon_inodefs_files(auditd_t)
46+fs_search_tmpfs(auditd_t)
47
48 selinux_search_fs(auditctl_t)
49
50--
512.17.1
52
diff --git a/recipes-security/refpolicy/refpolicy/0051-policy-modules-system-selinuxutil-allow-semanage_t-t.patch b/recipes-security/refpolicy/refpolicy/0048-policy-modules-system-selinuxutil-allow-semanage_t-t.patch
index d4f996d..54dd451 100644
--- a/recipes-security/refpolicy/refpolicy/0051-policy-modules-system-selinuxutil-allow-semanage_t-t.patch
+++ b/recipes-security/refpolicy/refpolicy/0048-policy-modules-system-selinuxutil-allow-semanage_t-t.patch
@@ -1,4 +1,4 @@
1From 2c8464254adf0b2635e5abf4ccc4473c96fa0006 Mon Sep 17 00:00:00 2001 1From 74f611538d63cdf4157e6b5f4b982cafe0378b9a Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Mon, 29 Jun 2020 14:30:58 +0800 3Date: Mon, 29 Jun 2020 14:30:58 +0800
4Subject: [PATCH] policy/modules/system/selinuxutil: allow semanage_t to read 4Subject: [PATCH] policy/modules/system/selinuxutil: allow semanage_t to read
@@ -12,10 +12,10 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
12 1 file changed, 2 insertions(+), 4 deletions(-) 12 1 file changed, 2 insertions(+), 4 deletions(-)
13 13
14diff --git a/policy/modules/system/selinuxutil.te b/policy/modules/system/selinuxutil.te 14diff --git a/policy/modules/system/selinuxutil.te b/policy/modules/system/selinuxutil.te
15index fad28f179..09fef149b 100644 15index 8f8f42ec7..a505b3987 100644
16--- a/policy/modules/system/selinuxutil.te 16--- a/policy/modules/system/selinuxutil.te
17+++ b/policy/modules/system/selinuxutil.te 17+++ b/policy/modules/system/selinuxutil.te
18@@ -544,10 +544,8 @@ userdom_map_user_home_content_files(semanage_t) 18@@ -549,10 +549,8 @@ userdom_map_user_home_content_files(semanage_t)
19 userdom_read_user_tmp_files(semanage_t) 19 userdom_read_user_tmp_files(semanage_t)
20 userdom_map_user_tmp_files(semanage_t) 20 userdom_map_user_tmp_files(semanage_t)
21 21
diff --git a/recipes-security/refpolicy/refpolicy/0054-policy-modules-system-systemd-enable-support-for-sys.patch b/recipes-security/refpolicy/refpolicy/0049-policy-modules-system-systemd-enable-support-for-sys.patch
index 9dde899..ae1d71a 100644
--- a/recipes-security/refpolicy/refpolicy/0054-policy-modules-system-systemd-enable-support-for-sys.patch
+++ b/recipes-security/refpolicy/refpolicy/0049-policy-modules-system-systemd-enable-support-for-sys.patch
@@ -1,4 +1,4 @@
1From 9eee952a306000eaa5e92b578f3caa35b6a35699 Mon Sep 17 00:00:00 2001 1From c2a6ad9b4eee990b79175ec1866cfe20b7c61ef3 Mon Sep 17 00:00:00 2001
2From: Wenzong Fan <wenzong.fan@windriver.com> 2From: Wenzong Fan <wenzong.fan@windriver.com>
3Date: Thu, 4 Feb 2016 06:03:19 -0500 3Date: Thu, 4 Feb 2016 06:03:19 -0500
4Subject: [PATCH] policy/modules/system/systemd: enable support for 4Subject: [PATCH] policy/modules/system/systemd: enable support for
@@ -36,10 +36,10 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
36 1 file changed, 5 insertions(+), 1 deletion(-) 36 1 file changed, 5 insertions(+), 1 deletion(-)
37 37
38diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te 38diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
39index 136990d08..c7fe51b62 100644 39index 2e08efd19..7da836136 100644
40--- a/policy/modules/system/systemd.te 40--- a/policy/modules/system/systemd.te
41+++ b/policy/modules/system/systemd.te 41+++ b/policy/modules/system/systemd.te
42@@ -10,7 +10,7 @@ policy_module(systemd, 1.9.14) 42@@ -10,7 +10,7 @@ policy_module(systemd, 1.11.1)
43 ## Enable support for systemd-tmpfiles to manage all non-security files. 43 ## Enable support for systemd-tmpfiles to manage all non-security files.
44 ## </p> 44 ## </p>
45 ## </desc> 45 ## </desc>
@@ -48,10 +48,10 @@ index 136990d08..c7fe51b62 100644
48 48
49 ## <desc> 49 ## <desc>
50 ## <p> 50 ## <p>
51@@ -1196,6 +1196,10 @@ files_relabel_var_lib_dirs(systemd_tmpfiles_t) 51@@ -1332,6 +1332,10 @@ files_relabelfrom_home(systemd_tmpfiles_t)
52 files_relabelfrom_home(systemd_tmpfiles_t)
53 files_relabelto_home(systemd_tmpfiles_t) 52 files_relabelto_home(systemd_tmpfiles_t)
54 files_relabelto_etc_dirs(systemd_tmpfiles_t) 53 files_relabelto_etc_dirs(systemd_tmpfiles_t)
54 files_setattr_lock_dirs(systemd_tmpfiles_t)
55+ 55+
56+files_manage_non_auth_files(systemd_tmpfiles_t) 56+files_manage_non_auth_files(systemd_tmpfiles_t)
57+files_relabel_non_auth_files(systemd_tmpfiles_t) 57+files_relabel_non_auth_files(systemd_tmpfiles_t)
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 @@
1From 8e762e1070e98a4235a70536ee6ca81725858a4b Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Mon, 25 Jan 2021 14:14:59 +0800
4Subject: [PATCH] policy/modules/system/systemd: fix systemd-resolved startup
5 failures
6
7* Allow systemd_resolved_t to create socket file
8* Allow systemd_resolved_t to manage systemd_resolved_runtime_t link
9 files
10* Allow systemd_resolved_t to send and recevie messages from dhcpc over
11 dbus
12
13Fixes:
14avc: denied { create } for pid=258 comm="systemd-resolve"
15name="io.systemd.Resolve"
16scontext=system_u:system_r:systemd_resolved_t:s0-s15:c0.c1023
17tcontext=system_u:object_r:systemd_resolved_runtime_t:s0
18tclass=sock_file permissive=0
19
20avc: denied { create } for pid=329 comm="systemd-resolve"
21name=".#stub-resolv.conf53cb7f9d1e3aa72b"
22scontext=system_u:system_r:systemd_resolved_t:s0-s15:c0.c1023
23tcontext=system_u:object_r:systemd_resolved_runtime_t:s0 tclass=lnk_file
24permissive=0
25
26avc: denied { send_msg } for msgtype=method_call
27interface=org.freedesktop.resolve1.Manager member=RevertLink
28dest=org.freedesktop.resolve1 spid=340 tpid=345
29scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
30tcontext=system_u:system_r:systemd_resolved_t:s0-s15:c0.c1023
31tclass=dbus permissive=0
32
33avc: denied { send_msg } for msgtype=method_return dest=:1.6 spid=345
34tpid=340 scontext=system_u:system_r:systemd_resolved_t:s0-s15:c0.c1023
35tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023 tclass=dbus
36permissive=0
37
38Upstream-Status: Inappropriate [embedded specific]
39
40Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
41---
42 policy/modules/system/systemd.te | 4 ++++
43 1 file changed, 4 insertions(+)
44
45diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
46index 7da836136..0411729ea 100644
47--- a/policy/modules/system/systemd.te
48+++ b/policy/modules/system/systemd.te
49@@ -1164,6 +1164,8 @@ allow systemd_resolved_t systemd_networkd_runtime_t:dir watch;
50
51 manage_dirs_pattern(systemd_resolved_t, systemd_resolved_runtime_t, systemd_resolved_runtime_t)
52 manage_files_pattern(systemd_resolved_t, systemd_resolved_runtime_t, systemd_resolved_runtime_t)
53+manage_sock_files_pattern(systemd_resolved_t, systemd_resolved_runtime_t, systemd_resolved_runtime_t)
54+manage_lnk_files_pattern(systemd_resolved_t, systemd_resolved_runtime_t, systemd_resolved_runtime_t)
55 init_runtime_filetrans(systemd_resolved_t, systemd_resolved_runtime_t, dir)
56
57 dev_read_sysfs(systemd_resolved_t)
58@@ -1194,6 +1196,8 @@ seutil_read_file_contexts(systemd_resolved_t)
59 systemd_log_parse_environment(systemd_resolved_t)
60 systemd_read_networkd_runtime(systemd_resolved_t)
61
62+sysnet_dbus_chat_dhcpc(systemd_resolved_t)
63+
64 optional_policy(`
65 dbus_connect_system_bus(systemd_resolved_t)
66 dbus_system_bus_client(systemd_resolved_t)
67--
682.17.1
69
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 @@
1From 2d932ba7140d91cf2a8386b0240f4f1014124746 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Wed, 3 Feb 2021 09:47:59 +0800
4Subject: [PATCH] policy/modules/system/init: add capability2 bpf and perfmon
5 for init_t
6
7Fixes:
8avc: denied { bpf } for pid=1 comm="systemd" capability=39
9scontext=system_u:system_r:init_t tcontext=system_u:system_r:init_t
10tclass=capability2 permissive=0
11avc: denied { perfmon } for pid=1 comm="systemd" capability=38
12scontext=system_u:system_r:init_t tcontext=system_u:system_r:init_t
13tclass=capability2 permissive=0
14
15Upstream-Status: Inappropriate [embedded specific]
16
17Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
18---
19 policy/modules/system/init.te | 2 +-
20 1 file changed, 1 insertion(+), 1 deletion(-)
21
22diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te
23index e82177938..b7d494398 100644
24--- a/policy/modules/system/init.te
25+++ b/policy/modules/system/init.te
26@@ -134,7 +134,7 @@ ifdef(`enable_mls',`
27
28 # Use capabilities. old rule:
29 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 };
30-allow init_t self:capability2 { wake_alarm block_suspend };
31+allow init_t self:capability2 { wake_alarm block_suspend bpf perfmon };
32 # is ~sys_module really needed? observed:
33 # sys_boot
34 # sys_tty_config
35--
362.17.1
37
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 @@
1From a3e4135c543be8d3a054e6f74629240370d111ed Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Mon, 27 May 2019 15:55:19 +0800
4Subject: [PATCH] policy/modules/system/sysnetwork: allow ifconfig_t to read
5 dhcp client state files
6
7Fixes:
8type=AVC msg=audit(1558942740.789:50): avc: denied { read } for
9pid=221 comm="ip" path="/var/lib/dhcp/dhclient.leases" dev="vda"
10ino=29858 scontext=system_u:system_r:ifconfig_t
11tcontext=system_u:object_r:dhcpc_state_t tclass=file permissive=1
12
13Upstream-Status: Inappropriate [embedded specific]
14
15Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
16---
17 policy/modules/system/sysnetwork.te | 2 ++
18 1 file changed, 2 insertions(+)
19
20diff --git a/policy/modules/system/sysnetwork.te b/policy/modules/system/sysnetwork.te
21index bbdbcdc7e..a77738924 100644
22--- a/policy/modules/system/sysnetwork.te
23+++ b/policy/modules/system/sysnetwork.te
24@@ -319,6 +319,8 @@ kernel_request_load_module(ifconfig_t)
25 kernel_search_network_sysctl(ifconfig_t)
26 kernel_rw_net_sysctls(ifconfig_t)
27
28+sysnet_read_dhcpc_state(ifconfig_t)
29+
30 corenet_rw_tun_tap_dev(ifconfig_t)
31
32 dev_read_sysfs(ifconfig_t)
33--
342.17.1
35
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 @@
1From 5db5b20728dff6c5e75dc07ea4feb6c507661b62 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Wed, 8 Jul 2020 13:53:28 +0800
4Subject: [PATCH] policy/modules/system/systemd: allow systemd_logind_t to
5 watch initrc_runtime_t
6
7Fixes:
8avc: denied { watch } for pid=200 comm="systemd-logind"
9path="/run/utmp" dev="tmpfs" ino=12766
10scontext=system_u:system_r:systemd_logind_t:s0-s15:c0.c1023
11tcontext=system_u:object_r:initrc_runtime_t:s0 tclass=file permissive=0
12
13systemd-logind[200]: Failed to create inotify watch on /var/run/utmp, ignoring: Permission denied
14
15Upstream-Status: Inappropriate [embedded specific]
16
17Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
18---
19 policy/modules/system/systemd.te | 2 ++
20 1 file changed, 2 insertions(+)
21
22diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
23index 0411729ea..2d9d7d331 100644
24--- a/policy/modules/system/systemd.te
25+++ b/policy/modules/system/systemd.te
26@@ -651,6 +651,8 @@ init_stop_all_units(systemd_logind_t)
27 init_start_system(systemd_logind_t)
28 init_stop_system(systemd_logind_t)
29
30+allow systemd_logind_t initrc_runtime_t:file watch;
31+
32 locallogin_read_state(systemd_logind_t)
33
34 seutil_libselinux_linked(systemd_logind_t)
35--
362.17.1
37
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 @@
1From f23bb02c92bcbf7afa0c6b445719df6b06df15ea Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Mon, 6 Jul 2020 09:06:08 +0800
4Subject: [PATCH] policy/modules/services/ntp: allow ntpd_t to watch system bus
5 runtime directories and named sockets
6
7Fixes:
8avc: denied { read } for pid=197 comm="systemd-timesyn" name="dbus"
9dev="tmpfs" ino=14064 scontext=system_u:system_r:ntpd_t:s0-s15:c0.c1023
10tcontext=system_u:object_r:system_dbusd_runtime_t:s0 tclass=dir
11permissive=0
12
13avc: denied { watch } for pid=197 comm="systemd-timesyn"
14path="/run/dbus" dev="tmpfs" ino=14064
15scontext=system_u:system_r:ntpd_t:s0-s15:c0.c1023
16tcontext=system_u:object_r:system_dbusd_runtime_t:s0 tclass=dir
17permissive=0
18
19avc: denied { read } for pid=197 comm="systemd-timesyn"
20name="system_bus_socket" dev="tmpfs" ino=14067
21scontext=system_u:system_r:ntpd_t:s0-s15:c0.c1023
22tcontext=system_u:object_r:system_dbusd_runtime_t:s0 tclass=sock_file
23permissive=0
24
25avc: denied { watch } for pid=197 comm="systemd-timesyn"
26path="/run/dbus/system_bus_socket" dev="tmpfs" ino=14067
27scontext=system_u:system_r:ntpd_t:s0-s15:c0.c1023
28tcontext=system_u:object_r:system_dbusd_runtime_t:s0 tclass=sock_file
29permissive=0
30
31Upstream-Status: Inappropriate [embedded specific]
32
33Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
34---
35 policy/modules/services/ntp.te | 4 ++++
36 1 file changed, 4 insertions(+)
37
38diff --git a/policy/modules/services/ntp.te b/policy/modules/services/ntp.te
39index 81f8c76bb..75603e16b 100644
40--- a/policy/modules/services/ntp.te
41+++ b/policy/modules/services/ntp.te
42@@ -141,6 +141,10 @@ userdom_list_user_home_dirs(ntpd_t)
43 ifdef(`init_systemd',`
44 allow ntpd_t ntpd_unit_t:file read_file_perms;
45
46+ dbus_watch_system_bus_runtime_dirs(ntpd_t)
47+ allow ntpd_t system_dbusd_runtime_t:dir read;
48+ dbus_watch_system_bus_runtime_named_sockets(ntpd_t)
49+ allow ntpd_t system_dbusd_runtime_t:sock_file read;
50 dbus_system_bus_client(ntpd_t)
51 dbus_connect_system_bus(ntpd_t)
52 init_dbus_chat(ntpd_t)
53--
542.17.1
55
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 @@
1From a92be78e20a0838c2f04cf8d2781dcf918f8d7ab Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Tue, 14 May 2019 16:02:19 +0800
4Subject: [PATCH] policy/modules/system/logging: set label devlog_t to symlink
5 /dev/log
6
7* Set labe devlog_t to symlink /dev/log
8* Allow syslogd_t to manage devlog_t link file
9
10Fixes:
11avc: denied { unlink } for pid=250 comm="rsyslogd" name="log"
12dev="devtmpfs" ino=10997
13scontext=system_u:system_r:syslogd_t:s15:c0.c1023
14tcontext=system_u:object_r:device_t:s0 tclass=lnk_file permissive=0
15
16Upstream-Status: Inappropriate [embedded specific]
17
18Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
19---
20 policy/modules/system/logging.fc | 2 ++
21 policy/modules/system/logging.if | 4 ++++
22 policy/modules/system/logging.te | 1 +
23 3 files changed, 7 insertions(+)
24
25diff --git a/policy/modules/system/logging.fc b/policy/modules/system/logging.fc
26index a4ecd570a..02f0b6270 100644
27--- a/policy/modules/system/logging.fc
28+++ b/policy/modules/system/logging.fc
29@@ -1,4 +1,5 @@
30 /dev/log -s gen_context(system_u:object_r:devlog_t,mls_systemhigh)
31+/dev/log -l gen_context(system_u:object_r:devlog_t,s0)
32
33 /etc/rsyslog\.conf -- gen_context(system_u:object_r:syslog_conf_t,s0)
34 /etc/syslog\.conf -- gen_context(system_u:object_r:syslog_conf_t,s0)
35@@ -24,6 +25,7 @@
36 /usr/lib/systemd/system/auditd.* -- gen_context(system_u:object_r:auditd_unit_t,s0)
37 /usr/lib/systemd/system/[^/]*systemd-journal.* -- gen_context(system_u:object_r:syslogd_unit_t,s0)
38 /usr/lib/systemd/system/rsyslog.*\.service -- gen_context(system_u:object_r:syslogd_unit_t,s0)
39+/usr/lib/systemd/system/syslog.*\.service -- gen_context(system_u:object_r:syslogd_unit_t,s0)
40 /usr/lib/systemd/systemd-journald -- gen_context(system_u:object_r:syslogd_exec_t,s0)
41 /usr/lib/systemd/systemd-kmsg-syslogd -- gen_context(system_u:object_r:syslogd_exec_t,s0)
42
43diff --git a/policy/modules/system/logging.if b/policy/modules/system/logging.if
44index 9bb3afdb2..7233a108c 100644
45--- a/policy/modules/system/logging.if
46+++ b/policy/modules/system/logging.if
47@@ -661,6 +661,7 @@ interface(`logging_send_syslog_msg',`
48 ')
49
50 allow $1 devlog_t:sock_file write_sock_file_perms;
51+ allow $1 devlog_t:lnk_file read_lnk_file_perms;
52
53 # systemd journal socket is in /run/systemd/journal/dev-log
54 init_search_run($1)
55@@ -722,6 +723,7 @@ interface(`logging_relabelto_devlog_sock_files',`
56 ')
57
58 allow $1 devlog_t:sock_file relabelto_sock_file_perms;
59+ allow $1 devlog_t:lnk_file relabelto_lnk_file_perms;
60 ')
61
62 ########################################
63@@ -741,6 +743,8 @@ interface(`logging_create_devlog',`
64
65 allow $1 devlog_t:sock_file manage_sock_file_perms;
66 dev_filetrans($1, devlog_t, sock_file)
67+ allow $1 devlog_t:lnk_file manage_lnk_file_perms;
68+ dev_filetrans($1, devlog_t, lnk_file)
69 init_runtime_filetrans($1, devlog_t, sock_file, "syslog")
70 ')
71
72diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te
73index 9b3254f63..d864cfd3d 100644
74--- a/policy/modules/system/logging.te
75+++ b/policy/modules/system/logging.te
76@@ -398,6 +398,7 @@ allow syslogd_t syslog_conf_t:dir list_dir_perms;
77
78 # Create and bind to /dev/log or /var/run/log.
79 allow syslogd_t devlog_t:sock_file manage_sock_file_perms;
80+allow syslogd_t devlog_t:lnk_file manage_lnk_file_perms;
81 files_runtime_filetrans(syslogd_t, devlog_t, sock_file)
82 init_runtime_filetrans(syslogd_t, devlog_t, sock_file, "dev-log")
83
84--
852.17.1
86
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 @@
1From bd77e8e51962bb6a8c5708f3e5362007c915498e Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Thu, 4 Feb 2021 10:48:54 +0800
4Subject: [PATCH] policy/modules/system/systemd: support systemd --user
5
6Fixes:
7$ systemctl status user@0.service
8* user@0.service - User Manager for UID 0
9 Loaded: loaded (/lib/systemd/system/user@.service; static)
10 Active: failed (Result: exit-code) since Thu 2021-02-04 02:57:32 UTC; 11s ago
11 Docs: man:user@.service(5)
12 Process: 1502 ExecStart=/lib/systemd/systemd --user (code=exited, status=1/FAILURE)
13 Main PID: 1502 (code=exited, status=1/FAILURE)
14
15Feb 04 02:57:32 intel-x86-64 systemd[1]: Starting User Manager for UID 0...
16Feb 04 02:57:32 intel-x86-64 systemd[1502]: selinux_status_open() failed to open the status page, using the netlink fallback.
17Feb 04 02:57:32 intel-x86-64 systemd[1502]: Failed to initialize SELinux labeling handle: Permission denied
18Feb 04 02:57:32 intel-x86-64 systemd[1]: user@0.service: Main process exited, code=exited, status=1/FAILURE
19Feb 04 02:57:32 intel-x86-64 systemd[1]: user@0.service: Failed with result 'exit-code'.
20Feb 04 02:57:32 intel-x86-64 systemd[1]: Failed to start User Manager for UID 0.
21
22Upstream-Status: Inappropriate [embedded specific]
23
24Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
25---
26 policy/modules/roles/sysadm.te | 2 +
27 policy/modules/system/init.if | 1 +
28 policy/modules/system/logging.te | 5 ++-
29 policy/modules/system/systemd.if | 75 +++++++++++++++++++++++++++++++-
30 4 files changed, 81 insertions(+), 2 deletions(-)
31
32diff --git a/policy/modules/roles/sysadm.te b/policy/modules/roles/sysadm.te
33index 1642f3b93..1de7e441d 100644
34--- a/policy/modules/roles/sysadm.te
35+++ b/policy/modules/roles/sysadm.te
36@@ -81,6 +81,8 @@ ifdef(`init_systemd',`
37 # Allow sysadm to resolve the username of dynamic users by calling
38 # LookupDynamicUserByUID on org.freedesktop.systemd1.
39 init_dbus_chat(sysadm_t)
40+
41+ systemd_sysadm_user(sysadm_t)
42 ')
43
44 tunable_policy(`allow_ptrace',`
45diff --git a/policy/modules/system/init.if b/policy/modules/system/init.if
46index ba533ba1a..98e94283f 100644
47--- a/policy/modules/system/init.if
48+++ b/policy/modules/system/init.if
49@@ -943,6 +943,7 @@ interface(`init_unix_stream_socket_connectto',`
50 ')
51
52 allow $1 init_t:unix_stream_socket connectto;
53+ allow $1 initrc_t:unix_stream_socket connectto;
54 ')
55
56 ########################################
57diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te
58index d864cfd3d..bdd97631c 100644
59--- a/policy/modules/system/logging.te
60+++ b/policy/modules/system/logging.te
61@@ -519,7 +519,7 @@ ifdef(`init_systemd',`
62 # for systemd-journal
63 allow syslogd_t self:netlink_audit_socket connected_socket_perms;
64 allow syslogd_t self:capability2 audit_read;
65- allow syslogd_t self:capability { chown setgid setuid sys_ptrace };
66+ allow syslogd_t self:capability { chown setgid setuid sys_ptrace dac_read_search };
67 allow syslogd_t self:netlink_audit_socket { getattr getopt read setopt write nlmsg_write };
68
69 # remove /run/log/journal when switching to permanent storage
70@@ -555,6 +555,9 @@ ifdef(`init_systemd',`
71 systemd_manage_journal_files(syslogd_t)
72
73 udev_read_runtime_files(syslogd_t)
74+
75+ userdom_search_user_runtime(syslogd_t)
76+ systemd_search_user_runtime(syslogd_t)
77 ')
78
79 ifdef(`distro_gentoo',`
80diff --git a/policy/modules/system/systemd.if b/policy/modules/system/systemd.if
81index 6a66a2d79..152139261 100644
82--- a/policy/modules/system/systemd.if
83+++ b/policy/modules/system/systemd.if
84@@ -30,6 +30,7 @@ template(`systemd_role_template',`
85 attribute systemd_user_session_type, systemd_log_parse_env_type;
86 type systemd_user_runtime_t, systemd_user_runtime_notify_t;
87 type systemd_run_exec_t, systemd_analyze_exec_t;
88+ type session_dbusd_runtime_t, systemd_user_runtime_dir_t;
89 ')
90
91 #################################
92@@ -55,10 +56,42 @@ template(`systemd_role_template',`
93
94 allow $3 systemd_user_runtime_notify_t:sock_file { manage_sock_file_perms relabel_sock_file_perms };
95
96+ allow $1_systemd_t systemd_user_runtime_t:dir { manage_dir_perms relabel_dir_perms };
97+ allow $1_systemd_t systemd_user_runtime_t:file { manage_file_perms relabel_file_perms };
98+ allow $1_systemd_t systemd_user_runtime_t:lnk_file { manage_lnk_file_perms relabel_lnk_file_perms };
99+ allow $1_systemd_t systemd_user_runtime_t:fifo_file { manage_fifo_file_perms relabel_fifo_file_perms };
100+ allow $1_systemd_t systemd_user_runtime_t:sock_file { manage_sock_file_perms relabel_sock_file_perms };
101+ allow $1_systemd_t systemd_user_runtime_t:blk_file { manage_blk_file_perms relabel_blk_file_perms };
102+ allow $1_systemd_t systemd_user_runtime_t:chr_file { manage_chr_file_perms relabel_chr_file_perms };
103+ allow $1_systemd_t systemd_user_runtime_notify_t:sock_file { manage_sock_file_perms relabel_sock_file_perms };
104+ allow $1_systemd_t session_dbusd_runtime_t:sock_file { manage_sock_file_perms relabel_sock_file_perms };
105+ allow $1_systemd_t self:netlink_kobject_uevent_socket getopt;
106+ allow $1_systemd_t self:process setrlimit;
107+
108+ kernel_getattr_proc($1_systemd_t)
109+ fs_watch_cgroup_files($1_systemd_t)
110+ files_watch_etc_dirs($1_systemd_t)
111+
112+ userdom_search_user_home_dirs($1_systemd_t)
113+ allow $1_systemd_t $3:dir search_dir_perms;
114+ allow $1_systemd_t $3:file read_file_perms;
115+
116+ allow $3 $1_systemd_t:unix_stream_socket { getattr read write };
117+
118+ allow systemd_user_runtime_dir_t systemd_user_runtime_t:dir { manage_dir_perms relabel_dir_perms };
119+ allow systemd_user_runtime_dir_t systemd_user_runtime_t:file { manage_file_perms relabel_file_perms };
120+ allow systemd_user_runtime_dir_t systemd_user_runtime_t:lnk_file { manage_lnk_file_perms relabel_lnk_file_perms };
121+ allow systemd_user_runtime_dir_t systemd_user_runtime_t:fifo_file { manage_fifo_file_perms relabel_fifo_file_perms };
122+ allow systemd_user_runtime_dir_t systemd_user_runtime_t:sock_file { manage_sock_file_perms relabel_sock_file_perms };
123+ allow systemd_user_runtime_dir_t systemd_user_runtime_t:blk_file { manage_blk_file_perms relabel_blk_file_perms };
124+ allow systemd_user_runtime_dir_t systemd_user_runtime_t:chr_file { manage_chr_file_perms relabel_chr_file_perms };
125+ allow systemd_user_runtime_dir_t systemd_user_runtime_notify_t:sock_file { manage_sock_file_perms relabel_sock_file_perms };
126+ allow systemd_user_runtime_dir_t session_dbusd_runtime_t:sock_file { manage_sock_file_perms relabel_sock_file_perms };
127+
128 # This domain is per-role because of the below transitions.
129 # See the systemd --user section of systemd.te for the
130 # remainder of the rules.
131- allow $1_systemd_t $3:process { setsched rlimitinh };
132+ allow $1_systemd_t $3:process { setsched rlimitinh noatsecure siginh };
133 corecmd_shell_domtrans($1_systemd_t, $3)
134 corecmd_bin_domtrans($1_systemd_t, $3)
135 allow $1_systemd_t self:process signal;
136@@ -479,6 +512,7 @@ interface(`systemd_stream_connect_userdb', `
137 init_search_runtime($1)
138 allow $1 systemd_userdb_runtime_t:dir list_dir_perms;
139 allow $1 systemd_userdb_runtime_t:sock_file write_sock_file_perms;
140+ allow $1 systemd_userdb_runtime_t:lnk_file read_lnk_file_perms;
141 init_unix_stream_socket_connectto($1)
142 ')
143
144@@ -1353,3 +1387,42 @@ interface(`systemd_use_inherited_machined_ptys', `
145 allow $1 systemd_machined_t:fd use;
146 allow $1 systemd_machined_devpts_t:chr_file rw_inherited_term_perms;
147 ')
148+
149+#########################################
150+## <summary>
151+## sysadm user for systemd --user
152+## </summary>
153+## <param name="role">
154+## <summary>
155+## Role allowed access.
156+## </summary>
157+## </param>
158+#
159+interface(`systemd_sysadm_user',`
160+ gen_require(`
161+ type sysadm_systemd_t;
162+ ')
163+
164+ allow sysadm_systemd_t self:capability { mknod sys_admin };
165+ allow sysadm_systemd_t self:capability2 { bpf perfmon };
166+ allow $1 sysadm_systemd_t:system reload;
167+')
168+
169+#######################################
170+## <summary>
171+## Search systemd users runtime directories.
172+## </summary>
173+## <param name="domain">
174+## <summary>
175+## Domain allowed access.
176+## </summary>
177+## </param>
178+#
179+interface(`systemd_search_user_runtime',`
180+ gen_require(`
181+ type systemd_user_runtime_t;
182+ ')
183+
184+ allow $1 systemd_user_runtime_t:dir search_dir_perms;
185+ allow $1 systemd_user_runtime_t:lnk_file read_lnk_file_perms;
186+')
187--
1882.17.1
189
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 @@
1From e10a4ea43bb756bdecc30a3c14f0d2fe980405bd Mon Sep 17 00:00:00 2001
2From: Wenzong Fan <wenzong.fan@windriver.com>
3Date: Thu, 4 Feb 2016 02:10:15 -0500
4Subject: [PATCH] policy/modules/system/logging: fix systemd-journald startup
5 failures
6
7Fixes:
8avc: denied { search } for pid=233 comm="systemd-journal" name="/"
9dev="tmpfs" ino=12398 scontext=system_u:system_r:syslogd_t
10tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=0
11
12avc: denied { nlmsg_write } for pid=110 comm="systemd-journal"
13scontext=system_u:system_r:syslogd_t
14tcontext=system_u:system_r:syslogd_t tclass=netlink_audit_socket
15permissive=0
16
17avc: denied { audit_control } for pid=109 comm="systemd-journal"
18capability=30 scontext=system_u:system_r:syslogd_t
19tcontext=system_u:system_r:syslogd_t tclass=capability permissive=0
20
21Upstream-Status: Inappropriate [embedded specific]
22
23Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
24Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
25---
26 policy/modules/system/logging.fc | 1 +
27 policy/modules/system/logging.te | 5 ++++-
28 2 files changed, 5 insertions(+), 1 deletion(-)
29
30diff --git a/policy/modules/system/logging.fc b/policy/modules/system/logging.fc
31index a4ecd570a..dee26a9f4 100644
32--- a/policy/modules/system/logging.fc
33+++ b/policy/modules/system/logging.fc
34@@ -24,6 +24,7 @@
35 /usr/lib/systemd/system/auditd.* -- gen_context(system_u:object_r:auditd_unit_t,s0)
36 /usr/lib/systemd/system/[^/]*systemd-journal.* -- gen_context(system_u:object_r:syslogd_unit_t,s0)
37 /usr/lib/systemd/system/rsyslog.*\.service -- gen_context(system_u:object_r:syslogd_unit_t,s0)
38+/usr/lib/systemd/system/syslog.*\.service -- gen_context(system_u:object_r:syslogd_unit_t,s0)
39 /usr/lib/systemd/systemd-journald -- gen_context(system_u:object_r:syslogd_exec_t,s0)
40 /usr/lib/systemd/systemd-kmsg-syslogd -- gen_context(system_u:object_r:syslogd_exec_t,s0)
41
42diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te
43index 95309f334..1d45a5fa9 100644
44--- a/policy/modules/system/logging.te
45+++ b/policy/modules/system/logging.te
46@@ -438,6 +438,7 @@ allow syslogd_t syslogd_runtime_t:sock_file { create setattr unlink };
47 allow syslogd_t syslogd_runtime_t:file map;
48 manage_files_pattern(syslogd_t, syslogd_runtime_t, syslogd_runtime_t)
49 files_runtime_filetrans(syslogd_t, syslogd_runtime_t, file)
50+fs_search_tmpfs(syslogd_t)
51
52 kernel_read_crypto_sysctls(syslogd_t)
53 kernel_read_system_state(syslogd_t)
54@@ -517,6 +518,8 @@ init_use_fds(syslogd_t)
55 # cjp: this doesnt make sense
56 logging_send_syslog_msg(syslogd_t)
57
58+logging_set_loginuid(syslogd_t)
59+
60 miscfiles_read_localization(syslogd_t)
61
62 seutil_read_config(syslogd_t)
63@@ -529,7 +532,7 @@ ifdef(`init_systemd',`
64 allow syslogd_t self:netlink_audit_socket connected_socket_perms;
65 allow syslogd_t self:capability2 audit_read;
66 allow syslogd_t self:capability { chown setgid setuid sys_ptrace };
67- allow syslogd_t self:netlink_audit_socket { getattr getopt read setopt write };
68+ allow syslogd_t self:netlink_audit_socket { getattr getopt read setopt write nlmsg_write };
69
70 # remove /run/log/journal when switching to permanent storage
71 allow syslogd_t var_log_t:dir rmdir;
72--
732.17.1
74
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 @@
1From 954a49ec0a4dc64fd9e513abe7a737d956b337ca Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Tue, 9 Feb 2021 17:50:24 +0800
4Subject: [PATCH] policy/modules/system/systemd: allow systemd-generators to
5 get the attributes of tmpfs and cgroup
6
7* Allow systemd-generators to get the attributes of a tmpfs
8* Allow systemd-generators to get the attributes of cgroup filesystems
9
10Fixes:
11systemd[95]: /lib/systemd/system-generators/systemd-fstab-generator failed with exit status 1.
12
13avc: denied { getattr } for pid=102 comm="systemd-run-gen" name="/"
14dev="tmpfs" ino=11208 scontext=system_u:system_r:systemd_generator_t
15tcontext=system_u:object_r:tmpfs_t tclass=filesystem permissive=0
16
17avc: denied { getattr } for pid=98 comm="systemd-getty-g" name="/"
18dev="tmpfs" ino=11208 scontext=system_u:system_r:systemd_generator_t
19tcontext=system_u:object_r:tmpfs_t tclass=filesystem permissive=0
20
21avc: denied { getattr } for pid=104 comm="systemd-sysv-ge" name="/"
22dev="tmpfs" ino=11208 scontext=system_u:system_r:systemd_generator_t
23tcontext=system_u:object_r:tmpfs_t tclass=filesystem permissive=0
24
25avc: denied { getattr } for pid=97 comm="systemd-fstab-g" name="/"
26dev="tmpfs" ino=11208 scontext=system_u:system_r:systemd_generator_t
27tcontext=system_u:object_r:tmpfs_t tclass=filesystem permissive=0
28
29avc: denied { getattr } for pid=102 comm="systemd-run-gen" name="/"
30dev="cgroup" ino=1 scontext=system_u:system_r:systemd_generator_t
31tcontext=system_u:object_r:cgroup_t tclass=filesystem permissive=0
32
33avc: denied { getattr } for pid=100 comm="systemd-hiberna" name="/"
34dev="cgroup" ino=1 scontext=system_u:system_r:systemd_generator_t
35tcontext=system_u:object_r:cgroup_t tclass=filesystem permissive=0
36
37avc: denied { getattr } for pid=99 comm="systemd-gpt-aut" name="/"
38dev="cgroup2" ino=1 scontext=system_u:system_r:systemd_generator_t
39tcontext=system_u:object_r:cgroup_t tclass=filesystem permissive=0
40
41avc: denied { getattr } for pid=97 comm="systemd-fstab-g"
42path="/var/volatile" dev="vda" ino=37131
43scontext=system_u:system_r:systemd_generator_t
44tcontext=system_u:object_r:unlabeled_t tclass=dir permissive=0
45
46Upstream-Status: Inappropriate [embedded specific]
47
48Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
49---
50 policy/modules/system/systemd.te | 3 +++
51 1 file changed, 3 insertions(+)
52
53diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
54index 2d9d7d331..c1111198d 100644
55--- a/policy/modules/system/systemd.te
56+++ b/policy/modules/system/systemd.te
57@@ -431,6 +431,9 @@ files_list_usr(systemd_generator_t)
58
59 fs_list_efivars(systemd_generator_t)
60 fs_getattr_xattr_fs(systemd_generator_t)
61+fs_getattr_tmpfs(systemd_generator_t)
62+fs_getattr_cgroup(systemd_generator_t)
63+kernel_getattr_unlabeled_dirs(systemd_generator_t)
64
65 init_create_runtime_files(systemd_generator_t)
66 init_manage_runtime_dirs(systemd_generator_t)
67--
682.17.1
69
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 @@
1From 8b0bb1e349e2ea021acec1639be0802ac4d7d0c2 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Thu, 4 Feb 2021 15:13:50 +0800
4Subject: [PATCH] policy/modules/system/systemd: allow systemd_backlight_t to
5 read kernel sysctl
6
7Fixes:
8avc: denied { search } for pid=354 comm="systemd-backlig" name="sys"
9dev="proc" ino=4026531854
10scontext=system_u:system_r:systemd_backlight_t:s0-s15:c0.c1023
11tcontext=system_u:object_r:sysctl_t:s0 tclass=dir permissive=0
12
13Upstream-Status: Inappropriate [embedded specific]
14
15Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
16---
17 policy/modules/system/systemd.te | 2 ++
18 1 file changed, 2 insertions(+)
19
20diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
21index c1111198d..7d2ba2796 100644
22--- a/policy/modules/system/systemd.te
23+++ b/policy/modules/system/systemd.te
24@@ -324,6 +324,8 @@ udev_read_runtime_files(systemd_backlight_t)
25
26 files_search_var_lib(systemd_backlight_t)
27
28+kernel_read_kernel_sysctls(systemd_backlight_t)
29+
30 #######################################
31 #
32 # Binfmt local policy
33--
342.17.1
35
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 @@
1From 5973dc3824b395ce9f6620e3ae432664cc357b66 Mon Sep 17 00:00:00 2001
2From: Wenzong Fan <wenzong.fan@windriver.com>
3Date: Thu, 4 Feb 2016 02:10:15 -0500
4Subject: [PATCH] policy/modules/system/logging: fix systemd-journald startup
5 failures
6
7Fixes:
8avc: denied { audit_control } for pid=109 comm="systemd-journal"
9capability=30 scontext=system_u:system_r:syslogd_t
10tcontext=system_u:system_r:syslogd_t tclass=capability permissive=0
11
12avc: denied { search } for pid=233 comm="systemd-journal" name="/"
13dev="tmpfs" ino=12398 scontext=system_u:system_r:syslogd_t
14tcontext=system_u:object_r:tmpfs_t tclass=dir permissive=0
15
16Upstream-Status: Inappropriate [embedded specific]
17
18Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
19Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
20---
21 policy/modules/system/logging.te | 3 +++
22 1 file changed, 3 insertions(+)
23
24diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te
25index bdd97631c..62caa7a56 100644
26--- a/policy/modules/system/logging.te
27+++ b/policy/modules/system/logging.te
28@@ -492,6 +492,7 @@ files_var_lib_filetrans(syslogd_t, syslogd_var_lib_t, { file dir })
29
30 fs_getattr_all_fs(syslogd_t)
31 fs_search_auto_mountpoints(syslogd_t)
32+fs_search_tmpfs(syslogd_t)
33
34 mls_file_write_all_levels(syslogd_t) # Need to be able to write to /var/run/ and /var/log directories
35
36@@ -552,6 +553,8 @@ ifdef(`init_systemd',`
37 # needed for systemd-initrd case when syslog socket is unlabelled
38 logging_send_syslog_msg(syslogd_t)
39
40+ logging_set_loginuid(syslogd_t)
41+
42 systemd_manage_journal_files(syslogd_t)
43
44 udev_read_runtime_files(syslogd_t)
45--
462.17.1
47
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 @@
1From 4782b27839064438f103b77c31e5db75189025a8 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Thu, 18 Jun 2020 16:14:45 +0800
4Subject: [PATCH] policy/modules/system/systemd: add capability mknod for
5 systemd_user_runtime_dir_t
6
7Fixes:
8avc: denied { mknod } for pid=266 comm="systemd-user-ru" capability=27
9scontext=system_u:system_r:systemd_user_runtime_dir_t:s0-s15:c0.c1023
10tcontext=system_u:system_r:systemd_user_runtime_dir_t:s0-s15:c0.c1023
11tclass=capability permissive=0
12
13Upstream-Status: Inappropriate [embedded specific]
14
15Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
16---
17 policy/modules/system/systemd.te | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-)
19
20diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
21index c7fe51b62..f82031a09 100644
22--- a/policy/modules/system/systemd.te
23+++ b/policy/modules/system/systemd.te
24@@ -1372,7 +1372,7 @@ seutil_libselinux_linked(systemd_user_session_type)
25 # systemd-user-runtime-dir local policy
26 #
27
28-allow systemd_user_runtime_dir_t self:capability { fowner chown sys_admin dac_read_search dac_override };
29+allow systemd_user_runtime_dir_t self:capability { fowner chown sys_admin dac_read_search dac_override mknod };
30 allow systemd_user_runtime_dir_t self:process setfscreate;
31
32 domain_obj_id_change_exemption(systemd_user_runtime_dir_t)
33--
342.17.1
35
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 @@
1From e8ff96c9bb98305d1b50fccce67025df3ebbf184 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Thu, 23 May 2019 15:52:17 +0800
4Subject: [PATCH] policy/modules/services/cron: allow crond_t to search
5 logwatch_cache_t
6
7Fixes:
8avc: denied { search } for pid=234 comm="crond" name="logcheck"
9dev="vda" ino=29080 scontext=system_u:system_r:crond_t:s0-s15:c0.c1023
10tcontext=system_u:object_r:logwatch_cache_t:s0 tclass=dir permissive=0
11
12Upstream-Status: Inappropriate [embedded specific]
13
14Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
15---
16 policy/modules/services/cron.te | 2 ++
17 1 file changed, 2 insertions(+)
18
19diff --git a/policy/modules/services/cron.te b/policy/modules/services/cron.te
20index 2902820b0..36eb33060 100644
21--- a/policy/modules/services/cron.te
22+++ b/policy/modules/services/cron.te
23@@ -318,6 +318,8 @@ miscfiles_read_localization(crond_t)
24
25 userdom_list_user_home_dirs(crond_t)
26
27+logwatch_search_cache_dir(crond_t)
28+
29 tunable_policy(`cron_userdomain_transition',`
30 dontaudit crond_t cronjob_t:process transition;
31 dontaudit crond_t cronjob_t:fd use;
32--
332.17.1
34
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 @@
1From 0607a935759fe3143f473d4a444f92e01aaa2a45 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Tue, 23 Jun 2020 14:52:43 +0800
4Subject: [PATCH] policy/modules/system/systemd: systemd-gpt-auto-generator: do
5 not audit attempts to read or write unallocated ttys
6
7Fixes:
8avc: denied { read write } for pid=87 comm="systemd-getty-g"
9name="ttyS0" dev="devtmpfs" ino=10128
10scontext=system_u:system_r:systemd_generator_t
11tcontext=system_u:object_r:tty_device_t tclass=chr_file permissive=0
12
13Upstream-Status: Inappropriate [embedded specific]
14
15Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
16---
17 policy/modules/system/systemd.te | 2 ++
18 1 file changed, 2 insertions(+)
19
20diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
21index f82031a09..fb8d4960f 100644
22--- a/policy/modules/system/systemd.te
23+++ b/policy/modules/system/systemd.te
24@@ -400,6 +400,8 @@ storage_raw_read_fixed_disk(systemd_generator_t)
25
26 systemd_log_parse_environment(systemd_generator_t)
27
28+term_dontaudit_use_unallocated_ttys(systemd_generator_t)
29+
30 optional_policy(`
31 fstools_exec(systemd_generator_t)
32 ')
33--
342.17.1
35
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 @@
1From 1571e6da8a90bb325a94330dcd130d56bae30b37 Mon Sep 17 00:00:00 2001
2From: Roy Li <rongqing.li@windriver.com>
3Date: Thu, 20 Feb 2014 17:07:05 +0800
4Subject: [PATCH] policy/modules/services/crontab: allow sysadm_r to run
5 crontab
6
7This permission has been given if release is not redhat; but we want it
8even we define distro_redhat
9
10Upstream-Status: Inappropriate [embedded specific]
11
12Signed-off-by: Roy Li <rongqing.li@windriver.com>
13Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
14---
15 policy/modules/roles/sysadm.te | 8 ++++----
16 1 file changed, 4 insertions(+), 4 deletions(-)
17
18diff --git a/policy/modules/roles/sysadm.te b/policy/modules/roles/sysadm.te
19index 1de7e441d..129e94229 100644
20--- a/policy/modules/roles/sysadm.te
21+++ b/policy/modules/roles/sysadm.te
22@@ -1277,6 +1277,10 @@ optional_policy(`
23 zebra_admin(sysadm_t, sysadm_r)
24 ')
25
26+optional_policy(`
27+ cron_admin_role(sysadm_r, sysadm_t)
28+')
29+
30 ifndef(`distro_redhat',`
31 optional_policy(`
32 auth_role(sysadm_r, sysadm_t)
33@@ -1295,10 +1299,6 @@ ifndef(`distro_redhat',`
34 chromium_role(sysadm_r, sysadm_t)
35 ')
36
37- optional_policy(`
38- cron_admin_role(sysadm_r, sysadm_t)
39- ')
40-
41 optional_policy(`
42 cryfs_role(sysadm_r, sysadm_t)
43 ')
44--
452.17.1
46
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 @@
1From ab462f0022c35fde984dbe792ce386f5d507aeeb Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Thu, 24 Sep 2020 14:05:52 +0800
4Subject: [PATCH] policy/modules/system/sysnetwork: support priviledge
5 separation for dhcpcd
6
7Fixes:
8
9avc: denied { sys_chroot } for pid=332 comm="dhcpcd" capability=18
10scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
11tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023 tclass=capability
12permissive=0
13
14avc: denied { setgid } for pid=332 comm="dhcpcd" capability=6
15scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
16tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023 tclass=capability
17permissive=0
18
19avc: denied { setuid } for pid=332 comm="dhcpcd" capability=7
20scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
21tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023 tclass=capability
22permissive=0
23
24avc: denied { setrlimit } for pid=332 comm="dhcpcd"
25scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
26tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023 tclass=process
27permissive=0
28
29avc: denied { create } for pid=330 comm="dhcpcd"
30scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
31tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
32tclass=netlink_kobject_uevent_socket permissive=0
33
34avc: denied { setopt } for pid=330 comm="dhcpcd"
35scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
36tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
37tclass=netlink_kobject_uevent_socket permissive=0
38
39avc: denied { bind } for pid=330 comm="dhcpcd"
40scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
41tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
42tclass=netlink_kobject_uevent_socket permissive=0
43
44avc: denied { getattr } for pid=330 comm="dhcpcd"
45scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
46tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
47tclass=netlink_kobject_uevent_socket permissive=0
48
49avc: denied { read } for pid=330 comm="dhcpcd" name="n1" dev="tmpfs"
50ino=15616 scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
51tcontext=system_u:object_r:udev_runtime_t:s0 tclass=file permissive=0
52
53avc: denied { open } for pid=330 comm="dhcpcd"
54path="/run/udev/data/n1" dev="tmpfs" ino=15616
55scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
56tcontext=system_u:object_r:udev_runtime_t:s0 tclass=file permissive=0
57
58avc: denied { getattr } for pid=330 comm="dhcpcd"
59path="/run/udev/data/n1" dev="tmpfs" ino=15616
60scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
61tcontext=system_u:object_r:udev_runtime_t:s0 tclass=file permissive=0
62
63avc: denied { connectto } for pid=1600 comm="dhcpcd"
64path="/run/dhcpcd/unpriv.sock"
65scontext=root:sysadm_r:dhcpc_t:s0-s15:c0.c1023
66tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
67tclass=unix_stream_socket permissive=0
68
69avc: denied { kill } for pid=314 comm="dhcpcd" capability=5
70scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
71tcontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023 tclass=capability
72permissive=0
73
74avc: denied { getattr } for pid=300 comm="dhcpcd"
75path="net:[4026532008]" dev="nsfs" ino=4026532008
76scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
77tcontext=system_u:object_r:nsfs_t:s0 tclass=file permissive=0
78
79Upstream-Status: Inappropriate [embedded specific]
80
81Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
82---
83 policy/modules/system/sysnetwork.te | 7 +++++++
84 1 file changed, 7 insertions(+)
85
86diff --git a/policy/modules/system/sysnetwork.te b/policy/modules/system/sysnetwork.te
87index cb1434180..a9297f976 100644
88--- a/policy/modules/system/sysnetwork.te
89+++ b/policy/modules/system/sysnetwork.te
90@@ -72,6 +72,11 @@ allow dhcpc_t self:netlink_route_socket create_netlink_socket_perms;
91 allow dhcpc_t self:rawip_socket create_socket_perms;
92 allow dhcpc_t self:unix_dgram_socket { create_socket_perms sendto };
93
94+allow dhcpc_t self:capability { setgid setuid sys_chroot kill };
95+allow dhcpc_t self:netlink_kobject_uevent_socket create_socket_perms;
96+allow dhcpc_t self:process setrlimit;
97+allow dhcpc_t self:unix_stream_socket connectto;
98+
99 allow dhcpc_t dhcp_etc_t:dir list_dir_perms;
100 read_lnk_files_pattern(dhcpc_t, dhcp_etc_t, dhcp_etc_t)
101 exec_files_pattern(dhcpc_t, dhcp_etc_t, dhcp_etc_t)
102@@ -145,6 +150,7 @@ files_manage_var_files(dhcpc_t)
103 fs_getattr_all_fs(dhcpc_t)
104 fs_search_auto_mountpoints(dhcpc_t)
105 fs_search_cgroup_dirs(dhcpc_t)
106+fs_read_nsfs_files(dhcpc_t)
107
108 term_dontaudit_use_all_ttys(dhcpc_t)
109 term_dontaudit_use_all_ptys(dhcpc_t)
110@@ -180,6 +186,7 @@ ifdef(`init_systemd',`
111 init_stream_connect(dhcpc_t)
112 init_get_all_units_status(dhcpc_t)
113 init_search_units(dhcpc_t)
114+ udev_read_runtime_files(dhcpc_t)
115 ')
116
117 optional_policy(`
118--
1192.17.1
120
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 @@
1From 7418cd97f2c92579bd4d18cbd9063f811ff9a81e Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Tue, 9 Feb 2021 16:42:36 +0800
4Subject: [PATCH] policy/modules/services/acpi: allow acpid to watch the
5 directories in /dev
6
7Fixes:
8acpid: inotify_add_watch() failed: Permission denied (13)
9
10avc: denied { watch } for pid=269 comm="acpid" path="/dev/input"
11dev="devtmpfs" ino=35 scontext=system_u:system_r:acpid_t:s0-s15:c0.c1023
12tcontext=system_u:object_r:device_t:s0 tclass=dir permissive=0
13
14Upstream-Status: Inappropriate [embedded specific]
15
16Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
17---
18 policy/modules/services/acpi.te | 1 +
19 1 file changed, 1 insertion(+)
20
21diff --git a/policy/modules/services/acpi.te b/policy/modules/services/acpi.te
22index 69f1dab4a..5c22adecd 100644
23--- a/policy/modules/services/acpi.te
24+++ b/policy/modules/services/acpi.te
25@@ -105,6 +105,7 @@ dev_rw_acpi_bios(acpid_t)
26 dev_rw_sysfs(acpid_t)
27 dev_dontaudit_getattr_all_chr_files(acpid_t)
28 dev_dontaudit_getattr_all_blk_files(acpid_t)
29+dev_watch_dev_dirs(acpid_t)
30
31 files_exec_etc_files(acpid_t)
32 files_read_etc_runtime_files(acpid_t)
33--
342.17.1
35
diff --git a/recipes-security/refpolicy/refpolicy/0063-policy-modules-system-setrans-allow-setrans-to-acces.patch b/recipes-security/refpolicy/refpolicy/0062-policy-modules-system-setrans-allow-setrans-to-acces.patch
index 55d92f0..b692012 100644
--- a/recipes-security/refpolicy/refpolicy/0063-policy-modules-system-setrans-allow-setrans-to-acces.patch
+++ b/recipes-security/refpolicy/refpolicy/0062-policy-modules-system-setrans-allow-setrans-to-acces.patch
@@ -1,4 +1,4 @@
1From fc77db62ce54a33ee04bfc3e4c68b9cbed7251c6 Mon Sep 17 00:00:00 2001 1From 84c69d220ffdd039b88a34f9afc127274a985541 Mon Sep 17 00:00:00 2001
2From: Roy Li <rongqing.li@windriver.com> 2From: Roy Li <rongqing.li@windriver.com>
3Date: Sat, 22 Feb 2014 13:35:38 +0800 3Date: Sat, 22 Feb 2014 13:35:38 +0800
4Subject: [PATCH] policy/modules/system/setrans: allow setrans to access 4Subject: [PATCH] policy/modules/system/setrans: allow setrans to access
@@ -14,18 +14,16 @@ scontext=root:sysadm_r:sysadm_t:s0-s15:c0.c1023
14tcontext=system_u:system_r:setrans_t:s15:c0.c1023 14tcontext=system_u:system_r:setrans_t:s15:c0.c1023
15tclass=unix_stream_socket 15tclass=unix_stream_socket
16 16
173. allow setrans_t use fd at any level
18
19Upstream-Status: Inappropriate [embedded specific] 17Upstream-Status: Inappropriate [embedded specific]
20 18
21Signed-off-by: Roy Li <rongqing.li@windriver.com> 19Signed-off-by: Roy Li <rongqing.li@windriver.com>
22Signed-off-by: Yi Zhao <yi.zhao@windriver.com> 20Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
23--- 21---
24 policy/modules/system/setrans.te | 6 +++--- 22 policy/modules/system/setrans.te | 4 +---
25 1 file changed, 3 insertions(+), 3 deletions(-) 23 1 file changed, 1 insertion(+), 3 deletions(-)
26 24
27diff --git a/policy/modules/system/setrans.te b/policy/modules/system/setrans.te 25diff --git a/policy/modules/system/setrans.te b/policy/modules/system/setrans.te
28index 5f020ef78..7f618f212 100644 26index 25aadfc5f..78bd6e2eb 100644
29--- a/policy/modules/system/setrans.te 27--- a/policy/modules/system/setrans.te
30+++ b/policy/modules/system/setrans.te 28+++ b/policy/modules/system/setrans.te
31@@ -23,9 +23,7 @@ mls_trusted_object(setrans_runtime_t) 29@@ -23,9 +23,7 @@ mls_trusted_object(setrans_runtime_t)
@@ -39,15 +37,6 @@ index 5f020ef78..7f618f212 100644
39 37
40 ifdef(`enable_mcs',` 38 ifdef(`enable_mcs',`
41 init_ranged_daemon_domain(setrans_t, setrans_exec_t, s0 - mcs_systemhigh) 39 init_ranged_daemon_domain(setrans_t, setrans_exec_t, s0 - mcs_systemhigh)
42@@ -73,6 +71,8 @@ mls_net_receive_all_levels(setrans_t)
43 mls_socket_write_all_levels(setrans_t)
44 mls_process_read_all_levels(setrans_t)
45 mls_socket_read_all_levels(setrans_t)
46+mls_fd_use_all_levels(setrans_t)
47+mls_trusted_object(setrans_t)
48
49 selinux_compute_access_vector(setrans_t)
50
51-- 40--
522.17.1 412.17.1
53 42
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 @@
1From 7002b4e33b949b474a0ce0b78a7f2e180dbbc9bb Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Tue, 9 Feb 2021 17:31:55 +0800
4Subject: [PATCH] policy/modules/system/modutils: allow kmod_t to write keys
5
6Fixes:
7kernel: cfg80211: Problem loading in-kernel X.509 certificate (-13)
8
9avc: denied { write } for pid=219 comm="modprobe"
10scontext=system_u:system_r:kmod_t tcontext=system_u:system_r:kmod_t
11tclass=key permissive=0
12
13Upstream-Status: Inappropriate [embedded specific]
14
15Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
16---
17 policy/modules/system/modutils.te | 2 ++
18 1 file changed, 2 insertions(+)
19
20diff --git a/policy/modules/system/modutils.te b/policy/modules/system/modutils.te
21index ee249ae04..b8769bc02 100644
22--- a/policy/modules/system/modutils.te
23+++ b/policy/modules/system/modutils.te
24@@ -43,6 +43,8 @@ allow kmod_t self:rawip_socket create_socket_perms;
25
26 allow kmod_t self:lockdown confidentiality;
27
28+allow kmod_t self:key write;
29+
30 # Read module config and dependency information
31 list_dirs_pattern(kmod_t, modules_conf_t, modules_conf_t)
32 read_files_pattern(kmod_t, modules_conf_t, modules_conf_t)
33--
342.17.1
35
diff --git a/recipes-security/refpolicy/refpolicy/0056-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
index 7cf3763..dbd1390 100644
--- a/recipes-security/refpolicy/refpolicy/0056-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
@@ -1,4 +1,4 @@
1From 7fd830d6b2c60dcf5b8ee0b2ff94436de63d5b8c Mon Sep 17 00:00:00 2001 1From 291d3329c280b6b8b70fcc3092ac4d3399936825 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Mon, 29 Jun 2020 10:32:25 +0800 3Date: Mon, 29 Jun 2020 10:32:25 +0800
4Subject: [PATCH] policy/modules/roles/sysadm: allow sysadm_t to watch runtime 4Subject: [PATCH] policy/modules/roles/sysadm: allow sysadm_t to watch runtime
@@ -11,21 +11,18 @@ Upstream-Status: Inappropriate [embedded specific]
11 11
12Signed-off-by: Yi Zhao <yi.zhao@windriver.com> 12Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
13--- 13---
14 policy/modules/roles/sysadm.te | 6 ++++++ 14 policy/modules/roles/sysadm.te | 3 +++
15 1 file changed, 6 insertions(+) 15 1 file changed, 3 insertions(+)
16 16
17diff --git a/policy/modules/roles/sysadm.te b/policy/modules/roles/sysadm.te 17diff --git a/policy/modules/roles/sysadm.te b/policy/modules/roles/sysadm.te
18index fc0945fe4..07b9faf30 100644 18index 129e94229..a4abaefe4 100644
19--- a/policy/modules/roles/sysadm.te 19--- a/policy/modules/roles/sysadm.te
20+++ b/policy/modules/roles/sysadm.te 20+++ b/policy/modules/roles/sysadm.te
21@@ -83,6 +83,12 @@ ifdef(`init_systemd',` 21@@ -83,6 +83,9 @@ ifdef(`init_systemd',`
22 # Allow sysadm to resolve the username of dynamic users by calling
23 # LookupDynamicUserByUID on org.freedesktop.systemd1.
24 init_dbus_chat(sysadm_t) 22 init_dbus_chat(sysadm_t)
23
24 systemd_sysadm_user(sysadm_t)
25+ 25+
26+ fs_watch_cgroup_files(sysadm_t)
27+ files_watch_etc_symlinks(sysadm_t)
28+ mount_watch_runtime_dirs(sysadm_t)
29+ systemd_filetrans_passwd_runtime_dirs(sysadm_t) 26+ systemd_filetrans_passwd_runtime_dirs(sysadm_t)
30+ allow sysadm_t systemd_passwd_runtime_t:dir watch; 27+ allow sysadm_t systemd_passwd_runtime_t:dir watch;
31 ') 28 ')
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 @@
1From bc821718f7e9575a67c4667decad937cbe5f8514 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Tue, 2 Mar 2021 14:25:03 +0800
4Subject: [PATCH] policy/modules/system/selinux: allow setfiles_t to read
5 kernel sysctl
6
7Fixes:
8avc: denied { read } for pid=171 comm="restorecon" name="cap_last_cap"
9dev="proc" ino=1241
10scontext=system_u:system_r:setfiles_t:s0-s15:c0.c1023
11tcontext=system_u:object_r:sysctl_kernel_t:s0 tclass=file permissive=0
12
13avc: denied { open } for pid=171 comm="restorecon"
14path="/proc/sys/kernel/cap_last_cap" dev="proc" ino=1241
15scontext=system_u:system_r:setfiles_t:s0-s15:c0.c1023
16tcontext=system_u:object_r:sysctl_kernel_t:s0 tclass=file permissive=0
17
18avc: denied { getattr } for pid=171 comm="restorecon" name="/"
19dev="proc" ino=1 scontext=system_u:system_r:setfiles_t:s0-s15:c0.c1023
20tcontext=system_u:object_r:proc_t:s0 tclass=filesystem permissive=0
21
22Upstream-Status: Inappropriate [embedded specific]
23
24Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
25---
26 policy/modules/system/selinuxutil.te | 2 ++
27 1 file changed, 2 insertions(+)
28
29diff --git a/policy/modules/system/selinuxutil.te b/policy/modules/system/selinuxutil.te
30index a505b3987..a26f8db03 100644
31--- a/policy/modules/system/selinuxutil.te
32+++ b/policy/modules/system/selinuxutil.te
33@@ -597,6 +597,8 @@ kernel_rw_unix_dgram_sockets(setfiles_t)
34 kernel_dontaudit_list_all_proc(setfiles_t)
35 kernel_dontaudit_list_all_sysctls(setfiles_t)
36 kernel_getattr_debugfs(setfiles_t)
37+kernel_read_kernel_sysctls(setfiles_t)
38+kernel_getattr_proc(setfiles_t)
39
40 dev_read_urand(setfiles_t)
41 dev_relabel_all_dev_nodes(setfiles_t)
42--
432.17.1
44
diff --git a/recipes-security/refpolicy/refpolicy/0062-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
index 1e7d963..1d6a3c4 100644
--- a/recipes-security/refpolicy/refpolicy/0062-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
@@ -1,4 +1,4 @@
1From 7789f70ee3506f11b6bc1954469915214bcb9c58 Mon Sep 17 00:00:00 2001 1From 0d69354886e0b635dd069876b9d53890a5a9cab1 Mon Sep 17 00:00:00 2001
2From: Wenzong Fan <wenzong.fan@windriver.com> 2From: Wenzong Fan <wenzong.fan@windriver.com>
3Date: Sat, 15 Feb 2014 04:22:47 -0500 3Date: Sat, 15 Feb 2014 04:22:47 -0500
4Subject: [PATCH] policy/modules/system/mount: make mount_t domain MLS trusted 4Subject: [PATCH] policy/modules/system/mount: make mount_t domain MLS trusted
@@ -19,10 +19,10 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
19 1 file changed, 2 insertions(+) 19 1 file changed, 2 insertions(+)
20 20
21diff --git a/policy/modules/system/mount.te b/policy/modules/system/mount.te 21diff --git a/policy/modules/system/mount.te b/policy/modules/system/mount.te
22index 282eb3ada..5bb4fe631 100644 22index b628c3b2f..f55457bb0 100644
23--- a/policy/modules/system/mount.te 23--- a/policy/modules/system/mount.te
24+++ b/policy/modules/system/mount.te 24+++ b/policy/modules/system/mount.te
25@@ -116,6 +116,8 @@ fs_dontaudit_write_tmpfs_dirs(mount_t) 25@@ -116,6 +116,8 @@ fs_dontaudit_write_all_image_files(mount_t)
26 mls_file_read_all_levels(mount_t) 26 mls_file_read_all_levels(mount_t)
27 mls_file_write_all_levels(mount_t) 27 mls_file_write_all_levels(mount_t)
28 28
diff --git a/recipes-security/refpolicy/refpolicy/0061-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
index af7f3ad..f441742 100644
--- a/recipes-security/refpolicy/refpolicy/0061-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
@@ -1,4 +1,4 @@
1From 0404c4ad3f92408edcdbf46ac0665bf09d4b2516 Mon Sep 17 00:00:00 2001 1From b83147aa97fe6f51c997256539dff827e3a44edc Mon Sep 17 00:00:00 2001
2From: Xin Ouyang <Xin.Ouyang@windriver.com> 2From: Xin Ouyang <Xin.Ouyang@windriver.com>
3Date: Mon, 28 Jan 2019 14:05:18 +0800 3Date: Mon, 28 Jan 2019 14:05:18 +0800
4Subject: [PATCH] policy/modules/roles/sysadm: MLS - sysadm rw to clearance 4Subject: [PATCH] policy/modules/roles/sysadm: MLS - sysadm rw to clearance
@@ -23,7 +23,7 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
23 1 file changed, 3 insertions(+) 23 1 file changed, 3 insertions(+)
24 24
25diff --git a/policy/modules/roles/sysadm.te b/policy/modules/roles/sysadm.te 25diff --git a/policy/modules/roles/sysadm.te b/policy/modules/roles/sysadm.te
26index 07b9faf30..ac5239d83 100644 26index a4abaefe4..aaae73fc3 100644
27--- a/policy/modules/roles/sysadm.te 27--- a/policy/modules/roles/sysadm.te
28+++ b/policy/modules/roles/sysadm.te 28+++ b/policy/modules/roles/sysadm.te
29@@ -42,6 +42,9 @@ dev_read_kmsg(sysadm_t) 29@@ -42,6 +42,9 @@ dev_read_kmsg(sysadm_t)
diff --git a/recipes-security/refpolicy/refpolicy/0059-policy-modules-services-rpc-fix-policy-for-nfsserver.patch b/recipes-security/refpolicy/refpolicy/0068-policy-modules-services-rpc-make-nfsd_t-domain-MLS-t.patch
index d4bdd37..4403997 100644
--- a/recipes-security/refpolicy/refpolicy/0059-policy-modules-services-rpc-fix-policy-for-nfsserver.patch
+++ b/recipes-security/refpolicy/refpolicy/0068-policy-modules-services-rpc-make-nfsd_t-domain-MLS-t.patch
@@ -1,8 +1,8 @@
1From fbf98576f32e33e55f3babeb9db255a459fad711 Mon Sep 17 00:00:00 2001 1From 7b8290ba52052f90b6221c1b3ccb8f7536f4c41e Mon Sep 17 00:00:00 2001
2From: Xin Ouyang <Xin.Ouyang@windriver.com> 2From: Xin Ouyang <Xin.Ouyang@windriver.com>
3Date: Fri, 23 Aug 2013 12:01:53 +0800 3Date: Fri, 23 Aug 2013 12:01:53 +0800
4Subject: [PATCH] policy/modules/services/rpc: fix policy for nfsserver to 4Subject: [PATCH] policy/modules/services/rpc: make nfsd_t domain MLS trusted
5 mount nfsd_fs_t 5 for reading from files up to its clearance
6 6
7Upstream-Status: Inappropriate [embedded specific] 7Upstream-Status: Inappropriate [embedded specific]
8 8
@@ -11,13 +11,12 @@ Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
11Signed-off-by: Yi Zhao <yi.zhao@windriver.com> 11Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
12--- 12---
13 policy/modules/kernel/kernel.te | 2 ++ 13 policy/modules/kernel/kernel.te | 2 ++
14 policy/modules/services/rpc.fc | 2 ++
15 policy/modules/services/rpc.te | 2 ++ 14 policy/modules/services/rpc.te | 2 ++
16 policy/modules/services/rpcbind.te | 6 ++++++ 15 policy/modules/services/rpcbind.te | 6 ++++++
17 4 files changed, 12 insertions(+) 16 3 files changed, 10 insertions(+)
18 17
19diff --git a/policy/modules/kernel/kernel.te b/policy/modules/kernel/kernel.te 18diff --git a/policy/modules/kernel/kernel.te b/policy/modules/kernel/kernel.te
20index c8218bf8c..44c031a39 100644 19index 5ce6e041b..c1557ddb2 100644
21--- a/policy/modules/kernel/kernel.te 20--- a/policy/modules/kernel/kernel.te
22+++ b/policy/modules/kernel/kernel.te 21+++ b/policy/modules/kernel/kernel.te
23@@ -356,6 +356,8 @@ mls_process_read_all_levels(kernel_t) 22@@ -356,6 +356,8 @@ mls_process_read_all_levels(kernel_t)
@@ -29,25 +28,11 @@ index c8218bf8c..44c031a39 100644
29 28
30 ifdef(`distro_redhat',` 29 ifdef(`distro_redhat',`
31 # Bugzilla 222337 30 # Bugzilla 222337
32diff --git a/policy/modules/services/rpc.fc b/policy/modules/services/rpc.fc
33index 6d3c9b68b..75999a57c 100644
34--- a/policy/modules/services/rpc.fc
35+++ b/policy/modules/services/rpc.fc
36@@ -1,7 +1,9 @@
37 /etc/exports -- gen_context(system_u:object_r:exports_t,s0)
38
39 /etc/rc\.d/init\.d/nfs -- gen_context(system_u:object_r:nfsd_initrc_exec_t,s0)
40+/etc/rc\.d/init\.d/nfsserver -- gen_context(system_u:object_r:nfsd_initrc_exec_t,s0)
41 /etc/rc\.d/init\.d/nfslock -- gen_context(system_u:object_r:rpcd_initrc_exec_t,s0)
42+/etc/rc\.d/init\.d/nfscommon -- gen_context(system_u:object_r:rpcd_initrc_exec_t,s0)
43 /etc/rc\.d/init\.d/rpcidmapd -- gen_context(system_u:object_r:rpcd_initrc_exec_t,s0)
44
45 /usr/bin/rpc\..* -- gen_context(system_u:object_r:rpcd_exec_t,s0)
46diff --git a/policy/modules/services/rpc.te b/policy/modules/services/rpc.te 31diff --git a/policy/modules/services/rpc.te b/policy/modules/services/rpc.te
47index c06ff803f..7c0b37ddc 100644 32index 87b6b4561..9618df04e 100644
48--- a/policy/modules/services/rpc.te 33--- a/policy/modules/services/rpc.te
49+++ b/policy/modules/services/rpc.te 34+++ b/policy/modules/services/rpc.te
50@@ -250,6 +250,8 @@ storage_raw_read_removable_device(nfsd_t) 35@@ -341,6 +341,8 @@ storage_raw_read_removable_device(nfsd_t)
51 36
52 miscfiles_read_public_files(nfsd_t) 37 miscfiles_read_public_files(nfsd_t)
53 38
@@ -57,7 +42,7 @@ index c06ff803f..7c0b37ddc 100644
57 miscfiles_manage_public_files(nfsd_t) 42 miscfiles_manage_public_files(nfsd_t)
58 ') 43 ')
59diff --git a/policy/modules/services/rpcbind.te b/policy/modules/services/rpcbind.te 44diff --git a/policy/modules/services/rpcbind.te b/policy/modules/services/rpcbind.te
60index 4f110773a..3cc85a8d5 100644 45index 8972980fa..5c89a1343 100644
61--- a/policy/modules/services/rpcbind.te 46--- a/policy/modules/services/rpcbind.te
62+++ b/policy/modules/services/rpcbind.te 47+++ b/policy/modules/services/rpcbind.te
63@@ -73,6 +73,12 @@ logging_send_syslog_msg(rpcbind_t) 48@@ -73,6 +73,12 @@ logging_send_syslog_msg(rpcbind_t)
diff --git a/recipes-security/refpolicy/refpolicy/0064-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
index 4fa9968..02aa5e3 100644
--- a/recipes-security/refpolicy/refpolicy/0064-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
@@ -1,4 +1,4 @@
1From a51cec2a8d8f47b7a06c59b8af73d96edcc2a993 Mon Sep 17 00:00:00 2001 1From bc6872d164d09355ee82dc97c4e3d99a6b6669b3 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Tue, 30 Jun 2020 10:18:20 +0800 3Date: Tue, 30 Jun 2020 10:18:20 +0800
4Subject: [PATCH] policy/modules/admin/dmesg: make dmesg_t MLS trusted reading 4Subject: [PATCH] policy/modules/admin/dmesg: make dmesg_t MLS trusted reading
@@ -19,7 +19,7 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
19 1 file changed, 2 insertions(+) 19 1 file changed, 2 insertions(+)
20 20
21diff --git a/policy/modules/admin/dmesg.te b/policy/modules/admin/dmesg.te 21diff --git a/policy/modules/admin/dmesg.te b/policy/modules/admin/dmesg.te
22index 5bbe71b26..228baecd8 100644 22index 0f2835575..9f4f11397 100644
23--- a/policy/modules/admin/dmesg.te 23--- a/policy/modules/admin/dmesg.te
24+++ b/policy/modules/admin/dmesg.te 24+++ b/policy/modules/admin/dmesg.te
25@@ -51,6 +51,8 @@ miscfiles_read_localization(dmesg_t) 25@@ -51,6 +51,8 @@ miscfiles_read_localization(dmesg_t)
diff --git a/recipes-security/refpolicy/refpolicy/0065-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
index 3a2c235..733fbad 100644
--- a/recipes-security/refpolicy/refpolicy/0065-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
@@ -1,4 +1,4 @@
1From fdc58fd666915aba89cb07fe6e7eb43a7fbec2ec Mon Sep 17 00:00:00 2001 1From e7b9af24946f5f76e8e6831bfeb444c0153298be Mon Sep 17 00:00:00 2001
2From: Wenzong Fan <wenzong.fan@windriver.com> 2From: Wenzong Fan <wenzong.fan@windriver.com>
3Date: Fri, 13 Oct 2017 07:20:40 +0000 3Date: Fri, 13 Oct 2017 07:20:40 +0000
4Subject: [PATCH] policy/modules/kernel/kernel: make kernel_t MLS trusted for 4Subject: [PATCH] policy/modules/kernel/kernel: make kernel_t MLS trusted for
@@ -59,7 +59,7 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
59 1 file changed, 3 insertions(+) 59 1 file changed, 3 insertions(+)
60 60
61diff --git a/policy/modules/kernel/kernel.te b/policy/modules/kernel/kernel.te 61diff --git a/policy/modules/kernel/kernel.te b/policy/modules/kernel/kernel.te
62index 44c031a39..4dffaef76 100644 62index c1557ddb2..8f67c6ec9 100644
63--- a/policy/modules/kernel/kernel.te 63--- a/policy/modules/kernel/kernel.te
64+++ b/policy/modules/kernel/kernel.te 64+++ b/policy/modules/kernel/kernel.te
65@@ -359,6 +359,9 @@ mls_file_read_all_levels(kernel_t) 65@@ -359,6 +359,9 @@ mls_file_read_all_levels(kernel_t)
diff --git a/recipes-security/refpolicy/refpolicy/0066-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
index 09e9af2..74d7428 100644
--- a/recipes-security/refpolicy/refpolicy/0066-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
@@ -1,4 +1,4 @@
1From 3aa784896315d269be4f43a281d59ad7671b2d07 Mon Sep 17 00:00:00 2001 1From ee3e2bbaf3b94902aadebbb085c7e86b8d074e98 Mon Sep 17 00:00:00 2001
2From: Wenzong Fan <wenzong.fan@windriver.com> 2From: Wenzong Fan <wenzong.fan@windriver.com>
3Date: Fri, 15 Jan 2016 03:47:05 -0500 3Date: Fri, 15 Jan 2016 03:47:05 -0500
4Subject: [PATCH] policy/modules/system/init: make init_t MLS trusted for 4Subject: [PATCH] policy/modules/system/init: make init_t MLS trusted for
@@ -27,10 +27,10 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
27 1 file changed, 4 insertions(+) 27 1 file changed, 4 insertions(+)
28 28
29diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te 29diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te
30index fe3fcf011..8e85dde72 100644 30index b7d494398..b6750015e 100644
31--- a/policy/modules/system/init.te 31--- a/policy/modules/system/init.te
32+++ b/policy/modules/system/init.te 32+++ b/policy/modules/system/init.te
33@@ -208,6 +208,10 @@ mls_process_write_all_levels(init_t) 33@@ -210,6 +210,10 @@ mls_process_write_all_levels(init_t)
34 mls_fd_use_all_levels(init_t) 34 mls_fd_use_all_levels(init_t)
35 mls_process_set_level(init_t) 35 mls_process_set_level(init_t)
36 36
diff --git a/recipes-security/refpolicy/refpolicy/0067-policy-modules-system-systemd-make-systemd-tmpfiles_.patch b/recipes-security/refpolicy/refpolicy/0072-policy-modules-system-systemd-make-systemd-tmpfiles_.patch
index b4245ab..2832681 100644
--- a/recipes-security/refpolicy/refpolicy/0067-policy-modules-system-systemd-make-systemd-tmpfiles_.patch
+++ b/recipes-security/refpolicy/refpolicy/0072-policy-modules-system-systemd-make-systemd-tmpfiles_.patch
@@ -1,4 +1,4 @@
1From fb69dde2c8783e0602dcce3509b69ded9e6331a2 Mon Sep 17 00:00:00 2001 1From 8cdcca3702d69ed5f3aa9ce9d769ad483f977094 Mon Sep 17 00:00:00 2001
2From: Wenzong Fan <wenzong.fan@windriver.com> 2From: Wenzong Fan <wenzong.fan@windriver.com>
3Date: Thu, 4 Feb 2016 06:03:19 -0500 3Date: Thu, 4 Feb 2016 06:03:19 -0500
4Subject: [PATCH] policy/modules/system/systemd: make systemd-tmpfiles_t domain 4Subject: [PATCH] policy/modules/system/systemd: make systemd-tmpfiles_t domain
@@ -43,10 +43,10 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
43 1 file changed, 5 insertions(+) 43 1 file changed, 5 insertions(+)
44 44
45diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te 45diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
46index fb8d4960f..57f4dc40d 100644 46index 7d2ba2796..c50a2ba64 100644
47--- a/policy/modules/system/systemd.te 47--- a/policy/modules/system/systemd.te
48+++ b/policy/modules/system/systemd.te 48+++ b/policy/modules/system/systemd.te
49@@ -1249,6 +1249,11 @@ sysnet_relabel_config(systemd_tmpfiles_t) 49@@ -1396,6 +1396,11 @@ sysnet_relabel_config(systemd_tmpfiles_t)
50 50
51 systemd_log_parse_environment(systemd_tmpfiles_t) 51 systemd_log_parse_environment(systemd_tmpfiles_t)
52 52
diff --git a/recipes-security/refpolicy/refpolicy/0068-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
index 921305e..d208752 100644
--- a/recipes-security/refpolicy/refpolicy/0068-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
@@ -1,4 +1,4 @@
1From f5a6c667186850ba8c5057742195c46d9f7ff8cf Mon Sep 17 00:00:00 2001 1From 4e7b0040ff558f2d69c8b9a30e73223acb20f35f Mon Sep 17 00:00:00 2001
2From: Xin Ouyang <Xin.Ouyang@windriver.com> 2From: Xin Ouyang <Xin.Ouyang@windriver.com>
3Date: Thu, 22 Aug 2013 13:37:23 +0800 3Date: Thu, 22 Aug 2013 13:37:23 +0800
4Subject: [PATCH] policy/modules/system/logging: add the syslogd_t to trusted 4Subject: [PATCH] policy/modules/system/logging: add the syslogd_t to trusted
@@ -18,11 +18,11 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
18 1 file changed, 4 insertions(+) 18 1 file changed, 4 insertions(+)
19 19
20diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te 20diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te
21index 1d45a5fa9..eec0560d1 100644 21index 62caa7a56..e608327fe 100644
22--- a/policy/modules/system/logging.te 22--- a/policy/modules/system/logging.te
23+++ b/policy/modules/system/logging.te 23+++ b/policy/modules/system/logging.te
24@@ -501,6 +501,10 @@ fs_getattr_all_fs(syslogd_t) 24@@ -495,6 +495,10 @@ fs_search_auto_mountpoints(syslogd_t)
25 fs_search_auto_mountpoints(syslogd_t) 25 fs_search_tmpfs(syslogd_t)
26 26
27 mls_file_write_all_levels(syslogd_t) # Need to be able to write to /var/run/ and /var/log directories 27 mls_file_write_all_levels(syslogd_t) # Need to be able to write to /var/run/ and /var/log directories
28+mls_file_read_all_levels(syslogd_t) 28+mls_file_read_all_levels(syslogd_t)
diff --git a/recipes-security/refpolicy/refpolicy/0069-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
index 74ef580..b7dcaa8 100644
--- a/recipes-security/refpolicy/refpolicy/0069-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
@@ -1,4 +1,4 @@
1From b74b8052fd654d6a242bf3d8773a42f376d08fed Mon Sep 17 00:00:00 2001 1From bbb405ac6270ef945db21cfddda63d283ee5d8af Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Tue, 28 May 2019 16:41:37 +0800 3Date: Tue, 28 May 2019 16:41:37 +0800
4Subject: [PATCH] policy/modules/system/init: make init_t MLS trusted for 4Subject: [PATCH] policy/modules/system/init: make init_t MLS trusted for
@@ -17,10 +17,10 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
17 1 file changed, 1 insertion(+) 17 1 file changed, 1 insertion(+)
18 18
19diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te 19diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te
20index 8e85dde72..453ae9b6b 100644 20index b6750015e..962c675b0 100644
21--- a/policy/modules/system/init.te 21--- a/policy/modules/system/init.te
22+++ b/policy/modules/system/init.te 22+++ b/policy/modules/system/init.te
23@@ -207,6 +207,7 @@ mls_file_write_all_levels(init_t) 23@@ -209,6 +209,7 @@ mls_file_write_all_levels(init_t)
24 mls_process_write_all_levels(init_t) 24 mls_process_write_all_levels(init_t)
25 mls_fd_use_all_levels(init_t) 25 mls_fd_use_all_levels(init_t)
26 mls_process_set_level(init_t) 26 mls_process_set_level(init_t)
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/0075-policy-modules-system-init-all-init_t-to-read-any-le.patch
index 38a8076..de7271f 100644
--- a/recipes-security/refpolicy/refpolicy/0070-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
@@ -1,4 +1,4 @@
1From 0e29b493136115b9bf397cc59424552c5b354385 Mon Sep 17 00:00:00 2001 1From 2780811e48663df0265676749a4041c077ae6a89 Mon Sep 17 00:00:00 2001
2From: Wenzong Fan <wenzong.fan@windriver.com> 2From: Wenzong Fan <wenzong.fan@windriver.com>
3Date: Wed, 3 Feb 2016 04:16:06 -0500 3Date: Wed, 3 Feb 2016 04:16:06 -0500
4Subject: [PATCH] policy/modules/system/init: all init_t to read any level 4Subject: [PATCH] policy/modules/system/init: all init_t to read any level
@@ -22,10 +22,10 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
22 1 file changed, 3 insertions(+) 22 1 file changed, 3 insertions(+)
23 23
24diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te 24diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te
25index 453ae9b6b..feed5af5f 100644 25index 962c675b0..aa57a5661 100644
26--- a/policy/modules/system/init.te 26--- a/policy/modules/system/init.te
27+++ b/policy/modules/system/init.te 27+++ b/policy/modules/system/init.te
28@@ -213,6 +213,9 @@ mls_key_write_all_levels(init_t) 28@@ -215,6 +215,9 @@ mls_key_write_all_levels(init_t)
29 mls_file_downgrade(init_t) 29 mls_file_downgrade(init_t)
30 mls_file_upgrade(init_t) 30 mls_file_upgrade(init_t)
31 31
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 @@
1From a75847eb2a5a34c18a4fd24383a696d6c077a117 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Thu, 18 Jun 2020 09:59:58 +0800
4Subject: [PATCH] policy/modules/system/systemd: systemd-networkd: make
5 systemd_networkd_t MLS trusted for reading from files up to its clearance
6
7Fixes:
8avc: denied { search } for pid=219 comm="systemd-network"
9name="journal" dev="tmpfs" ino=10956
10scontext=system_u:system_r:systemd_networkd_t:s0-s15:c0.c1023
11tcontext=system_u:object_r:syslogd_runtime_t:s15:c0.c1023 tclass=dir
12permissive=0
13
14Upstream-Status: Inappropriate [embedded specific]
15
16Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
17---
18 policy/modules/system/systemd.te | 2 ++
19 1 file changed, 2 insertions(+)
20
21diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
22index 6b0f52d15..cfbd9196a 100644
23--- a/policy/modules/system/systemd.te
24+++ b/policy/modules/system/systemd.te
25@@ -795,6 +795,8 @@ sysnet_read_config(systemd_networkd_t)
26
27 systemd_log_parse_environment(systemd_networkd_t)
28
29+mls_file_read_to_clearance(systemd_networkd_t)
30+
31 optional_policy(`
32 dbus_system_bus_client(systemd_networkd_t)
33 dbus_connect_system_bus(systemd_networkd_t)
34--
352.17.1
36
diff --git a/recipes-security/refpolicy/refpolicy/0071-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
index 2f7eb44..cd93c08 100644
--- a/recipes-security/refpolicy/refpolicy/0071-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
@@ -1,4 +1,4 @@
1From 71a217de05a084899537462f8b432825b12ab187 Mon Sep 17 00:00:00 2001 1From a74584ba424cd5e392db2a64b4ec66ebb307eb4c Mon Sep 17 00:00:00 2001
2From: Wenzong Fan <wenzong.fan@windriver.com> 2From: Wenzong Fan <wenzong.fan@windriver.com>
3Date: Thu, 25 Feb 2016 04:25:08 -0500 3Date: Thu, 25 Feb 2016 04:25:08 -0500
4Subject: [PATCH] policy/modules/system/logging: allow auditd_t to write socket 4Subject: [PATCH] policy/modules/system/logging: allow auditd_t to write socket
@@ -22,10 +22,10 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
22 1 file changed, 2 insertions(+) 22 1 file changed, 2 insertions(+)
23 23
24diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te 24diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te
25index eec0560d1..c22613c0b 100644 25index e608327fe..bdd5c9dff 100644
26--- a/policy/modules/system/logging.te 26--- a/policy/modules/system/logging.te
27+++ b/policy/modules/system/logging.te 27+++ b/policy/modules/system/logging.te
28@@ -210,6 +210,8 @@ miscfiles_read_localization(auditd_t) 28@@ -211,6 +211,8 @@ miscfiles_read_localization(auditd_t)
29 29
30 mls_file_read_all_levels(auditd_t) 30 mls_file_read_all_levels(auditd_t)
31 mls_file_write_all_levels(auditd_t) # Need to be able to write to /var/run/ directory 31 mls_file_write_all_levels(auditd_t) # Need to be able to write to /var/run/ directory
diff --git a/recipes-security/refpolicy/refpolicy/0076-policy-modules-system-systemd-systemd-resolved-make-.patch b/recipes-security/refpolicy/refpolicy/0076-policy-modules-system-systemd-systemd-resolved-make-.patch
deleted file mode 100644
index 908fe64..0000000
--- a/recipes-security/refpolicy/refpolicy/0076-policy-modules-system-systemd-systemd-resolved-make-.patch
+++ /dev/null
@@ -1,40 +0,0 @@
1From fac0583bea8eb74c43cd715cf5029d3243e38f95 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Thu, 18 Jun 2020 09:47:25 +0800
4Subject: [PATCH] policy/modules/system/systemd: systemd-resolved: make
5 systemd_resolved_t MLS trusted for reading from files up to its clearance
6
7Fixes:
8avc: denied { search } for pid=220 comm="systemd-resolve"
9name="journal" dev="tmpfs" ino=10956
10scontext=system_u:system_r:systemd_resolved_t:s0-s15:c0.c1023
11tcontext=system_u:object_r:syslogd_runtime_t:s15:c0.c1023 tclass=dir
12permissive=0
13avc: denied { search } for pid=220 comm="systemd-resolve" name="/"
14dev="tmpfs" ino=15102
15scontext=system_u:system_r:systemd_resolved_t:s0-s15:c0.c1023
16tcontext=system_u:object_r:tmpfs_t:s0 tclass=dir permissive=0
17
18Upstream-Status: Inappropriate [embedded specific]
19
20Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
21---
22 policy/modules/system/systemd.te | 2 ++
23 1 file changed, 2 insertions(+)
24
25diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
26index cfbd9196a..806468109 100644
27--- a/policy/modules/system/systemd.te
28+++ b/policy/modules/system/systemd.te
29@@ -1096,6 +1096,8 @@ init_dgram_send(systemd_resolved_t)
30
31 seutil_read_file_contexts(systemd_resolved_t)
32
33+mls_file_read_to_clearance(systemd_resolved_t)
34+
35 systemd_log_parse_environment(systemd_resolved_t)
36 systemd_read_networkd_runtime(systemd_resolved_t)
37
38--
392.17.1
40
diff --git a/recipes-security/refpolicy/refpolicy/0072-policy-modules-kernel-kernel-make-kernel_t-MLS-trust.patch b/recipes-security/refpolicy/refpolicy/0077-policy-modules-kernel-kernel-make-kernel_t-MLS-trust.patch
index f32bb74..6b84403 100644
--- a/recipes-security/refpolicy/refpolicy/0072-policy-modules-kernel-kernel-make-kernel_t-MLS-trust.patch
+++ b/recipes-security/refpolicy/refpolicy/0077-policy-modules-kernel-kernel-make-kernel_t-MLS-trust.patch
@@ -1,4 +1,4 @@
1From 8d1a8ffca75ada3dc576a4013644c9e9cdb45947 Mon Sep 17 00:00:00 2001 1From 1bcb41c20d666761bb407bf34c9e3391e16449a7 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Thu, 31 Oct 2019 17:35:59 +0800 3Date: Thu, 31 Oct 2019 17:35:59 +0800
4Subject: [PATCH] policy/modules/kernel/kernel: make kernel_t MLS trusted for 4Subject: [PATCH] policy/modules/kernel/kernel: make kernel_t MLS trusted for
@@ -15,7 +15,7 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
15 1 file changed, 2 insertions(+) 15 1 file changed, 2 insertions(+)
16 16
17diff --git a/policy/modules/kernel/kernel.te b/policy/modules/kernel/kernel.te 17diff --git a/policy/modules/kernel/kernel.te b/policy/modules/kernel/kernel.te
18index 4dffaef76..34444a2f9 100644 18index 8f67c6ec9..fbcf1413f 100644
19--- a/policy/modules/kernel/kernel.te 19--- a/policy/modules/kernel/kernel.te
20+++ b/policy/modules/kernel/kernel.te 20+++ b/policy/modules/kernel/kernel.te
21@@ -362,6 +362,8 @@ mls_fd_use_all_levels(kernel_t) 21@@ -362,6 +362,8 @@ mls_fd_use_all_levels(kernel_t)
diff --git a/recipes-security/refpolicy/refpolicy/0077-policy-modules-system-systemd-make-systemd-modules_t.patch b/recipes-security/refpolicy/refpolicy/0077-policy-modules-system-systemd-make-systemd-modules_t.patch
deleted file mode 100644
index a1013a1..0000000
--- a/recipes-security/refpolicy/refpolicy/0077-policy-modules-system-systemd-make-systemd-modules_t.patch
+++ /dev/null
@@ -1,36 +0,0 @@
1From 569033512340d791a13c1ee2f269788c55fff63c Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Sun, 28 Jun 2020 15:19:44 +0800
4Subject: [PATCH] policy/modules/system/systemd: make systemd-modules_t domain
5 MLS trusted for reading from files up to its clearance
6
7Fixes:
8avc: denied { search } for pid=142 comm="systemd-modules"
9name="journal" dev="tmpfs" ino=10990
10scontext=system_u:system_r:systemd_modules_load_t:s0-s15:c0.c1023
11tcontext=system_u:object_r:syslogd_runtime_t:s15:c0.c1023 tclass=dir
12permissive=0
13
14Upstream-Status: Inappropriate [embedded specific]
15
16Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
17---
18 policy/modules/system/systemd.te | 2 ++
19 1 file changed, 2 insertions(+)
20
21diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
22index 806468109..e82a1e64a 100644
23--- a/policy/modules/system/systemd.te
24+++ b/policy/modules/system/systemd.te
25@@ -739,6 +739,8 @@ modutils_read_module_objects(systemd_modules_load_t)
26
27 systemd_log_parse_environment(systemd_modules_load_t)
28
29+mls_file_read_to_clearance(systemd_modules_load_t)
30+
31 ########################################
32 #
33 # networkd local policy
34--
352.17.1
36
diff --git a/recipes-security/refpolicy/refpolicy/0073-policy-modules-system-systemd-make-systemd-logind-do.patch b/recipes-security/refpolicy/refpolicy/0078-policy-modules-system-systemd-make-systemd-logind-do.patch
index 1e5b474..5ac5a19 100644
--- a/recipes-security/refpolicy/refpolicy/0073-policy-modules-system-systemd-make-systemd-logind-do.patch
+++ b/recipes-security/refpolicy/refpolicy/0078-policy-modules-system-systemd-make-systemd-logind-do.patch
@@ -1,4 +1,4 @@
1From 212156df805a24852a4762737f7040f1c7bb9b9a Mon Sep 17 00:00:00 2001 1From 7021844f20c5d5c885edf87abf8ce3329bcc5836 Mon Sep 17 00:00:00 2001
2From: Wenzong Fan <wenzong.fan@windriver.com> 2From: Wenzong Fan <wenzong.fan@windriver.com>
3Date: Mon, 23 Jan 2017 08:42:44 +0000 3Date: Mon, 23 Jan 2017 08:42:44 +0000
4Subject: [PATCH] policy/modules/system/systemd: make systemd-logind domain MLS 4Subject: [PATCH] policy/modules/system/systemd: make systemd-logind domain MLS
@@ -25,10 +25,10 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
25 1 file changed, 2 insertions(+) 25 1 file changed, 2 insertions(+)
26 26
27diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te 27diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
28index 57f4dc40d..1449d2808 100644 28index c50a2ba64..a7390b1cd 100644
29--- a/policy/modules/system/systemd.te 29--- a/policy/modules/system/systemd.te
30+++ b/policy/modules/system/systemd.te 30+++ b/policy/modules/system/systemd.te
31@@ -621,6 +621,8 @@ userdom_relabelto_user_runtime_dirs(systemd_logind_t) 31@@ -693,6 +693,8 @@ userdom_relabelto_user_runtime_dirs(systemd_logind_t)
32 userdom_setattr_user_ttys(systemd_logind_t) 32 userdom_setattr_user_ttys(systemd_logind_t)
33 userdom_use_user_ttys(systemd_logind_t) 33 userdom_use_user_ttys(systemd_logind_t)
34 34
diff --git a/recipes-security/refpolicy/refpolicy/0078-policy-modules-system-systemd-systemd-gpt-auto-gener.patch b/recipes-security/refpolicy/refpolicy/0078-policy-modules-system-systemd-systemd-gpt-auto-gener.patch
deleted file mode 100644
index 303e7cf..0000000
--- a/recipes-security/refpolicy/refpolicy/0078-policy-modules-system-systemd-systemd-gpt-auto-gener.patch
+++ /dev/null
@@ -1,70 +0,0 @@
1From 84b86b1a4dd6f8e535c4b9b4ac2bfa38d202d9d3 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Tue, 23 Jun 2020 14:52:43 +0800
4Subject: [PATCH] policy/modules/system/systemd: systemd-gpt-auto-generator:
5 make systemd_generator_t MLS trusted for writing from files up to its
6 clearance
7
8Fixes:
9audit: type=1400 audit(1592892455.376:3): avc: denied { write } for
10pid=120 comm="systemd-gpt-aut" name="kmsg" dev="devtmpfs" ino=10032
11scontext=system_u:system_r:systemd_generator_t:s0-s15:c0.c1023
12tcontext=system_u:object_r:kmsg_device_t:s15:c0.c1023 tclass=chr_file
13permissive=0
14audit: type=1400 audit(1592892455.381:4): avc: denied { write } for
15pid=119 comm="systemd-getty-g" name="kmsg" dev="devtmpfs" ino=10032
16scontext=system_u:system_r:systemd_generator_t:s0-s15:c0.c1023
17tcontext=system_u:object_r:kmsg_device_t:s15:c0.c1023 tclass=chr_file
18permissive=0
19audit: type=1400 audit(1592892455.382:5): avc: denied { read write }
20for pid=119 comm="systemd-getty-g" name="ttyS0" dev="devtmpfs"
21ino=10127 scontext=system_u:system_r:systemd_generator_t:s0-s15:c0.c1023
22tcontext=system_u:object_r:tty_device_t:s0 tclass=chr_file permissive=0
23audit: type=1400 audit(1592892455.382:6): avc: denied { write } for
24pid=124 comm="systemd-system-" name="kmsg" dev="devtmpfs" ino=10032
25scontext=system_u:system_r:systemd_generator_t:s0-s15:c0.c1023
26tcontext=system_u:object_r:kmsg_device_t:s15:c0.c1023 tclass=chr_file
27permissive=0
28audit: type=1400 audit(1592892455.383:7): avc: denied { write } for
29pid=122 comm="systemd-rc-loca" name="kmsg" dev="devtmpfs" ino=10032
30scontext=system_u:system_r:systemd_generator_t:s0-s15:c0.c1023
31tcontext=system_u:object_r:kmsg_device_t:s15:c0.c1023 tclass=chr_file
32permissive=0
33audit: type=1400 audit(1592892455.385:8): avc: denied { write } for
34pid=118 comm="systemd-fstab-g" name="kmsg" dev="devtmpfs" ino=10032
35scontext=system_u:system_r:systemd_generator_t:s0-s15:c0.c1023
36tcontext=system_u:object_r:kmsg_device_t:s15:c0.c1023 tclass=chr_file
37permissive=0
38audit: type=1400 audit(1592892455.385:9): avc: denied { write } for
39pid=121 comm="systemd-hiberna" name="kmsg" dev="devtmpfs" ino=10032
40scontext=system_u:system_r:systemd_generator_t:s0-s15:c0.c1023
41tcontext=system_u:object_r:kmsg_device_t:s15:c0.c1023 tclass=chr_file
42permissive=0
43audit: type=1400 audit(1592892455.386:10): avc: denied { write } for
44pid=123 comm="systemd-run-gen" name="kmsg" dev="devtmpfs" ino=10032
45scontext=system_u:system_r:systemd_generator_t:s0-s15:c0.c1023
46tcontext=system_u:object_r:kmsg_device_t:s15:c0.c1023 tclass=chr_file
47permissive=0
48
49Upstream-Status: Inappropriate [embedded specific]
50
51Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
52---
53 policy/modules/system/systemd.te | 1 +
54 1 file changed, 1 insertion(+)
55
56diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
57index e82a1e64a..7e573645b 100644
58--- a/policy/modules/system/systemd.te
59+++ b/policy/modules/system/systemd.te
60@@ -401,6 +401,7 @@ storage_raw_read_fixed_disk(systemd_generator_t)
61 systemd_log_parse_environment(systemd_generator_t)
62
63 term_dontaudit_use_unallocated_ttys(systemd_generator_t)
64+mls_file_write_to_clearance(systemd_generator_t)
65
66 optional_policy(`
67 fstools_exec(systemd_generator_t)
68--
692.17.1
70
diff --git a/recipes-security/refpolicy/refpolicy/0074-policy-modules-system-systemd-systemd-user-sessions-.patch b/recipes-security/refpolicy/refpolicy/0079-policy-modules-system-systemd-systemd-user-sessions-.patch
index ebe2b52..3ea0085 100644
--- a/recipes-security/refpolicy/refpolicy/0074-policy-modules-system-systemd-systemd-user-sessions-.patch
+++ b/recipes-security/refpolicy/refpolicy/0079-policy-modules-system-systemd-systemd-user-sessions-.patch
@@ -1,4 +1,4 @@
1From bea1f53ae2ba7608503051b874db9aecb97d4f00 Mon Sep 17 00:00:00 2001 1From 6e3e1a5f79d6deab2966fc74c64720e90d248f3d Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Thu, 18 Jun 2020 09:39:23 +0800 3Date: Thu, 18 Jun 2020 09:39:23 +0800
4Subject: [PATCH] policy/modules/system/systemd: systemd-user-sessions: make 4Subject: [PATCH] policy/modules/system/systemd: systemd-user-sessions: make
@@ -24,10 +24,10 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
24 1 file changed, 2 insertions(+) 24 1 file changed, 2 insertions(+)
25 25
26diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te 26diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
27index 1449d2808..6b0f52d15 100644 27index a7390b1cd..f0b0e8b92 100644
28--- a/policy/modules/system/systemd.te 28--- a/policy/modules/system/systemd.te
29+++ b/policy/modules/system/systemd.te 29+++ b/policy/modules/system/systemd.te
30@@ -1125,6 +1125,8 @@ seutil_read_file_contexts(systemd_sessions_t) 30@@ -1261,6 +1261,8 @@ seutil_read_file_contexts(systemd_sessions_t)
31 31
32 systemd_log_parse_environment(systemd_sessions_t) 32 systemd_log_parse_environment(systemd_sessions_t)
33 33
diff --git a/recipes-security/refpolicy/refpolicy/0080-policy-modules-system-systemd-systemd-make-systemd_-.patch b/recipes-security/refpolicy/refpolicy/0080-policy-modules-system-systemd-systemd-make-systemd_-.patch
new file mode 100644
index 0000000..cb8e821
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0080-policy-modules-system-systemd-systemd-make-systemd_-.patch
@@ -0,0 +1,162 @@
1From 05ec2d78b44e57ecf188472b903fe66eeb568951 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Thu, 18 Jun 2020 09:59:58 +0800
4Subject: [PATCH] policy/modules/system/systemd: systemd-*: make systemd_*_t
5 MLS trusted for writing/reading from files up to its clearance
6
7Fixes:
8avc: denied { search } for pid=219 comm="systemd-network"
9name="journal" dev="tmpfs" ino=10956
10scontext=system_u:system_r:systemd_networkd_t:s0-s15:c0.c1023
11tcontext=system_u:object_r:syslogd_runtime_t:s15:c0.c1023 tclass=dir
12permissive=0
13
14avc: denied { search } for pid=220 comm="systemd-resolve"
15name="journal" dev="tmpfs" ino=10956
16scontext=system_u:system_r:systemd_resolved_t:s0-s15:c0.c1023
17tcontext=system_u:object_r:syslogd_runtime_t:s15:c0.c1023 tclass=dir
18permissive=0
19avc: denied { search } for pid=220 comm="systemd-resolve" name="/"
20dev="tmpfs" ino=15102
21scontext=system_u:system_r:systemd_resolved_t:s0-s15:c0.c1023
22tcontext=system_u:object_r:tmpfs_t:s0 tclass=dir permissive=0
23
24avc: denied { search } for pid=142 comm="systemd-modules"
25name="journal" dev="tmpfs" ino=10990
26scontext=system_u:system_r:systemd_modules_load_t:s0-s15:c0.c1023
27tcontext=system_u:object_r:syslogd_runtime_t:s15:c0.c1023 tclass=dir
28permissive=0
29
30audit: type=1400 audit(1592892455.376:3): avc: denied { write } for
31pid=120 comm="systemd-gpt-aut" name="kmsg" dev="devtmpfs" ino=10032
32scontext=system_u:system_r:systemd_generator_t:s0-s15:c0.c1023
33tcontext=system_u:object_r:kmsg_device_t:s15:c0.c1023 tclass=chr_file
34permissive=0
35
36audit: type=1400 audit(1592892455.381:4): avc: denied { write } for
37pid=119 comm="systemd-getty-g" name="kmsg" dev="devtmpfs" ino=10032
38scontext=system_u:system_r:systemd_generator_t:s0-s15:c0.c1023
39tcontext=system_u:object_r:kmsg_device_t:s15:c0.c1023 tclass=chr_file
40permissive=0
41
42avc: denied { read } for pid=125 comm="systemd-gpt-aut" name="sdb"
43dev="devtmpfs" ino=42
44scontext=system_u:system_r:systemd_generator_t:s0-s15:c0.c1023
45tcontext=system_u:object_r:fixed_disk_device_t:s15:c0.c1023
46tclass=blk_file permissive=0
47
48avc: denied { search } for pid=302 comm="systemd-hostnam"
49name="journal" dev="tmpfs" ino=14165
50scontext=system_u:system_r:systemd_hostnamed_t:s0-s15:c0.c1023
51tcontext=system_u:object_r:syslogd_runtime_t:s15:c0.c1023 tclass=dir
52permissive=0
53
54avc: denied { search } for pid=302 comm="systemd-hostnam" name="/"
55dev="tmpfs" ino=17310
56scontext=system_u:system_r:systemd_hostnamed_t:s0-s15:c0.c1023
57tcontext=system_u:object_r:tmpfs_t:s0 tclass=dir permissive=0
58
59avc: denied { search } for pid=233 comm="systemd-rfkill"
60name="journal" dev="tmpfs" ino=14165
61scontext=system_u:system_r:systemd_rfkill_t:s0-s15:c0.c1023
62tcontext=system_u:object_r:syslogd_runtime_t:s15:c0.c1023 tclass=dir
63permissive=0
64
65avc: denied { write } for pid=233 comm="systemd-rfkill" name="kmsg"
66dev="devtmpfs" ino=2060
67scontext=system_u:system_r:systemd_rfkill_t:s0-s15:c0.c1023
68tcontext=system_u:object_r:kmsg_device_t:s15:c0.c1023 tclass=chr_file
69permissive=0
70
71avc: denied { search } for pid=354 comm="systemd-backlig"
72name="journal" dev="tmpfs" ino=1183
73scontext=system_u:system_r:systemd_backlight_t:s0-s15:c0.c1023
74tcontext=system_u:object_r:syslogd_runtime_t:s15:c0.c1023 tclass=dir
75permissive=0
76
77avc: denied { write } for pid=354 comm="systemd-backlig" name="kmsg"
78dev="devtmpfs" ino=3081
79scontext=system_u:system_r:systemd_backlight_t:s0-s15:c0.c1023
80tcontext=system_u:object_r:kmsg_device_t:s15:c0.c1023 tclass=chr_file
81permissive=0
82
83Upstream-Status: Inappropriate [embedded specific]
84
85Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
86---
87 policy/modules/system/systemd.te | 17 +++++++++++++++++
88 1 file changed, 17 insertions(+)
89
90diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te
91index f0b0e8b92..7b2d359b7 100644
92--- a/policy/modules/system/systemd.te
93+++ b/policy/modules/system/systemd.te
94@@ -326,6 +326,9 @@ files_search_var_lib(systemd_backlight_t)
95
96 kernel_read_kernel_sysctls(systemd_backlight_t)
97
98+mls_file_write_to_clearance(systemd_backlight_t)
99+mls_file_read_to_clearance(systemd_backlight_t)
100+
101 #######################################
102 #
103 # Binfmt local policy
104@@ -460,6 +463,9 @@ systemd_log_parse_environment(systemd_generator_t)
105
106 term_use_unallocated_ttys(systemd_generator_t)
107
108+mls_file_write_to_clearance(systemd_generator_t)
109+mls_file_read_to_clearance(systemd_generator_t)
110+
111 ifdef(`distro_gentoo',`
112 corecmd_shell_entry_type(systemd_generator_t)
113 ')
114@@ -497,6 +503,8 @@ sysnet_manage_config(systemd_hostnamed_t)
115
116 systemd_log_parse_environment(systemd_hostnamed_t)
117
118+mls_file_read_to_clearance(systemd_hostnamed_t)
119+
120 optional_policy(`
121 dbus_connect_system_bus(systemd_hostnamed_t)
122 dbus_system_bus_client(systemd_hostnamed_t)
123@@ -818,6 +826,8 @@ modutils_read_module_deps(systemd_modules_load_t)
124
125 systemd_log_parse_environment(systemd_modules_load_t)
126
127+mls_file_read_to_clearance(systemd_modules_load_t)
128+
129 ########################################
130 #
131 # networkd local policy
132@@ -876,6 +886,8 @@ sysnet_read_config(systemd_networkd_t)
133
134 systemd_log_parse_environment(systemd_networkd_t)
135
136+mls_file_read_to_clearance(systemd_networkd_t)
137+
138 optional_policy(`
139 dbus_system_bus_client(systemd_networkd_t)
140 dbus_connect_system_bus(systemd_networkd_t)
141@@ -1159,6 +1171,9 @@ udev_read_runtime_files(systemd_rfkill_t)
142
143 systemd_log_parse_environment(systemd_rfkill_t)
144
145+mls_file_write_to_clearance(systemd_rfkill_t)
146+mls_file_read_to_clearance(systemd_rfkill_t)
147+
148 #########################################
149 #
150 # Resolved local policy
151@@ -1202,6 +1217,8 @@ init_dgram_send(systemd_resolved_t)
152
153 seutil_read_file_contexts(systemd_resolved_t)
154
155+mls_file_read_to_clearance(systemd_resolved_t)
156+
157 systemd_log_parse_environment(systemd_resolved_t)
158 systemd_read_networkd_runtime(systemd_resolved_t)
159
160--
1612.17.1
162
diff --git a/recipes-security/refpolicy/refpolicy/0079-policy-modules-services-ntp-make-nptd_t-MLS-trusted-.patch b/recipes-security/refpolicy/refpolicy/0081-policy-modules-services-ntp-make-nptd_t-MLS-trusted-.patch
index b939c37..250d89b 100644
--- a/recipes-security/refpolicy/refpolicy/0079-policy-modules-services-ntp-make-nptd_t-MLS-trusted-.patch
+++ b/recipes-security/refpolicy/refpolicy/0081-policy-modules-services-ntp-make-nptd_t-MLS-trusted-.patch
@@ -1,4 +1,4 @@
1From cb455496193d01761175f35297038f7cf468ebed Mon Sep 17 00:00:00 2001 1From a105ea8b48c5e9ada567c7f6347f3875df7098a0 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Thu, 18 Jun 2020 10:21:04 +0800 3Date: Thu, 18 Jun 2020 10:21:04 +0800
4Subject: [PATCH] policy/modules/services/ntp: make nptd_t MLS trusted for 4Subject: [PATCH] policy/modules/services/ntp: make nptd_t MLS trusted for
@@ -23,7 +23,7 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
23 1 file changed, 2 insertions(+) 23 1 file changed, 2 insertions(+)
24 24
25diff --git a/policy/modules/services/ntp.te b/policy/modules/services/ntp.te 25diff --git a/policy/modules/services/ntp.te b/policy/modules/services/ntp.te
26index 75603e16b..8886cb3bf 100644 26index 1626ae87a..c8a1f041b 100644
27--- a/policy/modules/services/ntp.te 27--- a/policy/modules/services/ntp.te
28+++ b/policy/modules/services/ntp.te 28+++ b/policy/modules/services/ntp.te
29@@ -138,6 +138,8 @@ miscfiles_read_localization(ntpd_t) 29@@ -138,6 +138,8 @@ miscfiles_read_localization(ntpd_t)
@@ -33,7 +33,7 @@ index 75603e16b..8886cb3bf 100644
33+mls_file_read_all_levels(ntpd_t) 33+mls_file_read_all_levels(ntpd_t)
34+ 34+
35 ifdef(`init_systemd',` 35 ifdef(`init_systemd',`
36 allow ntpd_t ntpd_unit_t:file read_file_perms; 36 allow ntpd_t self:process setfscreate;
37 37
38-- 38--
392.17.1 392.17.1
diff --git a/recipes-security/refpolicy/refpolicy/0082-policy-modules-system-setrans-allow-setrans_t-use-fd.patch b/recipes-security/refpolicy/refpolicy/0082-policy-modules-system-setrans-allow-setrans_t-use-fd.patch
new file mode 100644
index 0000000..b67f069
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0082-policy-modules-system-setrans-allow-setrans_t-use-fd.patch
@@ -0,0 +1,30 @@
1From e6a08769138d68582c72fe28ed7dd51c118654a5 Mon Sep 17 00:00:00 2001
2From: Roy Li <rongqing.li@windriver.com>
3Date: Sat, 22 Feb 2014 13:35:38 +0800
4Subject: [PATCH] policy/modules/system/setrans: allow setrans_t use fd at any
5 level
6
7Upstream-Status: Inappropriate [embedded specific]
8
9Signed-off-by: Roy Li <rongqing.li@windriver.com>
10Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
11---
12 policy/modules/system/setrans.te | 2 ++
13 1 file changed, 2 insertions(+)
14
15diff --git a/policy/modules/system/setrans.te b/policy/modules/system/setrans.te
16index 78bd6e2eb..0dd3a63cd 100644
17--- a/policy/modules/system/setrans.te
18+++ b/policy/modules/system/setrans.te
19@@ -71,6 +71,8 @@ mls_net_receive_all_levels(setrans_t)
20 mls_socket_write_all_levels(setrans_t)
21 mls_process_read_all_levels(setrans_t)
22 mls_socket_read_all_levels(setrans_t)
23+mls_fd_use_all_levels(setrans_t)
24+mls_trusted_object(setrans_t)
25
26 selinux_compute_access_vector(setrans_t)
27
28--
292.17.1
30
diff --git a/recipes-security/refpolicy/refpolicy/0083-policy-modules-services-acpi-make-acpid_t-domain-MLS.patch b/recipes-security/refpolicy/refpolicy/0083-policy-modules-services-acpi-make-acpid_t-domain-MLS.patch
new file mode 100644
index 0000000..cc2d5dd
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0083-policy-modules-services-acpi-make-acpid_t-domain-MLS.patch
@@ -0,0 +1,35 @@
1From 15c99854aa21564a6eb1121f58f55a9626ba6297 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Fri, 10 Jul 2020 09:07:00 +0800
4Subject: [PATCH] policy/modules/services/acpi: make acpid_t domain MLS trusted
5 for reading from files up to its clearance
6
7Fixes:
8avc: denied { search } for pid=265 comm="acpid" name="journal"
9dev="tmpfs" ino=14165 scontext=system_u:system_r:acpid_t:s0-s15:c0.c1023
10tcontext=system_u:object_r:syslogd_runtime_t:s15:c0.c1023 tclass=dir
11permissive=0
12
13Upstream-Status: Inappropriate [embedded specific]
14
15Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
16---
17 policy/modules/services/acpi.te | 2 ++
18 1 file changed, 2 insertions(+)
19
20diff --git a/policy/modules/services/acpi.te b/policy/modules/services/acpi.te
21index 5c22adecd..bd442ff8a 100644
22--- a/policy/modules/services/acpi.te
23+++ b/policy/modules/services/acpi.te
24@@ -157,6 +157,8 @@ userdom_dontaudit_use_unpriv_user_fds(acpid_t)
25 userdom_dontaudit_search_user_home_dirs(acpid_t)
26 userdom_dontaudit_search_user_home_content(acpid_t)
27
28+mls_file_read_to_clearance(acpid_t)
29+
30 optional_policy(`
31 automount_domtrans(acpid_t)
32 ')
33--
342.17.1
35
diff --git a/recipes-security/refpolicy/refpolicy/0080-policy-modules-services-avahi-make-avahi_t-MLS-trust.patch b/recipes-security/refpolicy/refpolicy/0084-policy-modules-services-avahi-make-avahi_t-MLS-trust.patch
index 2b1ab6f..3cfe2c0 100644
--- a/recipes-security/refpolicy/refpolicy/0080-policy-modules-services-avahi-make-avahi_t-MLS-trust.patch
+++ b/recipes-security/refpolicy/refpolicy/0084-policy-modules-services-avahi-make-avahi_t-MLS-trust.patch
@@ -1,4 +1,4 @@
1From 0a2e2a58a645bd99242ac5ec60f17fab26a80bf9 Mon Sep 17 00:00:00 2001 1From 5cd8a1121685c269238c89ea22743441541cf108 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Tue, 23 Jun 2020 08:19:16 +0800 3Date: Tue, 23 Jun 2020 08:19:16 +0800
4Subject: [PATCH] policy/modules/services/avahi: make avahi_t MLS trusted for 4Subject: [PATCH] policy/modules/services/avahi: make avahi_t MLS trusted for
@@ -12,7 +12,7 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
12 1 file changed, 2 insertions(+) 12 1 file changed, 2 insertions(+)
13 13
14diff --git a/policy/modules/services/avahi.te b/policy/modules/services/avahi.te 14diff --git a/policy/modules/services/avahi.te b/policy/modules/services/avahi.te
15index 5643349e3..5994ff3d5 100644 15index 674cdcb81..8ddd922e5 100644
16--- a/policy/modules/services/avahi.te 16--- a/policy/modules/services/avahi.te
17+++ b/policy/modules/services/avahi.te 17+++ b/policy/modules/services/avahi.te
18@@ -95,6 +95,8 @@ sysnet_etc_filetrans_config(avahi_t) 18@@ -95,6 +95,8 @@ sysnet_etc_filetrans_config(avahi_t)
diff --git a/recipes-security/refpolicy/refpolicy/0085-policy-modules-services-bluetooth-make-bluetooth_t-d.patch b/recipes-security/refpolicy/refpolicy/0085-policy-modules-services-bluetooth-make-bluetooth_t-d.patch
new file mode 100644
index 0000000..a784657
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0085-policy-modules-services-bluetooth-make-bluetooth_t-d.patch
@@ -0,0 +1,36 @@
1From 3c74f403cb38410ea7e1de0e61dafa80a60c5ba5 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Fri, 10 Jul 2020 09:18:12 +0800
4Subject: [PATCH] policy/modules/services/bluetooth: make bluetooth_t domain
5 MLS trusted for reading from files up to its clearance
6
7Fixes:
8avc: denied { search } for pid=268 comm="bluetoothd" name="journal"
9dev="tmpfs" ino=14165
10scontext=system_u:system_r:bluetooth_t:s0-s15:c0.c1023
11tcontext=system_u:object_r:syslogd_runtime_t:s15:c0.c1023 tclass=dir
12permissive=0
13
14Upstream-Status: Inappropriate [embedded specific]
15
16Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
17---
18 policy/modules/services/bluetooth.te | 2 ++
19 1 file changed, 2 insertions(+)
20
21diff --git a/policy/modules/services/bluetooth.te b/policy/modules/services/bluetooth.te
22index b3df695db..931021346 100644
23--- a/policy/modules/services/bluetooth.te
24+++ b/policy/modules/services/bluetooth.te
25@@ -132,6 +132,8 @@ userdom_dontaudit_search_user_home_dirs(bluetooth_t)
26 init_dbus_send_script(bluetooth_t)
27 systemd_dbus_chat_hostnamed(bluetooth_t)
28
29+mls_file_read_to_clearance(bluetooth_t)
30+
31 optional_policy(`
32 dbus_system_bus_client(bluetooth_t)
33 dbus_connect_system_bus(bluetooth_t)
34--
352.17.1
36
diff --git a/recipes-security/refpolicy/refpolicy/0086-policy-modules-system-sysnetwork-make-dhcpc_t-domain.patch b/recipes-security/refpolicy/refpolicy/0086-policy-modules-system-sysnetwork-make-dhcpc_t-domain.patch
new file mode 100644
index 0000000..2ba3100
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0086-policy-modules-system-sysnetwork-make-dhcpc_t-domain.patch
@@ -0,0 +1,38 @@
1From 1ab2ca67db9205f484ebce022be9c9a42bacc802 Mon Sep 17 00:00:00 2001
2From: Wenzong Fan <wenzong.fan@windriver.com>
3Date: Thu, 23 Feb 2017 08:18:36 +0000
4Subject: [PATCH] policy/modules/system/sysnetwork: make dhcpc_t domain MLS
5 trusted for reading from files up to its clearance
6
7Allow dhcpc_t to search /run/systemd/journal
8
9Fixes:
10avc: denied { search } for pid=218 comm="dhclient" name="journal"
11dev="tmpfs" ino=10990 scontext=system_u:system_r:dhcpc_t:s0-s15:c0.c1023
12tcontext=system_u:object_r:syslogd_runtime_t:s15:c0.c1023 tclass=dir
13permissive=0
14
15Upstream-Status: Inappropriate [embedded specific]
16
17Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
18Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
19---
20 policy/modules/system/sysnetwork.te | 2 ++
21 1 file changed, 2 insertions(+)
22
23diff --git a/policy/modules/system/sysnetwork.te b/policy/modules/system/sysnetwork.te
24index a9297f976..b6fd3f907 100644
25--- a/policy/modules/system/sysnetwork.te
26+++ b/policy/modules/system/sysnetwork.te
27@@ -170,6 +170,8 @@ sysnet_run_ifconfig(dhcpc_t, dhcpc_roles)
28 userdom_use_user_terminals(dhcpc_t)
29 userdom_dontaudit_search_user_home_dirs(dhcpc_t)
30
31+mls_file_read_to_clearance(dhcpc_t)
32+
33 ifdef(`distro_redhat', `
34 files_exec_etc_files(dhcpc_t)
35 ')
36--
372.17.1
38
diff --git a/recipes-security/refpolicy/refpolicy/0087-policy-modules-services-inetd-make-inetd_t-domain-ML.patch b/recipes-security/refpolicy/refpolicy/0087-policy-modules-services-inetd-make-inetd_t-domain-ML.patch
new file mode 100644
index 0000000..abf5cd9
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0087-policy-modules-services-inetd-make-inetd_t-domain-ML.patch
@@ -0,0 +1,36 @@
1From 2a54a7cab41aaddc113ed71d68f82e37661c3487 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Fri, 3 Jul 2020 08:57:51 +0800
4Subject: [PATCH] policy/modules/services/inetd: make inetd_t domain MLS
5 trusted for reading from files up to its clearance
6
7Allow inetd_t to search /run/systemd/journal
8
9Fixes:
10avc: denied { search } for pid=286 comm="xinetd" name="journal"
11dev="tmpfs" ino=10990 scontext=system_u:system_r:inetd_t:s0-s15:c0.c1023
12tcontext=system_u:object_r:syslogd_runtime_t:s15:c0.c1023 tclass=dir
13permissive=0
14
15Upstream-Status: Inappropriate [embedded specific]
16
17Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
18---
19 policy/modules/services/inetd.te | 1 +
20 1 file changed, 1 insertion(+)
21
22diff --git a/policy/modules/services/inetd.te b/policy/modules/services/inetd.te
23index 1a6ad6e1a..8d1fc0241 100644
24--- a/policy/modules/services/inetd.te
25+++ b/policy/modules/services/inetd.te
26@@ -161,6 +161,7 @@ mls_socket_read_to_clearance(inetd_t)
27 mls_socket_write_to_clearance(inetd_t)
28 mls_net_outbound_all_levels(inetd_t)
29 mls_process_set_level(inetd_t)
30+mls_file_read_to_clearance(inetd_t)
31
32 userdom_dontaudit_use_unpriv_user_fds(inetd_t)
33 userdom_dontaudit_search_user_home_dirs(inetd_t)
34--
352.17.1
36
diff --git a/recipes-security/refpolicy/refpolicy/0088-policy-modules-services-bind-make-named_t-domain-MLS.patch b/recipes-security/refpolicy/refpolicy/0088-policy-modules-services-bind-make-named_t-domain-MLS.patch
new file mode 100644
index 0000000..5be48df
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0088-policy-modules-services-bind-make-named_t-domain-MLS.patch
@@ -0,0 +1,38 @@
1From 0e93ad162cda033935fbac584787417b97b4bc17 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Fri, 3 Jul 2020 09:42:21 +0800
4Subject: [PATCH] policy/modules/services/bind: make named_t domain MLS trusted
5 for reading from files up to its clearance
6
7Allow named_t to search /run/systemd/journal
8
9Fixes:
10avc: denied { search } for pid=295 comm="isc-worker0000"
11name="journal" dev="tmpfs" ino=10990
12scontext=system_u:system_r:named_t:s0-s15:c0.c1023
13tcontext=system_u:object_r:syslogd_runtime_t:s15:c0.c1023 tclass=dir
14permissive=0
15
16Upstream-Status: Inappropriate [embedded specific]
17
18Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
19---
20 policy/modules/services/bind.te | 2 ++
21 1 file changed, 2 insertions(+)
22
23diff --git a/policy/modules/services/bind.te b/policy/modules/services/bind.te
24index bf50763bd..be1813cb9 100644
25--- a/policy/modules/services/bind.te
26+++ b/policy/modules/services/bind.te
27@@ -165,6 +165,8 @@ miscfiles_read_generic_tls_privkey(named_t)
28 userdom_dontaudit_use_unpriv_user_fds(named_t)
29 userdom_dontaudit_search_user_home_dirs(named_t)
30
31+mls_file_read_to_clearance(named_t)
32+
33 tunable_policy(`named_tcp_bind_http_port',`
34 corenet_sendrecv_http_server_packets(named_t)
35 corenet_tcp_bind_http_port(named_t)
36--
372.17.1
38
diff --git a/recipes-security/refpolicy/refpolicy/0060-policy-modules-services-rpc-make-rpcd_t-MLS-trusted-.patch b/recipes-security/refpolicy/refpolicy/0089-policy-modules-services-rpc-make-rpcd_t-MLS-trusted-.patch
index 8f68d66..7adaea0 100644
--- a/recipes-security/refpolicy/refpolicy/0060-policy-modules-services-rpc-make-rpcd_t-MLS-trusted-.patch
+++ b/recipes-security/refpolicy/refpolicy/0089-policy-modules-services-rpc-make-rpcd_t-MLS-trusted-.patch
@@ -1,4 +1,4 @@
1From 1c71d74635c2b39a15c449e75eacae23b3d4f1b8 Mon Sep 17 00:00:00 2001 1From 58cdf21546b973b458a26ea4b3a523275a80aca5 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com> 2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Thu, 30 May 2019 08:30:06 +0800 3Date: Thu, 30 May 2019 08:30:06 +0800
4Subject: [PATCH] policy/modules/services/rpc: make rpcd_t MLS trusted for 4Subject: [PATCH] policy/modules/services/rpc: make rpcd_t MLS trusted for
@@ -19,10 +19,10 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
19 1 file changed, 2 insertions(+) 19 1 file changed, 2 insertions(+)
20 20
21diff --git a/policy/modules/services/rpc.te b/policy/modules/services/rpc.te 21diff --git a/policy/modules/services/rpc.te b/policy/modules/services/rpc.te
22index 7c0b37ddc..ef6cb9b63 100644 22index 9618df04e..84caefbbb 100644
23--- a/policy/modules/services/rpc.te 23--- a/policy/modules/services/rpc.te
24+++ b/policy/modules/services/rpc.te 24+++ b/policy/modules/services/rpc.te
25@@ -185,6 +185,8 @@ seutil_dontaudit_search_config(rpcd_t) 25@@ -275,6 +275,8 @@ seutil_dontaudit_search_config(rpcd_t)
26 26
27 userdom_signal_all_users(rpcd_t) 27 userdom_signal_all_users(rpcd_t)
28 28
diff --git a/recipes-security/refpolicy/refpolicy/0090-policy-modules-system-systemd-make-_systemd_t-MLS-tr.patch b/recipes-security/refpolicy/refpolicy/0090-policy-modules-system-systemd-make-_systemd_t-MLS-tr.patch
new file mode 100644
index 0000000..0a18ca3
--- /dev/null
+++ b/recipes-security/refpolicy/refpolicy/0090-policy-modules-system-systemd-make-_systemd_t-MLS-tr.patch
@@ -0,0 +1,42 @@
1From abb0ef8967130c6a31b45d6dfb0970cf8415fec6 Mon Sep 17 00:00:00 2001
2From: Yi Zhao <yi.zhao@windriver.com>
3Date: Mon, 22 Feb 2021 11:28:12 +0800
4Subject: [PATCH] policy/modules/system/systemd: make *_systemd_t MLS trusted
5 for writing/reading from files at all levels
6
7Fixes:
8avc: denied { search } for pid=1148 comm="systemd" name="journal"
9dev="tmpfs" ino=206
10scontext=root:sysadm_r:sysadm_systemd_t:s0-s15:c0.c1023
11tcontext=system_u:object_r:syslogd_runtime_t:s15:c0.c1023 tclass=dir
12permissive=0
13avc: denied { write } for pid=1148 comm="systemd" name="kmsg"
14dev="devtmpfs" ino=3081
15scontext=root:sysadm_r:sysadm_systemd_t:s0-s15:c0.c1023
16tcontext=system_u:object_r:kmsg_device_t:s15:c0.c1023 tclass=chr_file
17permissive=0
18
19Upstream-Status: Inappropriate [embedded specific]
20
21Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
22---
23 policy/modules/system/systemd.if | 3 +++
24 1 file changed, 3 insertions(+)
25
26diff --git a/policy/modules/system/systemd.if b/policy/modules/system/systemd.if
27index 152139261..320619289 100644
28--- a/policy/modules/system/systemd.if
29+++ b/policy/modules/system/systemd.if
30@@ -113,6 +113,9 @@ template(`systemd_role_template',`
31
32 seutil_read_file_contexts($1_systemd_t)
33 seutil_search_default_contexts($1_systemd_t)
34+
35+ mls_file_read_all_levels($1_systemd_t)
36+ mls_file_write_all_levels($1_systemd_t)
37 ')
38
39 ######################################
40--
412.17.1
42
diff --git a/recipes-security/refpolicy/refpolicy_common.inc b/recipes-security/refpolicy/refpolicy_common.inc
index 6600af5..6e460cb 100644
--- a/recipes-security/refpolicy/refpolicy_common.inc
+++ b/recipes-security/refpolicy/refpolicy_common.inc
@@ -5,8 +5,8 @@ LICENSE = "GPLv2"
5 5
6LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=393a5ca445f6965873eca0259a17f833" 6LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=393a5ca445f6965873eca0259a17f833"
7 7
8PROVIDES += "virtual/refpolicy" 8PROVIDES = "virtual/refpolicy"
9RPROVIDES_${PN} += "refpolicy" 9RPROVIDES_${PN} = "refpolicy"
10 10
11# Specific config files for Poky 11# Specific config files for Poky
12SRC_URI += "file://customizable_types \ 12SRC_URI += "file://customizable_types \
@@ -47,58 +47,67 @@ SRC_URI += " \
47 file://0027-fc-init-add-file-context-to-etc-network-if-files.patch \ 47 file://0027-fc-init-add-file-context-to-etc-network-if-files.patch \
48 file://0028-fc-vlock-apply-policy-to-vlock-alternatives.patch \ 48 file://0028-fc-vlock-apply-policy-to-vlock-alternatives.patch \
49 file://0029-fc-cron-apply-policy-to-etc-init.d-crond.patch \ 49 file://0029-fc-cron-apply-policy-to-etc-init.d-crond.patch \
50 file://0030-file_contexts.subs_dist-set-aliase-for-root-director.patch \ 50 file://0030-fc-sysnetwork-update-file-context-for-ifconfig.patch \
51 file://0031-policy-modules-system-logging-add-rules-for-the-syml.patch \ 51 file://0031-file_contexts.subs_dist-set-aliase-for-root-director.patch \
52 file://0032-policy-modules-system-logging-add-rules-for-syslogd-.patch \ 52 file://0032-policy-modules-system-logging-add-rules-for-the-syml.patch \
53 file://0033-policy-modules-system-logging-add-domain-rules-for-t.patch \ 53 file://0033-policy-modules-system-logging-add-rules-for-syslogd-.patch \
54 file://0034-policy-modules-kernel-files-add-rules-for-the-symlin.patch \ 54 file://0034-policy-modules-kernel-files-add-rules-for-the-symlin.patch \
55 file://0035-policy-modules-kernel-terminal-add-rules-for-bsdpty_.patch \ 55 file://0035-policy-modules-system-logging-fix-auditd-startup-fai.patch \
56 file://0036-policy-modules-kernel-terminal-don-t-audit-tty_devic.patch \ 56 file://0036-policy-modules-kernel-terminal-don-t-audit-tty_devic.patch \
57 file://0037-policy-modules-services-avahi-allow-avahi_t-to-watch.patch \ 57 file://0037-policy-modules-system-modutils-allow-mod_t-to-access.patch \
58 file://0038-policy-modules-system-getty-allow-getty_t-watch-gett.patch \ 58 file://0038-policy-modules-services-avahi-allow-avahi_t-to-watch.patch \
59 file://0039-policy-modules-services-bluetooth-allow-bluetooth_t-.patch \ 59 file://0039-policy-modules-system-getty-allow-getty_t-to-search-.patch \
60 file://0040-policy-modules-roles-sysadm-allow-sysadm-to-run-rpci.patch \ 60 file://0040-policy-modules-services-bluetooth-fix-bluetoothd-sta.patch \
61 file://0041-policy-modules-services-rpc-add-capability-dac_read_.patch \ 61 file://0041-policy-modules-roles-sysadm-allow-sysadm-to-run-rpci.patch \
62 file://0042-policy-modules-services-rpcbind-allow-rpcbind_t-to-c.patch \ 62 file://0042-policy-modules-services-rpc-add-capability-dac_read_.patch \
63 file://0043-policy-modules-services-rngd-fix-security-context-fo.patch \ 63 file://0043-policy-modules-services-rpcbind-allow-rpcbind_t-to-c.patch \
64 file://0044-policy-modules-system-authlogin-allow-chkpwd_t-to-ma.patch \ 64 file://0044-policy-modules-services-rngd-fix-security-context-fo.patch \
65 file://0045-policy-modules-system-udev-allow-udevadm_t-to-search.patch \ 65 file://0045-policy-modules-services-ssh-allow-ssh_keygen_t-to-re.patch \
66 file://0046-policy-modules-udev-do-not-audit-udevadm_t-to-read-w.patch \ 66 file://0046-policy-modules-services-ssh-make-respective-init-scr.patch \
67 file://0047-policy-modules-services-rdisc-allow-rdisc_t-to-searc.patch \ 67 file://0047-policy-modules-kernel-terminal-allow-loging-to-reset.patch \
68 file://0048-policy-modules-system-logging-fix-auditd-startup-fai.patch \ 68 file://0048-policy-modules-system-selinuxutil-allow-semanage_t-t.patch \
69 file://0049-policy-modules-services-ssh-make-respective-init-scr.patch \ 69 file://0049-policy-modules-system-systemd-enable-support-for-sys.patch \
70 file://0050-policy-modules-kernel-terminal-allow-loging-to-reset.patch \ 70 file://0050-policy-modules-system-systemd-fix-systemd-resolved-s.patch \
71 file://0051-policy-modules-system-selinuxutil-allow-semanage_t-t.patch \ 71 file://0051-policy-modules-system-init-add-capability2-bpf-and-p.patch \
72 file://0052-policy-modules-system-sysnetwork-allow-ifconfig_t-to.patch \ 72 file://0052-policy-modules-system-systemd-allow-systemd_logind_t.patch \
73 file://0053-policy-modules-services-ntp-allow-ntpd_t-to-watch-sy.patch \ 73 file://0053-policy-modules-system-logging-set-label-devlog_t-to-.patch \
74 file://0054-policy-modules-system-systemd-enable-support-for-sys.patch \ 74 file://0054-policy-modules-system-systemd-support-systemd-user.patch \
75 file://0055-policy-modules-system-logging-fix-systemd-journald-s.patch \ 75 file://0055-policy-modules-system-systemd-allow-systemd-generato.patch \
76 file://0056-policy-modules-roles-sysadm-allow-sysadm_t-to-watch-.patch \ 76 file://0056-policy-modules-system-systemd-allow-systemd_backligh.patch \
77 file://0057-policy-modules-system-systemd-add-capability-mknod-f.patch \ 77 file://0057-policy-modules-system-logging-fix-systemd-journald-s.patch \
78 file://0058-policy-modules-system-systemd-systemd-gpt-auto-gener.patch \ 78 file://0058-policy-modules-services-cron-allow-crond_t-to-search.patch \
79 file://0059-policy-modules-services-rpc-fix-policy-for-nfsserver.patch \ 79 file://0059-policy-modules-services-crontab-allow-sysadm_r-to-ru.patch \
80 file://0060-policy-modules-services-rpc-make-rpcd_t-MLS-trusted-.patch \ 80 file://0060-policy-modules-system-sysnetwork-support-priviledge-.patch \
81 file://0061-policy-modules-roles-sysadm-MLS-sysadm-rw-to-clearan.patch \ 81 file://0061-policy-modules-services-acpi-allow-acpid-to-watch-th.patch \
82 file://0062-policy-modules-system-mount-make-mount_t-domain-MLS-.patch \ 82 file://0062-policy-modules-system-setrans-allow-setrans-to-acces.patch \
83 file://0063-policy-modules-system-setrans-allow-setrans-to-acces.patch \ 83 file://0063-policy-modules-system-modutils-allow-kmod_t-to-write.patch \
84 file://0064-policy-modules-admin-dmesg-make-dmesg_t-MLS-trusted-.patch \ 84 file://0064-policy-modules-roles-sysadm-allow-sysadm_t-to-watch-.patch \
85 file://0065-policy-modules-kernel-kernel-make-kernel_t-MLS-trust.patch \ 85 file://0065-policy-modules-system-selinux-allow-setfiles_t-to-re.patch \
86 file://0066-policy-modules-system-init-make-init_t-MLS-trusted-f.patch \ 86 file://0066-policy-modules-system-mount-make-mount_t-domain-MLS-.patch \
87 file://0067-policy-modules-system-systemd-make-systemd-tmpfiles_.patch \ 87 file://0067-policy-modules-roles-sysadm-MLS-sysadm-rw-to-clearan.patch \
88 file://0068-policy-modules-system-logging-add-the-syslogd_t-to-t.patch \ 88 file://0068-policy-modules-services-rpc-make-nfsd_t-domain-MLS-t.patch \
89 file://0069-policy-modules-system-init-make-init_t-MLS-trusted-f.patch \ 89 file://0069-policy-modules-admin-dmesg-make-dmesg_t-MLS-trusted-.patch \
90 file://0070-policy-modules-system-init-all-init_t-to-read-any-le.patch \ 90 file://0070-policy-modules-kernel-kernel-make-kernel_t-MLS-trust.patch \
91 file://0071-policy-modules-system-logging-allow-auditd_t-to-writ.patch \ 91 file://0071-policy-modules-system-init-make-init_t-MLS-trusted-f.patch \
92 file://0072-policy-modules-kernel-kernel-make-kernel_t-MLS-trust.patch \ 92 file://0072-policy-modules-system-systemd-make-systemd-tmpfiles_.patch \
93 file://0073-policy-modules-system-systemd-make-systemd-logind-do.patch \ 93 file://0073-policy-modules-system-logging-add-the-syslogd_t-to-t.patch \
94 file://0074-policy-modules-system-systemd-systemd-user-sessions-.patch \ 94 file://0074-policy-modules-system-init-make-init_t-MLS-trusted-f.patch \
95 file://0075-policy-modules-system-systemd-systemd-networkd-make-.patch \ 95 file://0075-policy-modules-system-init-all-init_t-to-read-any-le.patch \
96 file://0076-policy-modules-system-systemd-systemd-resolved-make-.patch \ 96 file://0076-policy-modules-system-logging-allow-auditd_t-to-writ.patch \
97 file://0077-policy-modules-system-systemd-make-systemd-modules_t.patch \ 97 file://0077-policy-modules-kernel-kernel-make-kernel_t-MLS-trust.patch \
98 file://0078-policy-modules-system-systemd-systemd-gpt-auto-gener.patch \ 98 file://0078-policy-modules-system-systemd-make-systemd-logind-do.patch \
99 file://0079-policy-modules-services-ntp-make-nptd_t-MLS-trusted-.patch \ 99 file://0079-policy-modules-system-systemd-systemd-user-sessions-.patch \
100 file://0080-policy-modules-services-avahi-make-avahi_t-MLS-trust.patch \ 100 file://0080-policy-modules-system-systemd-systemd-make-systemd_-.patch \
101 file://0081-fc-sysnetwork-update-file-context-for-ifconfig.patch \ 101 file://0081-policy-modules-services-ntp-make-nptd_t-MLS-trusted-.patch \
102 file://0082-policy-modules-system-setrans-allow-setrans_t-use-fd.patch \
103 file://0083-policy-modules-services-acpi-make-acpid_t-domain-MLS.patch \
104 file://0084-policy-modules-services-avahi-make-avahi_t-MLS-trust.patch \
105 file://0085-policy-modules-services-bluetooth-make-bluetooth_t-d.patch \
106 file://0086-policy-modules-system-sysnetwork-make-dhcpc_t-domain.patch \
107 file://0087-policy-modules-services-inetd-make-inetd_t-domain-ML.patch \
108 file://0088-policy-modules-services-bind-make-named_t-domain-MLS.patch \
109 file://0089-policy-modules-services-rpc-make-rpcd_t-MLS-trusted-.patch \
110 file://0090-policy-modules-system-systemd-make-_systemd_t-MLS-tr.patch \
102 " 111 "
103 112
104S = "${WORKDIR}/refpolicy" 113S = "${WORKDIR}/refpolicy"
diff --git a/recipes-security/refpolicy/refpolicy_git.inc b/recipes-security/refpolicy/refpolicy_git.inc
index 122b7b6..f131646 100644
--- a/recipes-security/refpolicy/refpolicy_git.inc
+++ b/recipes-security/refpolicy/refpolicy_git.inc
@@ -1,8 +1,8 @@
1PV = "2.20200229+git${SRCPV}" 1PV = "2.20210203+git${SRCPV}"
2 2
3SRC_URI = "git://github.com/SELinuxProject/refpolicy.git;protocol=git;branch=master;name=refpolicy;destsuffix=refpolicy" 3SRC_URI = "git://github.com/SELinuxProject/refpolicy.git;protocol=git;branch=master;name=refpolicy;destsuffix=refpolicy"
4 4
5SRCREV_refpolicy ?= "613708cad64943bae4e2de00df7b8e656446dd2f" 5SRCREV_refpolicy ?= "1167739da1882f9c89281095d2595da5ea2d9d6b"
6 6
7UPSTREAM_CHECK_GITTAGREGEX = "RELEASE_(?P<pver>\d+_\d+)" 7UPSTREAM_CHECK_GITTAGREGEX = "RELEASE_(?P<pver>\d+_\d+)"
8 8