From patchwork Mon Nov 16 02:56:15 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Qi X-Patchwork-Id: 104298 Received: from cetc.com.cn (cetc.com.cn [220.181.39.39]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.20382.1794797800161814519 for ; Sun, 15 Nov 2026 18:56:41 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: cetc.com.cn, ip: 220.181.39.39, mailfrom: chenqi_hycx@cetc.com.cn) Received: from mail.cetc.com.cn (unknown [123.125.172.206]) by mtasvr (Coremail) with SMTP id _____wD3sslmcPpqYNQAAA--.948S3; Mon, 16 Nov 2026 10:54:30 +0800 (CST) Received: from chenqi-Redmi.. (unknown [123.125.172.206]) by front01 (Coremail) with SMTP id C6CowABn+WnccPpqPNA3AA--.14039S3; Mon, 16 Nov 2026 10:56:30 +0800 (CST) From: chenqi_hycx@cetc.com.cn To: yocto-patches@lists.yoctoproject.org Cc: chen_q07@163.com Subject: [PATCH 1/6] refpolicy: bump to latest Date: Mon, 16 Nov 2026 10:56:15 +0800 Message-ID: <20261116025620.2558594-2-chenqi_hycx@cetc.com.cn> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261116025620.2558594-1-chenqi_hycx@cetc.com.cn> References: <20261116025620.2558594-1-chenqi_hycx@cetc.com.cn> MIME-Version: 1.0 X-CM-TRANSID: C6CowABn+WnccPpqPNA3AA--.14039S3 X-CM-SenderInfo: xfkh015lbk5un06fv33fof0zgofq/1tbiAgYNCmr5tRgFSgADsx X-CM-DELIVERINFO: =?B?Q8OP76c9tbm9bwt5VqgwP2Pu2dSP9LtrOQxHOAXUJl/eWtrOBydmTZkAAV6p44o2Ir PoONahKFcN3sR551ZGDSnKFd9Oyf95H3hydTUGBI9qMpMXfH9/s2F4N6/7v0gi1R14NA7O S49C1S+dTrHld3lbvnJ5aRBlGnxz2xTFyYapbkYP/PSwPpLEIx12YMqzNBsj3g== X-Coremail-Antispam: 1Uk129KBj9fXoWDuFWrCr1Duw4xZFW8GF43XFc_yoWfKFWUXo W8KanIqa1xCry7GF1Ika17ZFyUZwsIqa97JrWrJF18GFWktFy3tFs7CwnxJFWrWFy8ZF45 ZryUu34kZr9rJr1Ul-sFpf9Il3svdjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8wcxFpf 9Il3svdxBIdaVrn5kqx4xG64xvF2IEw4CE5I8CrVC2j2Wlc2xSY4AK67AK6r4UYxn0WfAS r-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUUbVkYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI 8I6I8E6xAIw20EY4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJ M28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2I x0cI8IcVCY1x0267AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xv wVC2z280aVCY1x0267AKxVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6x kI12xvs2x26I8E6xACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v2 6r106r15McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2 Ij64vIr41lw4CEc2x0rVAKj4xxMxkIecxEwVAFwVW8JwCF04k20xvY0x0EwIxGrwCFx2Iq xVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r 106r1rMI8E67AF67kF1VAFwI0_Jrv_JF1lIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AK xVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF04k26cxKx2IYs7 xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Jr0_ GrUvcSsGvfC2KfnxnUUI43ZEXa7IU16pB3UUUUU== List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Mon, 16 Nov 2026 02:56:42 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/5400 From: Chen Qi Bump to latest mainly for fixing issues for new systemd. The commits are: ``` 720c02a1b Merge pull request #1282 from ChenQi1989/bugfix-systemd 59a48ba7e Merge pull request #1284 from dsugar100/main d6ef7f26b systemd: let the user manager getattr clock devices 98421e290 systemd: allow systemd-coredumpd to start c89e5d936 systemd: give /run/sysctl.d its own type b88bdf4fe systemd: let user systemd-tmpfiles read /usr 8c2498a23 ntp: let systemd-timesyncd read the IPv6 sysctls 13afa2496 systemd: allow varlink socket xattr access c9085fb7c logging: grant journald access to /run/systemd/units 2c5e71180 fapolicyd: ptrace permission for user namespace ``` Signed-off-by: Chen Qi --- ...tile-alias-common-var-volatile-paths.patch | 5 +---- ...e-unconfined_u-definition-to-unconfi.patch | 13 +++++------- ...box-set-aliases-for-bin-sbin-and-usr.patch | 5 +---- ...ed-make-unconfined_u-the-default-sel.patch | 7 ++----- ...y-policy-to-common-yocto-hostname-al.patch | 5 +---- ...sr-bin-bash-context-to-bin-bash.bash.patch | 9 +++------ ...abel-resolv.conf-in-var-run-properly.patch | 5 +---- ...-apply-login-context-to-login.shadow.patch | 5 +---- ...-fc-hwclock-add-hwclock-alternatives.patch | 5 +---- ...g-apply-policy-to-dmesg-alternatives.patch | 5 +---- ...ssh-apply-policy-to-ssh-alternatives.patch | 5 +---- ...ply-policy-to-network-commands-alter.patch | 5 +---- ...ply-rpm_exec-policy-to-cpio-binaries.patch | 5 +---- ...c-su-apply-policy-to-su-alternatives.patch | 5 +---- ...fc-fstools-fix-real-path-for-fstools.patch | 5 +---- ...fix-update-alternatives-for-sysvinit.patch | 11 ++++------ ...l-apply-policy-to-brctl-alternatives.patch | 5 +---- ...apply-policy-to-nologin-alternatives.patch | 9 +++------ ...apply-policy-to-sulogin-alternatives.patch | 5 +---- ...tp-apply-policy-to-ntpd-alternatives.patch | 5 +---- ...pply-policy-to-kerberos-alternatives.patch | 5 +---- ...ap-apply-policy-to-ldap-alternatives.patch | 5 +---- ...ply-policy-to-postgresql-alternative.patch | 5 +---- ...ply-policy-to-usermanage-alternative.patch | 5 +---- ...etty-add-file-context-to-start_getty.patch | 5 +---- ...k-apply-policy-to-vlock-alternatives.patch | 5 +---- ...for-init-scripts-and-systemd-service.patch | 9 +++------ ...bs_dist-set-aliase-for-root-director.patch | 5 +---- ...ystem-logging-add-rules-for-the-syml.patch | 7 ++----- ...ystem-logging-add-rules-for-syslogd-.patch | 7 ++----- ...ernel-files-add-rules-for-the-symlin.patch | 5 +---- ...ystem-logging-fix-auditd-startup-fai.patch | 7 ++----- ...ernel-terminal-don-t-audit-tty_devic.patch | 5 +---- ...ystem-systemd-enable-support-for-sys.patch | 7 ++----- ...es-system-systemd-systemd-user-fixes.patch | 13 +++++------- ...ystem-logging-grant-getpcap-capabili.patch | 7 ++----- ...ystem-allow-services-to-read-tmpfs-u.patch | 15 ++++++-------- ...ernel-domain-allow-all-domains-to-co.patch | 9 +++------ ...-allow-systemd-logind-to-inherit-fds.patch | 11 ++++------ ...stemd-tmpfiles-to-read-bin_t-symlink.patch | 17 +++++++--------- ...-systemd-networkd-and-systemd-rfkill.patch | 13 +++++------- ...main-used-for-login-program-to-conne.patch | 20 +++++++++---------- ...temd-add-rules-for-systemd-ssh-issue.patch | 15 ++++++-------- ...ystem-mount-make-mount_t-domain-MLS-.patch | 5 +---- ...oles-sysadm-MLS-sysadm-rw-to-clearan.patch | 7 ++----- ...ervices-rpc-make-nfsd_t-domain-MLS-t.patch | 13 +++++------- ...dmin-dmesg-make-dmesg_t-MLS-trusted-.patch | 5 +---- ...ernel-kernel-make-kernel_t-MLS-trust.patch | 9 +++------ ...ystem-init-make-init_t-MLS-trusted-f.patch | 9 +++------ ...ystem-systemd-make-systemd-tmpfiles_.patch | 9 +++------ ...ystem-systemd-systemd-make-systemd_-.patch | 15 ++++++-------- ...ystem-logging-add-the-syslogd_t-to-t.patch | 7 ++----- ...ystem-init-make-init_t-MLS-trusted-f.patch | 9 +++------ ...ystem-init-all-init_t-to-read-any-le.patch | 9 +++------ ...ystem-logging-allow-auditd_t-to-writ.patch | 7 ++----- ...ernel-kernel-make-kernel_t-MLS-trust.patch | 9 +++------ ...ystem-setrans-allow-setrans_t-use-fd.patch | 5 +---- ...ystem-systemd-make-_systemd_t-MLS-tr.patch | 9 +++------ ...ystem-logging-make-syslogd_runtime_t.patch | 7 ++----- recipes-security/refpolicy/refpolicy_git.inc | 2 +- 60 files changed, 143 insertions(+), 319 deletions(-) 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 d269f72..49438fa 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 @@ -From 353f0521c52ea934cc1745d53fea8cad429b3a60 Mon Sep 17 00:00:00 2001 +From 99ea3d625e107b4ea8add75682652c7e1c8a9429 Mon Sep 17 00:00:00 2001 From: Joe MacDonald Date: Thu, 28 Mar 2019 16:14:09 -0400 Subject: [PATCH] fc/subs/volatile: alias common /var/volatile paths @@ -31,6 +31,3 @@ index deeadcb80..8b9423db8 100644 # systemd system extension (systemd-sysext) staging dirs merge onto /usr and /opt, # and systemd configuration extension (systemd-confext) staging dirs merge onto /etc. # The staged trees are overlaid onto the host tree with overlayfs, so they must carry - --- -2.43.0 diff --git a/recipes-security/refpolicy/refpolicy/0001-refpolicy-targeted-Revert-users-Move-unconfined_u-definition-to-unconfi.patch b/recipes-security/refpolicy/refpolicy/0001-refpolicy-targeted-Revert-users-Move-unconfined_u-definition-to-unconfi.patch index a87a7bc..54a7203 100644 --- a/recipes-security/refpolicy/refpolicy/0001-refpolicy-targeted-Revert-users-Move-unconfined_u-definition-to-unconfi.patch +++ b/recipes-security/refpolicy/refpolicy/0001-refpolicy-targeted-Revert-users-Move-unconfined_u-definition-to-unconfi.patch @@ -1,4 +1,4 @@ -From 72c80020c69df0035a39fb1d6db8c75b2a4f7fa8 Mon Sep 17 00:00:00 2001 +From 7f13171702da2e79f2d5aacf83a8ced3c275b07c Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Wed, 19 Feb 2025 21:35:02 +0800 Subject: [PATCH] Revert "users: Move unconfined_u definition to unconfined @@ -18,10 +18,10 @@ Signed-off-by: Yi Zhao 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/policy/modules/kernel/kernel.te b/policy/modules/kernel/kernel.te -index 287b0098f..26978623b 100644 +index 3756a0135..084550ee2 100644 --- a/policy/modules/kernel/kernel.te +++ b/policy/modules/kernel/kernel.te -@@ -37,6 +37,9 @@ role sysadm_r; +@@ -45,6 +45,9 @@ role sysadm_r; role staff_r; role user_r; @@ -32,7 +32,7 @@ index 287b0098f..26978623b 100644 role secadm_r; role auditadm_r; diff --git a/policy/modules/system/unconfined.te b/policy/modules/system/unconfined.te -index 1c98f5e85..4ef723b85 100644 +index 169ecd759..580a483c3 100644 --- a/policy/modules/system/unconfined.te +++ b/policy/modules/system/unconfined.te @@ -8,9 +8,6 @@ policy_module(unconfined) @@ -45,7 +45,7 @@ index 1c98f5e85..4ef723b85 100644 userdom_base_user_template(unconfined) userdom_manage_home_role(unconfined_r, unconfined_t) userdom_manage_tmp_role(unconfined_r, unconfined_t) -@@ -277,14 +274,3 @@ unconfined_domain_noaudit(unconfined_execmem_t) +@@ -269,14 +266,3 @@ optional_policy(` optional_policy(` unconfined_dbus_chat(unconfined_execmem_t) ') @@ -78,6 +78,3 @@ index 25402afd8..ca203758c 100644 # # The following users correspond to Unix identities. # These identities are typically assigned as the user attribute --- -2.34.1 - 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 d7e525f..02f1c2f 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 @@ -From 1cb7a914b570ca8dd51ea7b4e6a4ffadedde709d Mon Sep 17 00:00:00 2001 +From 8468ca5ac7bf49c912e867692866def91e20f5c3 Mon Sep 17 00:00:00 2001 From: Joe MacDonald Date: Thu, 28 Mar 2019 20:48:10 -0400 Subject: [PATCH] fc/subs/busybox: set aliases for bin, sbin and usr @@ -31,6 +31,3 @@ index 8b9423db8..bae4ef439 100644 # systemd system extension (systemd-sysext) staging dirs merge onto /usr and /opt, # and systemd configuration extension (systemd-confext) staging dirs merge onto /etc. # The staged trees are overlaid onto the host tree with overlayfs, so they must carry - --- -2.43.0 diff --git a/recipes-security/refpolicy/refpolicy/0002-refpolicy-targeted-make-unconfined_u-the-default-sel.patch b/recipes-security/refpolicy/refpolicy/0002-refpolicy-targeted-make-unconfined_u-the-default-sel.patch index f5c75e7..8dd07e1 100644 --- a/recipes-security/refpolicy/refpolicy/0002-refpolicy-targeted-make-unconfined_u-the-default-sel.patch +++ b/recipes-security/refpolicy/refpolicy/0002-refpolicy-targeted-make-unconfined_u-the-default-sel.patch @@ -1,4 +1,4 @@ -From 34f61ba8c90107644ab2be8cc5a4eb70f2b3c0da Mon Sep 17 00:00:00 2001 +From dd3d0185ab5546b61810a461a216915d0cfe6b1d Mon Sep 17 00:00:00 2001 From: Xin Ouyang Date: Mon, 20 Apr 2020 11:50:03 +0800 Subject: [PATCH] refpolicy-targeted: make unconfined_u the default selinux @@ -38,7 +38,7 @@ index ce614b41b..c0903d98b 100644 +root:unconfined_u:s0-mcs_systemhigh +__default__:unconfined_u:s0 diff --git a/policy/modules/system/unconfined.te b/policy/modules/system/unconfined.te -index 4ef723b85..671d38664 100644 +index 580a483c3..a78743317 100644 --- a/policy/modules/system/unconfined.te +++ b/policy/modules/system/unconfined.te @@ -20,6 +20,11 @@ type unconfined_execmem_t alias ada_t; @@ -76,6 +76,3 @@ index ca203758c..e737cd9cc 100644 - gen_user(root, sysadm, sysadm_r staff_r ifdef(`enable_mls',`secadm_r auditadm_r'), s0, s0 - mls_systemhigh, mcs_allcats) + gen_user(root, sysadm, unconfined_r sysadm_r staff_r ifdef(`enable_mls',`secadm_r auditadm_r'), s0, s0 - mls_systemhigh, mcs_allcats) ') --- -2.34.1 - 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 616bfb9..7d80860 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 @@ -From 497c78fb77d0b00e02f7268b470dc2c8378eafdc Mon Sep 17 00:00:00 2001 +From 02f5eafeec3df2027d520cae23c58e8c9c0c95b6 Mon Sep 17 00:00:00 2001 From: Xin Ouyang Date: Thu, 22 Aug 2013 13:37:23 +0800 Subject: [PATCH] fc/hostname: apply policy to common yocto hostname @@ -21,6 +21,3 @@ index 83ddeb573..cf523bc4c 100644 /usr/bin/hostname -- gen_context(system_u:object_r:hostname_exec_t,s0) +/usr/bin/hostname\.net-tools -- gen_context(system_u:object_r:hostname_exec_t,s0) +/usr/bin/hostname\.coreutils -- gen_context(system_u:object_r:hostname_exec_t,s0) --- -2.34.1 - 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 b5121cf..c47b828 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 @@ -From 9ca5ab98c9bd1fe320fe131b8e9d79bce7378a68 Mon Sep 17 00:00:00 2001 +From 9fb0297420393e8d9f6823315569aaab6cbd4d7d Mon Sep 17 00:00:00 2001 From: Joe MacDonald Date: Thu, 28 Mar 2019 21:37:32 -0400 Subject: [PATCH] fc/bash: apply /usr/bin/bash context to /bin/bash.bash @@ -15,10 +15,10 @@ Signed-off-by: Yi Zhao 1 file changed, 1 insertion(+) diff --git a/policy/modules/kernel/corecommands.fc b/policy/modules/kernel/corecommands.fc -index 59164d5c6..469dbe67c 100644 +index 45a87fae4..07c74a4e5 100644 --- a/policy/modules/kernel/corecommands.fc +++ b/policy/modules/kernel/corecommands.fc -@@ -155,6 +155,7 @@ ifdef(`distro_gentoo',` +@@ -158,6 +158,7 @@ ifdef(`distro_gentoo',` /usr/bin(/.*)? gen_context(system_u:object_r:bin_t,s0) /usr/bin/d?ash -- gen_context(system_u:object_r:shell_exec_t,s0) /usr/bin/bash -- gen_context(system_u:object_r:shell_exec_t,s0) @@ -26,6 +26,3 @@ index 59164d5c6..469dbe67c 100644 /usr/bin/bash2 -- gen_context(system_u:object_r:shell_exec_t,s0) /usr/bin/fish -- gen_context(system_u:object_r:shell_exec_t,s0) /usr/bin/git-shell -- gen_context(system_u:object_r:shell_exec_t,s0) --- -2.34.1 - 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 3cb2e91..8aa04df 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 @@ -From dd13c78e2540ace19b4c671f0e5a8c8d8e842930 Mon Sep 17 00:00:00 2001 +From f2871ad9554240bcb02a2b7f7498771c0c94dddc Mon Sep 17 00:00:00 2001 From: Joe MacDonald Date: Thu, 4 Apr 2019 10:45:03 -0400 Subject: [PATCH] fc/resolv.conf: label resolv.conf in var/run/ properly @@ -24,6 +24,3 @@ index 2e035b326..eab862b3d 100644 ifdef(`distro_gentoo',` /var/lib/dhcpc(/.*)? gen_context(system_u:object_r:dhcpc_state_t,s0) --- -2.34.1 - 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 86c4b07..10392cd 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 @@ -From eec64127ce7d0c50b40ae7fd8a8891def106ef37 Mon Sep 17 00:00:00 2001 +From 26b0e440206a4a6d1fabed669a21fd96eb475cf2 Mon Sep 17 00:00:00 2001 From: Joe MacDonald Date: Thu, 28 Mar 2019 21:43:53 -0400 Subject: [PATCH] fc/login: apply login context to login.shadow @@ -23,6 +23,3 @@ index 584b78fa3..ace52ee63 100644 /usr/bin/pam_console_apply -- gen_context(system_u:object_r:pam_console_exec_t,s0) /usr/bin/pam_timestamp_check -- gen_context(system_u:object_r:pam_exec_t,s0) /usr/bin/tcb_convert -- gen_context(system_u:object_r:updpwd_exec_t,s0) --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0007-fc-hwclock-add-hwclock-alternatives.patch b/recipes-security/refpolicy/refpolicy/0007-fc-hwclock-add-hwclock-alternatives.patch index c86b568..871f0d3 100644 --- a/recipes-security/refpolicy/refpolicy/0007-fc-hwclock-add-hwclock-alternatives.patch +++ b/recipes-security/refpolicy/refpolicy/0007-fc-hwclock-add-hwclock-alternatives.patch @@ -1,4 +1,4 @@ -From 85a5dda3e1ec15ca867ff459256e987d3fc98718 Mon Sep 17 00:00:00 2001 +From f320908cf3df534dd35aa9c680e32c80a4381d26 Mon Sep 17 00:00:00 2001 From: Joe MacDonald Date: Thu, 28 Mar 2019 21:59:18 -0400 Subject: [PATCH] fc/hwclock: add hwclock alternatives @@ -21,6 +21,3 @@ index 4ed95240e..b8e6b801c 100644 /usr/bin/hwclock -- gen_context(system_u:object_r:hwclock_exec_t,s0) +/usr/bin/hwclock\.util-linux -- gen_context(system_u:object_r:hwclock_exec_t,s0) --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0008-fc-dmesg-apply-policy-to-dmesg-alternatives.patch b/recipes-security/refpolicy/refpolicy/0008-fc-dmesg-apply-policy-to-dmesg-alternatives.patch index ac52d2f..fa8b3f7 100644 --- a/recipes-security/refpolicy/refpolicy/0008-fc-dmesg-apply-policy-to-dmesg-alternatives.patch +++ b/recipes-security/refpolicy/refpolicy/0008-fc-dmesg-apply-policy-to-dmesg-alternatives.patch @@ -1,4 +1,4 @@ -From 7a8bf5af71c6b931cd7f8f3f103ed4de119339f0 Mon Sep 17 00:00:00 2001 +From e900c5de27ac6c9f2780ddbd4b0a339808051ec7 Mon Sep 17 00:00:00 2001 From: Joe MacDonald Date: Fri, 29 Mar 2019 08:26:55 -0400 Subject: [PATCH] fc/dmesg: apply policy to dmesg alternatives @@ -18,6 +18,3 @@ index e52fdfcf8..526b92ed2 100644 @@ -1 +1,2 @@ /usr/bin/dmesg -- gen_context(system_u:object_r:dmesg_exec_t,s0) +/usr/bin/dmesg\.util-linux -- gen_context(system_u:object_r:dmesg_exec_t,s0) --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0009-fc-ssh-apply-policy-to-ssh-alternatives.patch b/recipes-security/refpolicy/refpolicy/0009-fc-ssh-apply-policy-to-ssh-alternatives.patch index e049627..c9a16ec 100644 --- a/recipes-security/refpolicy/refpolicy/0009-fc-ssh-apply-policy-to-ssh-alternatives.patch +++ b/recipes-security/refpolicy/refpolicy/0009-fc-ssh-apply-policy-to-ssh-alternatives.patch @@ -1,4 +1,4 @@ -From 87366cc35ac0d63581076ad1885064f8f26e7469 Mon Sep 17 00:00:00 2001 +From 15bb77687cd69ac02f12e59b468f15880664ae0a Mon Sep 17 00:00:00 2001 From: Joe MacDonald Date: Fri, 29 Mar 2019 09:20:58 -0400 Subject: [PATCH] fc/ssh: apply policy to ssh alternatives @@ -23,6 +23,3 @@ index f9dd0752d..13d9dd35d 100644 /usr/bin/ssh-agent -- gen_context(system_u:object_r:ssh_agent_exec_t,s0) /usr/bin/ssh-keygen -- gen_context(system_u:object_r:ssh_keygen_exec_t,s0) /usr/bin/sshd -- gen_context(system_u:object_r:sshd_exec_t,s0) --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0010-fc-sysnetwork-apply-policy-to-network-commands-alter.patch b/recipes-security/refpolicy/refpolicy/0010-fc-sysnetwork-apply-policy-to-network-commands-alter.patch index 5c87320..8222c79 100644 --- a/recipes-security/refpolicy/refpolicy/0010-fc-sysnetwork-apply-policy-to-network-commands-alter.patch +++ b/recipes-security/refpolicy/refpolicy/0010-fc-sysnetwork-apply-policy-to-network-commands-alter.patch @@ -1,4 +1,4 @@ -From 9fa0c7e1c999f0362cc1661366d6cd2767a7019d Mon Sep 17 00:00:00 2001 +From fcfb4879982be60f0270cd8b5722bbeb7c34b763 Mon Sep 17 00:00:00 2001 From: Xin Ouyang Date: Tue, 9 Jun 2015 21:22:52 +0530 Subject: [PATCH] fc/sysnetwork: apply policy to network commands alternatives @@ -34,6 +34,3 @@ index eab862b3d..4c9dac6f3 100644 /usr/bin/pump -- gen_context(system_u:object_r:dhcpc_exec_t,s0) /usr/bin/tc -- gen_context(system_u:object_r:ifconfig_exec_t,s0) --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0011-fc-rpm-apply-rpm_exec-policy-to-cpio-binaries.patch b/recipes-security/refpolicy/refpolicy/0011-fc-rpm-apply-rpm_exec-policy-to-cpio-binaries.patch index 13a9540..b17c744 100644 --- a/recipes-security/refpolicy/refpolicy/0011-fc-rpm-apply-rpm_exec-policy-to-cpio-binaries.patch +++ b/recipes-security/refpolicy/refpolicy/0011-fc-rpm-apply-rpm_exec-policy-to-cpio-binaries.patch @@ -1,4 +1,4 @@ -From 6a3fdc4dc073cf37a782292fc1cd006f9c26f68c Mon Sep 17 00:00:00 2001 +From 801744f67c0359d103c1339b2a06fd77ef8115d6 Mon Sep 17 00:00:00 2001 From: Joe MacDonald Date: Fri, 29 Mar 2019 09:54:07 -0400 Subject: [PATCH] fc/rpm: apply rpm_exec policy to cpio binaries @@ -21,6 +21,3 @@ index 059c35a68..22e2a3f65 100644 /usr/bin/cpio -- gen_context(system_u:object_r:rpm_exec_t,s0) +/usr/bin/cpio\.cpio -- gen_context(system_u:object_r:rpm_exec_t,s0) ') --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0012-fc-su-apply-policy-to-su-alternatives.patch b/recipes-security/refpolicy/refpolicy/0012-fc-su-apply-policy-to-su-alternatives.patch index a822887..3c3c2da 100644 --- a/recipes-security/refpolicy/refpolicy/0012-fc-su-apply-policy-to-su-alternatives.patch +++ b/recipes-security/refpolicy/refpolicy/0012-fc-su-apply-policy-to-su-alternatives.patch @@ -1,4 +1,4 @@ -From 03cc031e0154e032cdcaf75d1f6eeaa473cc37a1 Mon Sep 17 00:00:00 2001 +From 5ea2df182f6514eb9581a498b1a9ebc120fa7f49 Mon Sep 17 00:00:00 2001 From: Wenzong Fan Date: Thu, 13 Feb 2014 00:33:07 -0500 Subject: [PATCH] fc/su: apply policy to su alternatives @@ -22,6 +22,3 @@ index 3375c9692..a9868cd58 100644 /usr/bin/su -- gen_context(system_u:object_r:su_exec_t,s0) +/usr/bin/su\.shadow -- gen_context(system_u:object_r:su_exec_t,s0) +/usr/bin/su\.util-linux -- gen_context(system_u:object_r:su_exec_t,s0) --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0013-fc-fstools-fix-real-path-for-fstools.patch b/recipes-security/refpolicy/refpolicy/0013-fc-fstools-fix-real-path-for-fstools.patch index ab254d3..496c1b1 100644 --- a/recipes-security/refpolicy/refpolicy/0013-fc-fstools-fix-real-path-for-fstools.patch +++ b/recipes-security/refpolicy/refpolicy/0013-fc-fstools-fix-real-path-for-fstools.patch @@ -1,4 +1,4 @@ -From 4beb1c28718bce5b470ea886c2cd0a38ca7a7463 Mon Sep 17 00:00:00 2001 +From 34132461d20d9e1e3174f73022edf159e3606c2c Mon Sep 17 00:00:00 2001 From: Wenzong Fan Date: Mon, 27 Jan 2014 03:54:01 -0500 Subject: [PATCH] fc/fstools: fix real path for fstools @@ -77,6 +77,3 @@ index 8386937c4..02adc5400 100644 ifdef(`distro_gentoo',` /var/db/smartmontools(/.*)? gen_context(system_u:object_r:fsadm_db_t,s0) - --- -2.43.0 diff --git a/recipes-security/refpolicy/refpolicy/0014-fc-init-fix-update-alternatives-for-sysvinit.patch b/recipes-security/refpolicy/refpolicy/0014-fc-init-fix-update-alternatives-for-sysvinit.patch index 260d796..d1ba3cc 100644 --- a/recipes-security/refpolicy/refpolicy/0014-fc-init-fix-update-alternatives-for-sysvinit.patch +++ b/recipes-security/refpolicy/refpolicy/0014-fc-init-fix-update-alternatives-for-sysvinit.patch @@ -1,4 +1,4 @@ -From fb8cdae6d8b2b196e47941fff258882c2880f89a Mon Sep 17 00:00:00 2001 +From 5c90ced9220fc8febc784e12af7728a16566b044 Mon Sep 17 00:00:00 2001 From: Xin Ouyang Date: Thu, 22 Aug 2013 13:37:23 +0800 Subject: [PATCH] fc/init: fix update-alternatives for sysvinit @@ -27,10 +27,10 @@ index 56476f85b..22368afea 100644 /usr/lib/upstart/shutdown -- gen_context(system_u:object_r:shutdown_exec_t,s0) diff --git a/policy/modules/kernel/corecommands.fc b/policy/modules/kernel/corecommands.fc -index 469dbe67c..9020ced10 100644 +index 07c74a4e5..fba998bf8 100644 --- a/policy/modules/kernel/corecommands.fc +++ b/policy/modules/kernel/corecommands.fc -@@ -164,6 +164,8 @@ ifdef(`distro_gentoo',` +@@ -167,6 +167,8 @@ ifdef(`distro_gentoo',` /usr/bin/mkfs\.cramfs -- gen_context(system_u:object_r:bin_t,s0) /usr/bin/mksh -- gen_context(system_u:object_r:shell_exec_t,s0) /usr/bin/mountpoint -- gen_context(system_u:object_r:bin_t,s0) @@ -40,7 +40,7 @@ index 469dbe67c..9020ced10 100644 /usr/bin/sash -- gen_context(system_u:object_r:shell_exec_t,s0) /usr/bin/sesh -- gen_context(system_u:object_r:shell_exec_t,s0) diff --git a/policy/modules/system/init.fc b/policy/modules/system/init.fc -index 19c876336..e865bea85 100644 +index 775a86a35..000bd52b9 100644 --- a/policy/modules/system/init.fc +++ b/policy/modules/system/init.fc @@ -28,6 +28,7 @@ ifdef(`distro_gentoo',` @@ -51,6 +51,3 @@ index 19c876336..e865bea85 100644 /usr/bin/open_init_pty -- gen_context(system_u:object_r:initrc_exec_t,s0) /usr/bin/sepg_ctl -- gen_context(system_u:object_r:initrc_exec_t,s0) /usr/bin/systemd -- gen_context(system_u:object_r:init_exec_t,s0) --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0015-fc-brctl-apply-policy-to-brctl-alternatives.patch b/recipes-security/refpolicy/refpolicy/0015-fc-brctl-apply-policy-to-brctl-alternatives.patch index 72b1fd6..8116889 100644 --- a/recipes-security/refpolicy/refpolicy/0015-fc-brctl-apply-policy-to-brctl-alternatives.patch +++ b/recipes-security/refpolicy/refpolicy/0015-fc-brctl-apply-policy-to-brctl-alternatives.patch @@ -1,4 +1,4 @@ -From 89b022f8aa33ad403b76c3fe53caf1a5fbfe4a4b Mon Sep 17 00:00:00 2001 +From 4ca53f6752e68ec011b7c87dca1a6f82a27c3f87 Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Fri, 15 Nov 2019 10:19:54 +0800 Subject: [PATCH] fc/brctl: apply policy to brctl alternatives @@ -18,6 +18,3 @@ index c7cdc3358..231b82dc5 100644 /usr/bin/brctl -- gen_context(system_u:object_r:brctl_exec_t,s0) +/usr/bin/brctl\.bridge-utils -- gen_context(system_u:object_r:brctl_exec_t,s0) --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0016-fc-corecommands-apply-policy-to-nologin-alternatives.patch b/recipes-security/refpolicy/refpolicy/0016-fc-corecommands-apply-policy-to-nologin-alternatives.patch index 03f565c..741a117 100644 --- a/recipes-security/refpolicy/refpolicy/0016-fc-corecommands-apply-policy-to-nologin-alternatives.patch +++ b/recipes-security/refpolicy/refpolicy/0016-fc-corecommands-apply-policy-to-nologin-alternatives.patch @@ -1,4 +1,4 @@ -From c34bda34ad6855b5a75a6573dcc7b6450b1646d1 Mon Sep 17 00:00:00 2001 +From 9c8555823354b79eae2c4e6078c7520b147c962c Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Fri, 15 Nov 2019 10:21:51 +0800 Subject: [PATCH] fc/corecommands: apply policy to nologin alternatives @@ -11,10 +11,10 @@ Signed-off-by: Yi Zhao 1 file changed, 2 insertions(+) diff --git a/policy/modules/kernel/corecommands.fc b/policy/modules/kernel/corecommands.fc -index 9020ced10..851529abd 100644 +index fba998bf8..110e7471d 100644 --- a/policy/modules/kernel/corecommands.fc +++ b/policy/modules/kernel/corecommands.fc -@@ -167,6 +167,8 @@ ifdef(`distro_gentoo',` +@@ -170,6 +170,8 @@ ifdef(`distro_gentoo',` /usr/bin/mountpoint\.sysvinit -- gen_context(system_u:object_r:bin_t,s0) /usr/bin/mountpoint\.util-linux -- gen_context(system_u:object_r:bin_t,s0) /usr/bin/nologin -- gen_context(system_u:object_r:shell_exec_t,s0) @@ -23,6 +23,3 @@ index 9020ced10..851529abd 100644 /usr/bin/sash -- gen_context(system_u:object_r:shell_exec_t,s0) /usr/bin/sesh -- gen_context(system_u:object_r:shell_exec_t,s0) /usr/bin/scponly -- gen_context(system_u:object_r:shell_exec_t,s0) --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0017-fc-locallogin-apply-policy-to-sulogin-alternatives.patch b/recipes-security/refpolicy/refpolicy/0017-fc-locallogin-apply-policy-to-sulogin-alternatives.patch index 1cf6ca5..06b09c1 100644 --- a/recipes-security/refpolicy/refpolicy/0017-fc-locallogin-apply-policy-to-sulogin-alternatives.patch +++ b/recipes-security/refpolicy/refpolicy/0017-fc-locallogin-apply-policy-to-sulogin-alternatives.patch @@ -1,4 +1,4 @@ -From 074f896320aec752cf1df689982da3d6c26f48a1 Mon Sep 17 00:00:00 2001 +From f3a90d85fe025d70377eb1a2054fbbedafac52b8 Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Fri, 15 Nov 2019 10:43:28 +0800 Subject: [PATCH] fc/locallogin: apply policy to sulogin alternatives @@ -19,6 +19,3 @@ index 761b02490..a434e5013 100644 +/usr/bin/sulogin\.util-linux -- gen_context(system_u:object_r:sulogin_exec_t,s0) /usr/bin/sushell -- gen_context(system_u:object_r:sulogin_exec_t,s0) --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0018-fc-ntp-apply-policy-to-ntpd-alternatives.patch b/recipes-security/refpolicy/refpolicy/0018-fc-ntp-apply-policy-to-ntpd-alternatives.patch index ae9a5c7..8da40c3 100644 --- a/recipes-security/refpolicy/refpolicy/0018-fc-ntp-apply-policy-to-ntpd-alternatives.patch +++ b/recipes-security/refpolicy/refpolicy/0018-fc-ntp-apply-policy-to-ntpd-alternatives.patch @@ -1,4 +1,4 @@ -From bc7cf91865d4f49a2af1100e1a0b692fead807e8 Mon Sep 17 00:00:00 2001 +From e58804cde28e40af0a730fb3f6f210434b41531d Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Fri, 15 Nov 2019 10:45:23 +0800 Subject: [PATCH] fc/ntp: apply policy to ntpd alternatives @@ -22,6 +22,3 @@ index ccea79c30..f24cd7c48 100644 /usr/bin/ntpdate -- gen_context(system_u:object_r:ntpdate_exec_t,s0) /usr/bin/sntp -- gen_context(system_u:object_r:ntpdate_exec_t,s0) --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0019-fc-kerberos-apply-policy-to-kerberos-alternatives.patch b/recipes-security/refpolicy/refpolicy/0019-fc-kerberos-apply-policy-to-kerberos-alternatives.patch index 893c839..55015f6 100644 --- a/recipes-security/refpolicy/refpolicy/0019-fc-kerberos-apply-policy-to-kerberos-alternatives.patch +++ b/recipes-security/refpolicy/refpolicy/0019-fc-kerberos-apply-policy-to-kerberos-alternatives.patch @@ -1,4 +1,4 @@ -From 7d14d563c9e6256274e9b31068b8ae42d2fc4a08 Mon Sep 17 00:00:00 2001 +From ed9a362cfced476ff23bd9a2102a422947f05042 Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Fri, 15 Nov 2019 10:55:05 +0800 Subject: [PATCH] fc/kerberos: apply policy to kerberos alternatives @@ -41,6 +41,3 @@ index aae6c841d..9afe60ec4 100644 /var/log/krb5kdc\.log.* -- gen_context(system_u:object_r:krb5kdc_log_t,s0) /var/log/kadmin\.log.* -- gen_context(system_u:object_r:kadmind_log_t,s0) /var/log/kadmind\.log.* -- gen_context(system_u:object_r:kadmind_log_t,s0) - --- -2.43.0 diff --git a/recipes-security/refpolicy/refpolicy/0020-fc-ldap-apply-policy-to-ldap-alternatives.patch b/recipes-security/refpolicy/refpolicy/0020-fc-ldap-apply-policy-to-ldap-alternatives.patch index b4a6674..ea8bf30 100644 --- a/recipes-security/refpolicy/refpolicy/0020-fc-ldap-apply-policy-to-ldap-alternatives.patch +++ b/recipes-security/refpolicy/refpolicy/0020-fc-ldap-apply-policy-to-ldap-alternatives.patch @@ -1,4 +1,4 @@ -From 5028db3655914d148e82237533dc8c07f99be535 Mon Sep 17 00:00:00 2001 +From bd8e5053e24e6dffc1ba46c6cd91ce4b9fd9733d Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Fri, 15 Nov 2019 11:06:13 +0800 Subject: [PATCH] fc/ldap: apply policy to ldap alternatives @@ -35,6 +35,3 @@ index 40c09df5e..cc6c98221 100644 /run/ldapi -s gen_context(system_u:object_r:slapd_runtime_t,s0) /run/openldap(/.*)? gen_context(system_u:object_r:slapd_runtime_t,s0) /run/slapd.* -s gen_context(system_u:object_r:slapd_runtime_t,s0) --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0021-fc-postgresql-apply-policy-to-postgresql-alternative.patch b/recipes-security/refpolicy/refpolicy/0021-fc-postgresql-apply-policy-to-postgresql-alternative.patch index def5e80..3b7a873 100644 --- a/recipes-security/refpolicy/refpolicy/0021-fc-postgresql-apply-policy-to-postgresql-alternative.patch +++ b/recipes-security/refpolicy/refpolicy/0021-fc-postgresql-apply-policy-to-postgresql-alternative.patch @@ -1,4 +1,4 @@ -From 4f43e9a674623e562b1805bd06a61ef4690973d8 Mon Sep 17 00:00:00 2001 +From 57fde72ec018d30f72d6bc15d336b36e05135bdc Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Fri, 15 Nov 2019 11:13:16 +0800 Subject: [PATCH] fc/postgresql: apply policy to postgresql alternatives @@ -32,6 +32,3 @@ index f31a52cf8..f9bf46870 100644 ifdef(`distro_redhat', ` /usr/share/jonas/pgsql(/.*)? gen_context(system_u:object_r:postgresql_db_t,s0) ') --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0022-fc-usermanage-apply-policy-to-usermanage-alternative.patch b/recipes-security/refpolicy/refpolicy/0022-fc-usermanage-apply-policy-to-usermanage-alternative.patch index 9ca5223..75c00ca 100644 --- a/recipes-security/refpolicy/refpolicy/0022-fc-usermanage-apply-policy-to-usermanage-alternative.patch +++ b/recipes-security/refpolicy/refpolicy/0022-fc-usermanage-apply-policy-to-usermanage-alternative.patch @@ -1,4 +1,4 @@ -From 8f2b61f8473e0eb191446f639af7ef71fc50fbec Mon Sep 17 00:00:00 2001 +From bb0d28fe4d127af7c294c9b50c2b2971bc4b11bc Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Fri, 15 Nov 2019 11:25:34 +0800 Subject: [PATCH] fc/usermanage: apply policy to usermanage alternatives @@ -44,6 +44,3 @@ index c228ebce6..9ac425e92 100644 /usr/lib/cracklib_dict.* -- gen_context(system_u:object_r:crack_db_t,s0) --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0023-fc-getty-add-file-context-to-start_getty.patch b/recipes-security/refpolicy/refpolicy/0023-fc-getty-add-file-context-to-start_getty.patch index e9b70b2..747abfc 100644 --- a/recipes-security/refpolicy/refpolicy/0023-fc-getty-add-file-context-to-start_getty.patch +++ b/recipes-security/refpolicy/refpolicy/0023-fc-getty-add-file-context-to-start_getty.patch @@ -1,4 +1,4 @@ -From 75ad7b87b85a3fb0f0d00b88831a3171a01e8fa0 Mon Sep 17 00:00:00 2001 +From a258e7f272e01704b31aa96fbf7addfd0ae658dc Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Fri, 15 Nov 2019 16:07:30 +0800 Subject: [PATCH] fc/getty: add file context to start_getty @@ -22,6 +22,3 @@ index c7701c930..8b70b609a 100644 /var/log/mgetty\.log.* -- gen_context(system_u:object_r:getty_log_t,s0) --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0024-fc-vlock-apply-policy-to-vlock-alternatives.patch b/recipes-security/refpolicy/refpolicy/0024-fc-vlock-apply-policy-to-vlock-alternatives.patch index a03a10a..5180199 100644 --- a/recipes-security/refpolicy/refpolicy/0024-fc-vlock-apply-policy-to-vlock-alternatives.patch +++ b/recipes-security/refpolicy/refpolicy/0024-fc-vlock-apply-policy-to-vlock-alternatives.patch @@ -1,4 +1,4 @@ -From 75acb49606229cb4f8d626249efc75544dc37219 Mon Sep 17 00:00:00 2001 +From 41e094594228a1187dfb72b3e1fd28e57ce4d2e7 Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Wed, 18 Dec 2019 15:04:41 +0800 Subject: [PATCH] fc/vlock: apply policy to vlock alternatives @@ -19,6 +19,3 @@ index bdd3e6a9f..fb5b28d7c 100644 +/usr/bin/vlock\.kbd -- gen_context(system_u:object_r:vlock_exec_t,s0) /usr/bin/vlock-main -- gen_context(system_u:object_r:vlock_exec_t,s0) --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0025-fc-add-fcontext-for-init-scripts-and-systemd-service.patch b/recipes-security/refpolicy/refpolicy/0025-fc-add-fcontext-for-init-scripts-and-systemd-service.patch index 25fd308..9c7cfb6 100644 --- a/recipes-security/refpolicy/refpolicy/0025-fc-add-fcontext-for-init-scripts-and-systemd-service.patch +++ b/recipes-security/refpolicy/refpolicy/0025-fc-add-fcontext-for-init-scripts-and-systemd-service.patch @@ -1,4 +1,4 @@ -From 4db66a10c2917fe08f643726b9854d1230090bcc Mon Sep 17 00:00:00 2001 +From 99b50a0f1394a42bdbdd91f1df58095349cbb081 Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Tue, 30 Jun 2020 10:45:57 +0800 Subject: [PATCH] fc: add fcontext for init scripts and systemd service files @@ -14,7 +14,7 @@ Signed-off-by: Yi Zhao 4 files changed, 5 insertions(+) diff --git a/policy/modules/services/cron.fc b/policy/modules/services/cron.fc -index 8c9a749bc..f5a52b406 100644 +index 5508e00ba..57f53089d 100644 --- a/policy/modules/services/cron.fc +++ b/policy/modules/services/cron.fc @@ -1,4 +1,5 @@ @@ -24,7 +24,7 @@ index 8c9a749bc..f5a52b406 100644 /etc/cron\.d(/.*)? gen_context(system_u:object_r:system_cron_spool_t,s0) /etc/crontab -- gen_context(system_u:object_r:system_cron_spool_t,s0) diff --git a/policy/modules/services/rngd.fc b/policy/modules/services/rngd.fc -index 367592c8d..6b5a5f11e 100644 +index 626025247..3db1da377 100644 --- a/policy/modules/services/rngd.fc +++ b/policy/modules/services/rngd.fc @@ -1,4 +1,5 @@ @@ -59,6 +59,3 @@ index 0b6698d63..e2a43f305 100644 /usr/lib/systemd/systemd-journald -- gen_context(system_u:object_r:syslogd_exec_t,s0) /usr/lib/systemd/systemd-kmsg-syslogd -- gen_context(system_u:object_r:syslogd_exec_t,s0) --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0026-file_contexts.subs_dist-set-aliase-for-root-director.patch b/recipes-security/refpolicy/refpolicy/0026-file_contexts.subs_dist-set-aliase-for-root-director.patch index 6f6b2fc..85722dc 100644 --- a/recipes-security/refpolicy/refpolicy/0026-file_contexts.subs_dist-set-aliase-for-root-director.patch +++ b/recipes-security/refpolicy/refpolicy/0026-file_contexts.subs_dist-set-aliase-for-root-director.patch @@ -1,4 +1,4 @@ -From 25b8af93a5684abf449afed1414ca6e38184e0ae Mon Sep 17 00:00:00 2001 +From 710ca608ba3e2be53ec52ae15f4747f9f0226f1f Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Sun, 5 Apr 2020 22:03:45 +0800 Subject: [PATCH] file_contexts.subs_dist: set aliase for /root directory @@ -28,6 +28,3 @@ index bae4ef439..fb966318b 100644 # systemd system extension (systemd-sysext) staging dirs merge onto /usr and /opt, # and systemd configuration extension (systemd-confext) staging dirs merge onto /etc. # The staged trees are overlaid onto the host tree with overlayfs, so they must carry - --- -2.43.0 diff --git a/recipes-security/refpolicy/refpolicy/0027-policy-modules-system-logging-add-rules-for-the-syml.patch b/recipes-security/refpolicy/refpolicy/0027-policy-modules-system-logging-add-rules-for-the-syml.patch index c2972f8..4837ee1 100644 --- a/recipes-security/refpolicy/refpolicy/0027-policy-modules-system-logging-add-rules-for-the-syml.patch +++ b/recipes-security/refpolicy/refpolicy/0027-policy-modules-system-logging-add-rules-for-the-syml.patch @@ -1,4 +1,4 @@ -From 318c45578888ef3d697f095869100dce81247c0d Mon Sep 17 00:00:00 2001 +From 4bb33be4fbc4dfdaf3270ef73930ac735f4ded5e Mon Sep 17 00:00:00 2001 From: Xin Ouyang Date: Thu, 22 Aug 2013 13:37:23 +0800 Subject: [PATCH] policy/modules/system/logging: add rules for the symlink of @@ -30,7 +30,7 @@ index e2a43f305..7bedcdc00 100644 /var/log/dmesg -- gen_context(system_u:object_r:var_log_t,s0) /var/log/syslog -- gen_context(system_u:object_r:var_log_t,s0) diff --git a/policy/modules/system/logging.if b/policy/modules/system/logging.if -index 3dd2c06c2..7d108709f 100644 +index 718106ce9..d5e4d2bd4 100644 --- a/policy/modules/system/logging.if +++ b/policy/modules/system/logging.if @@ -1091,10 +1091,12 @@ interface(`logging_append_all_inherited_logs',` @@ -86,6 +86,3 @@ index 3dd2c06c2..7d108709f 100644 ') ######################################## --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0028-policy-modules-system-logging-add-rules-for-syslogd-.patch b/recipes-security/refpolicy/refpolicy/0028-policy-modules-system-logging-add-rules-for-syslogd-.patch index 167f2c0..b5d1451 100644 --- a/recipes-security/refpolicy/refpolicy/0028-policy-modules-system-logging-add-rules-for-syslogd-.patch +++ b/recipes-security/refpolicy/refpolicy/0028-policy-modules-system-logging-add-rules-for-syslogd-.patch @@ -1,4 +1,4 @@ -From 88aa13b30249ebcaada8075508efa603a041915b Mon Sep 17 00:00:00 2001 +From 546ad846bca275db44e46853b54188a1cfb66626 Mon Sep 17 00:00:00 2001 From: Joe MacDonald Date: Fri, 29 Mar 2019 10:33:18 -0400 Subject: [PATCH] policy/modules/system/logging: add rules for syslogd symlink @@ -18,7 +18,7 @@ Signed-off-by: Yi Zhao 1 file changed, 1 insertion(+) diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te -index 314b2559b..5d1930a58 100644 +index 3cae9b02d..338e9821a 100644 --- a/policy/modules/system/logging.te +++ b/policy/modules/system/logging.te @@ -429,6 +429,7 @@ files_search_spool(syslogd_t) @@ -29,6 +29,3 @@ index 314b2559b..5d1930a58 100644 # for systemd but can not be conditional files_runtime_filetrans(syslogd_t, syslogd_tmp_t, dir, "log") --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0029-policy-modules-kernel-files-add-rules-for-the-symlin.patch b/recipes-security/refpolicy/refpolicy/0029-policy-modules-kernel-files-add-rules-for-the-symlin.patch index 367852f..d5c0ecf 100644 --- a/recipes-security/refpolicy/refpolicy/0029-policy-modules-kernel-files-add-rules-for-the-symlin.patch +++ b/recipes-security/refpolicy/refpolicy/0029-policy-modules-kernel-files-add-rules-for-the-symlin.patch @@ -1,4 +1,4 @@ -From 97db230c2b1ddf0a9b725e4bee879fc5c13c86a5 Mon Sep 17 00:00:00 2001 +From 6b81457c237ddd074136515bfa1409812a3351f4 Mon Sep 17 00:00:00 2001 From: Xin Ouyang Date: Thu, 22 Aug 2013 13:37:23 +0800 Subject: [PATCH] policy/modules/kernel/files: add rules for the symlink of @@ -97,6 +97,3 @@ index 0b2e449b9..79ea2171f 100644 ') ######################################## --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0030-policy-modules-system-logging-fix-auditd-startup-fai.patch b/recipes-security/refpolicy/refpolicy/0030-policy-modules-system-logging-fix-auditd-startup-fai.patch index da1bd03..369172e 100644 --- a/recipes-security/refpolicy/refpolicy/0030-policy-modules-system-logging-fix-auditd-startup-fai.patch +++ b/recipes-security/refpolicy/refpolicy/0030-policy-modules-system-logging-fix-auditd-startup-fai.patch @@ -1,4 +1,4 @@ -From 41e8dbe65aa55bb892f4e794ce822cdc2cd22339 Mon Sep 17 00:00:00 2001 +From 57bd59c5148aba28987d30ca101d30b516e9f185 Mon Sep 17 00:00:00 2001 From: Xin Ouyang Date: Thu, 22 Aug 2013 13:37:23 +0800 Subject: [PATCH] policy/modules/system/logging: fix auditd startup failures @@ -17,7 +17,7 @@ Signed-off-by: Yi Zhao 1 file changed, 3 insertions(+) diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te -index 5d1930a58..90797d54f 100644 +index 338e9821a..f451c0dec 100644 --- a/policy/modules/system/logging.te +++ b/policy/modules/system/logging.te @@ -120,6 +120,7 @@ allow auditctl_t auditd_log_t:file read_file_perms; @@ -44,6 +44,3 @@ index 5d1930a58..90797d54f 100644 allow audisp_remote_t var_log_t:dir search_dir_perms; manage_dirs_pattern(audisp_remote_t, audit_spool_t, audit_spool_t) --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0031-policy-modules-kernel-terminal-don-t-audit-tty_devic.patch b/recipes-security/refpolicy/refpolicy/0031-policy-modules-kernel-terminal-don-t-audit-tty_devic.patch index 436b5f8..2a17048 100644 --- a/recipes-security/refpolicy/refpolicy/0031-policy-modules-kernel-terminal-don-t-audit-tty_devic.patch +++ b/recipes-security/refpolicy/refpolicy/0031-policy-modules-kernel-terminal-don-t-audit-tty_devic.patch @@ -1,4 +1,4 @@ -From dd08a7cc9679cda711ed3537102458d56224ef5d Mon Sep 17 00:00:00 2001 +From 1cc1a4f02fc829a3b569eeeb191139bbbc1cc67b Mon Sep 17 00:00:00 2001 From: Xin Ouyang Date: Thu, 22 Aug 2013 13:37:23 +0800 Subject: [PATCH] policy/modules/kernel/terminal: don't audit tty_device_t in @@ -33,6 +33,3 @@ index 48310450b..fffebdb0c 100644 ') ######################################## --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0032-policy-modules-system-systemd-enable-support-for-sys.patch b/recipes-security/refpolicy/refpolicy/0032-policy-modules-system-systemd-enable-support-for-sys.patch index 241ac31..50931cb 100644 --- a/recipes-security/refpolicy/refpolicy/0032-policy-modules-system-systemd-enable-support-for-sys.patch +++ b/recipes-security/refpolicy/refpolicy/0032-policy-modules-system-systemd-enable-support-for-sys.patch @@ -1,4 +1,4 @@ -From a9b04a012c6968668ae761818deb2254b0789a53 Mon Sep 17 00:00:00 2001 +From fb629b9f53a5c64911777c94fb3db9a4af4e90d4 Mon Sep 17 00:00:00 2001 From: Wenzong Fan Date: Thu, 4 Feb 2016 06:03:19 -0500 Subject: [PATCH] policy/modules/system/systemd: enable support for @@ -29,7 +29,7 @@ Signed-off-by: Yi Zhao 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te -index e773deab1..df23d7c62 100644 +index aaf7b7baa..76f9dfec5 100644 --- a/policy/modules/system/systemd.te +++ b/policy/modules/system/systemd.te @@ -10,7 +10,7 @@ policy_module(systemd) @@ -41,6 +41,3 @@ index e773deab1..df23d7c62 100644 ## ##

--- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0033-policy-modules-system-systemd-systemd-user-fixes.patch b/recipes-security/refpolicy/refpolicy/0033-policy-modules-system-systemd-systemd-user-fixes.patch index 30f0f91..3fc83fa 100644 --- a/recipes-security/refpolicy/refpolicy/0033-policy-modules-system-systemd-systemd-user-fixes.patch +++ b/recipes-security/refpolicy/refpolicy/0033-policy-modules-system-systemd-systemd-user-fixes.patch @@ -1,4 +1,4 @@ -From 38eae959958cbf3c1a17a22e853d1765786638a4 Mon Sep 17 00:00:00 2001 +From 96b8fffea94f14a290e6c871ea3e28783f865d50 Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Thu, 4 Feb 2021 10:48:54 +0800 Subject: [PATCH] policy/modules/system/systemd: systemd --user fixes @@ -31,10 +31,10 @@ Signed-off-by: Yi Zhao 2 files changed, 35 insertions(+) diff --git a/policy/modules/system/systemd.if b/policy/modules/system/systemd.if -index 378a4ca3d..f22b8ea82 100644 +index e399a81ab..278f89e15 100644 --- a/policy/modules/system/systemd.if +++ b/policy/modules/system/systemd.if -@@ -268,6 +268,37 @@ template(`systemd_role_template',` +@@ -282,6 +282,37 @@ template(`systemd_role_template',` ') ') @@ -73,10 +73,10 @@ index 378a4ca3d..f22b8ea82 100644 ##

## Allow the specified domain to be started as a daemon by the diff --git a/policy/modules/system/userdomain.if b/policy/modules/system/userdomain.if -index 6a1009d26..9c32410a5 100644 +index 9f09650f5..e967bcaff 100644 --- a/policy/modules/system/userdomain.if +++ b/policy/modules/system/userdomain.if -@@ -1489,6 +1489,10 @@ template(`userdom_admin_user_template',` +@@ -1533,6 +1533,10 @@ template(`userdom_admin_user_template',` optional_policy(` userhelper_exec($1_t) ') @@ -87,6 +87,3 @@ index 6a1009d26..9c32410a5 100644 ') ######################################## --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0034-policy-modules-system-logging-grant-getpcap-capabili.patch b/recipes-security/refpolicy/refpolicy/0034-policy-modules-system-logging-grant-getpcap-capabili.patch index 60a76b3..05b7599 100644 --- a/recipes-security/refpolicy/refpolicy/0034-policy-modules-system-logging-grant-getpcap-capabili.patch +++ b/recipes-security/refpolicy/refpolicy/0034-policy-modules-system-logging-grant-getpcap-capabili.patch @@ -1,4 +1,4 @@ -From 73445954288e54a76a1eaeaf0cbe43c3b56d3eaa Mon Sep 17 00:00:00 2001 +From 1abf865b6d17ba31ef426dea804197f0eecbb04d Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Tue, 28 May 2024 11:21:48 +0800 Subject: [PATCH] policy/modules/system/logging: grant getpcap capability to @@ -21,7 +21,7 @@ Signed-off-by: Yi Zhao 1 file changed, 2 insertions(+) diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te -index 90797d54f..cf4fdb2fe 100644 +index f451c0dec..7693581cd 100644 --- a/policy/modules/system/logging.te +++ b/policy/modules/system/logging.te @@ -402,6 +402,8 @@ optional_policy(` @@ -33,6 +33,3 @@ index 90797d54f..cf4fdb2fe 100644 dontaudit syslogd_t self:capability { sys_ptrace net_admin }; dontaudit syslogd_t self:cap_userns { kill sys_ptrace }; # setpgid for metalog --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0035-policy-modules-system-allow-services-to-read-tmpfs-u.patch b/recipes-security/refpolicy/refpolicy/0035-policy-modules-system-allow-services-to-read-tmpfs-u.patch index 961a337..ac3444a 100644 --- a/recipes-security/refpolicy/refpolicy/0035-policy-modules-system-allow-services-to-read-tmpfs-u.patch +++ b/recipes-security/refpolicy/refpolicy/0035-policy-modules-system-allow-services-to-read-tmpfs-u.patch @@ -1,4 +1,4 @@ -From c73aa825771f481be83b6a31e85fa8a885965671 Mon Sep 17 00:00:00 2001 +From 98ebadda5476bf2df073c393c21bc9ac416d9845 Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Fri, 30 Aug 2024 12:39:48 +0800 Subject: [PATCH] policy/modules/system: allow services to read tmpfs under @@ -67,7 +67,7 @@ index a900226bf..75b94785b 100644 mcs_process_set_categories(getty_t) diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te -index cf4fdb2fe..9200dcbdb 100644 +index 7693581cd..fdc880a43 100644 --- a/policy/modules/system/logging.te +++ b/policy/modules/system/logging.te @@ -491,6 +491,7 @@ files_read_kernel_symbol_table(syslogd_t) @@ -79,10 +79,10 @@ index cf4fdb2fe..9200dcbdb 100644 mls_file_write_all_levels(syslogd_t) # Need to be able to write to /var/run/ and /var/log directories diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te -index df23d7c62..b34125656 100644 +index 76f9dfec5..36c818c89 100644 --- a/policy/modules/system/systemd.te +++ b/policy/modules/system/systemd.te -@@ -1478,6 +1478,7 @@ files_watch_root_dirs(systemd_networkd_t) +@@ -1492,6 +1492,7 @@ files_watch_root_dirs(systemd_networkd_t) files_list_runtime(systemd_networkd_t) fs_getattr_all_fs(systemd_networkd_t) @@ -91,10 +91,10 @@ index df23d7c62..b34125656 100644 fs_read_nsfs_files(systemd_networkd_t) fs_watch_memory_pressure(systemd_networkd_t) diff --git a/policy/modules/system/udev.te b/policy/modules/system/udev.te -index e245a66a4..5cc9484eb 100644 +index f62745d83..2374c147d 100644 --- a/policy/modules/system/udev.te +++ b/policy/modules/system/udev.te -@@ -144,6 +144,7 @@ files_dontaudit_getattr_tmp_dirs(udev_t) +@@ -150,6 +150,7 @@ files_dontaudit_getattr_tmp_dirs(udev_t) fs_getattr_all_fs(udev_t) fs_list_inotifyfs(udev_t) @@ -102,6 +102,3 @@ index e245a66a4..5cc9484eb 100644 fs_read_cgroup_files(udev_t) fs_rw_anon_inodefs_files(udev_t) fs_list_tmpfs(udev_t) --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0036-policy-modules-kernel-domain-allow-all-domains-to-co.patch b/recipes-security/refpolicy/refpolicy/0036-policy-modules-kernel-domain-allow-all-domains-to-co.patch index ce7dd82..1943a2e 100644 --- a/recipes-security/refpolicy/refpolicy/0036-policy-modules-kernel-domain-allow-all-domains-to-co.patch +++ b/recipes-security/refpolicy/refpolicy/0036-policy-modules-kernel-domain-allow-all-domains-to-co.patch @@ -1,4 +1,4 @@ -From 905963229d0456b9e38917f6c2fba8bb57a3e705 Mon Sep 17 00:00:00 2001 +From 2e5a52120c8d750255e225db69f00a59e8a5550f Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Thu, 3 Oct 2024 21:12:33 +0800 Subject: [PATCH] policy/modules/kernel/domain: allow all domains to connect to @@ -23,10 +23,10 @@ Signed-off-by: Yi Zhao 1 file changed, 1 insertion(+) diff --git a/policy/modules/kernel/domain.te b/policy/modules/kernel/domain.te -index 7c7fe8f32..241084c4b 100644 +index 20ce796b7..d84be4dab 100644 --- a/policy/modules/kernel/domain.te +++ b/policy/modules/kernel/domain.te -@@ -134,6 +134,7 @@ files_list_root(domain) +@@ -135,6 +135,7 @@ files_list_root(domain) ifdef(`init_systemd',` optional_policy(` shutdown_sigchld(domain) @@ -34,6 +34,3 @@ index 7c7fe8f32..241084c4b 100644 ') ') --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0037-systemd-allow-systemd-logind-to-inherit-fds.patch b/recipes-security/refpolicy/refpolicy/0037-systemd-allow-systemd-logind-to-inherit-fds.patch index 45a419f..6fe5fd9 100644 --- a/recipes-security/refpolicy/refpolicy/0037-systemd-allow-systemd-logind-to-inherit-fds.patch +++ b/recipes-security/refpolicy/refpolicy/0037-systemd-allow-systemd-logind-to-inherit-fds.patch @@ -1,4 +1,4 @@ -From e25f4ac72ae24ac301a334bf9bad4c2992664ee3 Mon Sep 17 00:00:00 2001 +From 43b89d6969a85004629962e4f5d21bae64707230 Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Tue, 18 Feb 2025 09:54:06 +0800 Subject: [PATCH] systemd: allow systemd-logind to inherit fds @@ -20,7 +20,7 @@ Signed-off-by: Yi Zhao 2 files changed, 22 insertions(+) diff --git a/policy/modules/admin/su.if b/policy/modules/admin/su.if -index 4566b522b..b6c7ca0a5 100644 +index 8f16790e0..ce7754102 100644 --- a/policy/modules/admin/su.if +++ b/policy/modules/admin/su.if @@ -232,6 +232,10 @@ template(`su_role_template',` @@ -35,10 +35,10 @@ index 4566b522b..b6c7ca0a5 100644 allow $3 $1_su_t:process signal; diff --git a/policy/modules/system/systemd.if b/policy/modules/system/systemd.if -index f22b8ea82..cc2709551 100644 +index 278f89e15..1f0e4cdb7 100644 --- a/policy/modules/system/systemd.if +++ b/policy/modules/system/systemd.if -@@ -1582,6 +1582,24 @@ interface(`systemd_use_logind_fds',` +@@ -1660,6 +1660,24 @@ interface(`systemd_use_logind_fds',` allow $1 systemd_logind_t:fd use; ') @@ -63,6 +63,3 @@ index f22b8ea82..cc2709551 100644 ###################################### ## ## Watch logind sessions dirs. --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0038-systemd-allow-systemd-tmpfiles-to-read-bin_t-symlink.patch b/recipes-security/refpolicy/refpolicy/0038-systemd-allow-systemd-tmpfiles-to-read-bin_t-symlink.patch index b36cc5c..3e45e9b 100644 --- a/recipes-security/refpolicy/refpolicy/0038-systemd-allow-systemd-tmpfiles-to-read-bin_t-symlink.patch +++ b/recipes-security/refpolicy/refpolicy/0038-systemd-allow-systemd-tmpfiles-to-read-bin_t-symlink.patch @@ -1,4 +1,4 @@ -From 634dc2988ce5eaff7d1cd27cd5c9eeb32183e637 Mon Sep 17 00:00:00 2001 +From d8fc6cb3eb08eafa403e056ad6fd8efb33f1ee6a Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Tue, 18 Feb 2025 15:26:19 +0800 Subject: [PATCH] systemd: allow systemd-tmpfiles to read bin_t symlink @@ -23,10 +23,10 @@ Signed-off-by: Yi Zhao 4 files changed, 23 insertions(+) diff --git a/policy/modules/kernel/corecommands.fc b/policy/modules/kernel/corecommands.fc -index 851529abd..1480e1104 100644 +index 110e7471d..abb1c63db 100644 --- a/policy/modules/kernel/corecommands.fc +++ b/policy/modules/kernel/corecommands.fc -@@ -251,6 +251,7 @@ ifdef(`distro_gentoo',` +@@ -256,6 +256,7 @@ ifdef(`distro_gentoo',` /usr/lib/sftp-server -- gen_context(system_u:object_r:bin_t,s0) /usr/lib/ssh(/.*)? gen_context(system_u:object_r:bin_t,s0) /usr/lib/sudo/sesh -- gen_context(system_u:object_r:shell_exec_t,s0) @@ -61,10 +61,10 @@ index 08ed91f19..0fa4cbf7d 100644 + read_lnk_files_pattern($1, bin_t, bin_t) +') diff --git a/policy/modules/system/systemd.if b/policy/modules/system/systemd.if -index cc2709551..b67b78a69 100644 +index 1f0e4cdb7..3231f5c82 100644 --- a/policy/modules/system/systemd.if +++ b/policy/modules/system/systemd.if -@@ -156,6 +156,7 @@ template(`systemd_role_template',` +@@ -160,6 +160,7 @@ template(`systemd_role_template',` # user systemd-tmpfiles rules allow $1_systemd_tmpfiles_t self:process setfscreate; @@ -73,10 +73,10 @@ index cc2709551..b67b78a69 100644 domtrans_pattern($1_systemd_t, systemd_tmpfiles_exec_t, $1_systemd_tmpfiles_t) read_files_pattern($1_systemd_t, $1_systemd_tmpfiles_t, $1_systemd_tmpfiles_t) diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te -index b34125656..c1c873fa5 100644 +index 36c818c89..4fc898752 100644 --- a/policy/modules/system/systemd.te +++ b/policy/modules/system/systemd.te -@@ -2169,6 +2169,9 @@ kernel_getattr_proc(systemd_tmpfiles_t) +@@ -2193,6 +2193,9 @@ kernel_getattr_proc(systemd_tmpfiles_t) kernel_read_kernel_sysctls(systemd_tmpfiles_t) kernel_read_network_state(systemd_tmpfiles_t) @@ -86,6 +86,3 @@ index b34125656..c1c873fa5 100644 dev_getattr_fs(systemd_tmpfiles_t) dev_manage_all_dev_nodes(systemd_tmpfiles_t) dev_read_urand(systemd_tmpfiles_t) --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0039-systemd-fix-for-systemd-networkd-and-systemd-rfkill.patch b/recipes-security/refpolicy/refpolicy/0039-systemd-fix-for-systemd-networkd-and-systemd-rfkill.patch index 57b4296..1bd7d7e 100644 --- a/recipes-security/refpolicy/refpolicy/0039-systemd-fix-for-systemd-networkd-and-systemd-rfkill.patch +++ b/recipes-security/refpolicy/refpolicy/0039-systemd-fix-for-systemd-networkd-and-systemd-rfkill.patch @@ -1,4 +1,4 @@ -From eeb5333253ad0fd19cf065b79c76012d88acfd61 Mon Sep 17 00:00:00 2001 +From c798867cd66fb9994f7e5888e470d976ea3a3c45 Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Fri, 26 Sep 2025 15:15:44 +0800 Subject: [PATCH] systemd: fix for systemd-networkd and systemd-rfkill @@ -35,10 +35,10 @@ Signed-off-by: Yi Zhao 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te -index c1c873fa5..4a790c5dc 100644 +index 4fc898752..f31862c1b 100644 --- a/policy/modules/system/systemd.te +++ b/policy/modules/system/systemd.te -@@ -1427,7 +1427,7 @@ systemd_log_parse_environment(systemd_modules_load_t) +@@ -1441,7 +1441,7 @@ systemd_log_parse_environment(systemd_modules_load_t) # networkd local policy # @@ -47,7 +47,7 @@ index c1c873fa5..4a790c5dc 100644 allow systemd_networkd_t self:netlink_generic_socket create_socket_perms; allow systemd_networkd_t self:netlink_kobject_uevent_socket create_socket_perms; allow systemd_networkd_t self:netlink_netfilter_socket create_socket_perms; -@@ -1470,12 +1470,15 @@ corenet_udp_bind_generic_node(systemd_networkd_t) +@@ -1484,12 +1484,15 @@ corenet_udp_bind_generic_node(systemd_networkd_t) dev_read_urand(systemd_networkd_t) dev_read_sysfs(systemd_networkd_t) dev_write_kmsg(systemd_networkd_t) @@ -63,7 +63,7 @@ index c1c873fa5..4a790c5dc 100644 fs_getattr_all_fs(systemd_networkd_t) fs_list_tmpfs(systemd_networkd_t) -@@ -1914,6 +1917,7 @@ logging_send_syslog_msg(systemd_pstore_t) +@@ -1930,6 +1933,7 @@ logging_send_syslog_msg(systemd_pstore_t) # Rfkill local policy # @@ -71,6 +71,3 @@ index c1c873fa5..4a790c5dc 100644 allow systemd_rfkill_t self:netlink_kobject_uevent_socket create_socket_perms; manage_dirs_pattern(systemd_rfkill_t, systemd_rfkill_var_lib_t, systemd_rfkill_var_lib_t) --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0040-systemd-allow-domain-used-for-login-program-to-conne.patch b/recipes-security/refpolicy/refpolicy/0040-systemd-allow-domain-used-for-login-program-to-conne.patch index 46d3046..e4f0c08 100644 --- a/recipes-security/refpolicy/refpolicy/0040-systemd-allow-domain-used-for-login-program-to-conne.patch +++ b/recipes-security/refpolicy/refpolicy/0040-systemd-allow-domain-used-for-login-program-to-conne.patch @@ -1,7 +1,8 @@ -From f94cd726509a88f8efd72b175fe3079544e9ef26 Mon Sep 17 00:00:00 2001 +From 03f2558a168c4ff3fa879774d7cb416bcc991225 Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Fri, 6 Feb 2026 22:13:03 +0800 Subject: [PATCH] systemd: allow domain used for login program to connect to + systemd-logind over unix socket Fix the following AVC denials: @@ -25,10 +26,10 @@ Signed-off-by: Yi Zhao 3 files changed, 22 insertions(+) diff --git a/policy/modules/system/authlogin.if b/policy/modules/system/authlogin.if -index 82d3f6684..db1fcc344 100644 +index 5add629ac..6518f230e 100644 --- a/policy/modules/system/authlogin.if +++ b/policy/modules/system/authlogin.if -@@ -230,6 +230,7 @@ interface(`auth_login_pgm_domain',` +@@ -233,6 +233,7 @@ interface(`auth_login_pgm_domain',` systemd_read_logind_state($1) systemd_write_inherited_logind_sessions_pipes($1) systemd_use_passwd_agent_fds($1) @@ -37,7 +38,7 @@ index 82d3f6684..db1fcc344 100644 ') diff --git a/policy/modules/system/systemd.fc b/policy/modules/system/systemd.fc -index 505a054ff..e44d82a88 100644 +index dacf27a49..6622a1c74 100644 --- a/policy/modules/system/systemd.fc +++ b/policy/modules/system/systemd.fc @@ -127,6 +127,7 @@ HOME_ROOT/.+\.home -- gen_context(system_u:object_r:systemd_homed_storage_t,s0) @@ -46,13 +47,13 @@ index 505a054ff..e44d82a88 100644 /run/systemd/io\.systemd\.NamespaceResource -s gen_context(system_u:object_r:systemd_nsresourced_runtime_t,s0) +/run/systemd/io\.systemd\.Login -s gen_context(system_u:object_r:systemd_logind_runtime_t,s0) - /run/tmpfiles\.d -d gen_context(system_u:object_r:systemd_tmpfiles_conf_t,s0) - /run/tmpfiles\.d/.* <> + /run/sysctl\.d(/.*)? gen_context(system_u:object_r:systemd_sysctl_runtime_t,s0) + diff --git a/policy/modules/system/systemd.if b/policy/modules/system/systemd.if -index b67b78a69..cc57a29f4 100644 +index 3231f5c82..777376536 100644 --- a/policy/modules/system/systemd.if +++ b/policy/modules/system/systemd.if -@@ -1601,6 +1601,26 @@ interface(`systemd_inherit_logind_fds',` +@@ -1679,6 +1679,26 @@ interface(`systemd_inherit_logind_fds',` allow systemd_logind_t $1:fd use; ') @@ -79,6 +80,3 @@ index b67b78a69..cc57a29f4 100644 ###################################### ## ## Watch logind sessions dirs. --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0041-systemd-add-rules-for-systemd-ssh-issue.patch b/recipes-security/refpolicy/refpolicy/0041-systemd-add-rules-for-systemd-ssh-issue.patch index 875896b..d3941c2 100644 --- a/recipes-security/refpolicy/refpolicy/0041-systemd-add-rules-for-systemd-ssh-issue.patch +++ b/recipes-security/refpolicy/refpolicy/0041-systemd-add-rules-for-systemd-ssh-issue.patch @@ -1,4 +1,4 @@ -From 37f557b73474ed2f746c8bb6c2cd5c5d7de3a7d5 Mon Sep 17 00:00:00 2001 +From 53f8aaaaf41eb79be05b1dd18c1dff48f5b77a38 Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Mon, 9 Feb 2026 15:42:19 +0800 Subject: [PATCH] systemd: add rules for systemd-ssh-issue @@ -49,7 +49,7 @@ index 75b94785b..48a29461a 100644 # Gentoo default /etc/issue makes agetty # do a DNS lookup for the hostname diff --git a/policy/modules/system/systemd.fc b/policy/modules/system/systemd.fc -index e44d82a88..130c62370 100644 +index 6622a1c74..bfaa1c4c9 100644 --- a/policy/modules/system/systemd.fc +++ b/policy/modules/system/systemd.fc @@ -49,6 +49,7 @@ @@ -70,10 +70,10 @@ index e44d82a88..130c62370 100644 /run/nologin -- gen_context(system_u:object_r:systemd_sessions_runtime_t,s0) diff --git a/policy/modules/system/systemd.if b/policy/modules/system/systemd.if -index cc57a29f4..3a513a17e 100644 +index 777376536..34e8cdc57 100644 --- a/policy/modules/system/systemd.if +++ b/policy/modules/system/systemd.if -@@ -3212,3 +3212,22 @@ interface(`systemd_use_inherited_machined_ptys', ` +@@ -3310,3 +3310,22 @@ interface(`systemd_use_inherited_machined_ptys', ` allow $1 systemd_machined_t:fd use; allow $1 systemd_machined_devpts_t:chr_file rw_inherited_term_perms; ') @@ -97,7 +97,7 @@ index cc57a29f4..3a513a17e 100644 + read_files_pattern($1, systemd_ssh_issue_runtime_t, systemd_ssh_issue_runtime_t) +') diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te -index 4a790c5dc..c7dc5570c 100644 +index f31862c1b..3b3be2be6 100644 --- a/policy/modules/system/systemd.te +++ b/policy/modules/system/systemd.te @@ -309,6 +309,14 @@ corenet_port(systemd_socket_proxyd_port_t) @@ -115,7 +115,7 @@ index 4a790c5dc..c7dc5570c 100644 type systemd_sysctl_t; type systemd_sysctl_exec_t; init_daemon_domain(systemd_sysctl_t, systemd_sysctl_exec_t) -@@ -2090,6 +2098,33 @@ fs_getattr_nsfs_files(systemd_sysctl_t) +@@ -2114,6 +2122,33 @@ miscfiles_read_localization(systemd_sysctl_t) systemd_log_parse_environment(systemd_sysctl_t) @@ -149,6 +149,3 @@ index 4a790c5dc..c7dc5570c 100644 ######################################### # # Sysusers local policy --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0042-policy-modules-system-mount-make-mount_t-domain-MLS-.patch b/recipes-security/refpolicy/refpolicy/0042-policy-modules-system-mount-make-mount_t-domain-MLS-.patch index a659716..28634e8 100644 --- a/recipes-security/refpolicy/refpolicy/0042-policy-modules-system-mount-make-mount_t-domain-MLS-.patch +++ b/recipes-security/refpolicy/refpolicy/0042-policy-modules-system-mount-make-mount_t-domain-MLS-.patch @@ -1,4 +1,4 @@ -From 4f1a73b96f69d58c077396f7579eba99992a1c15 Mon Sep 17 00:00:00 2001 +From e101b81c3cee551ed287e76072e4b8c0dec0c86d Mon Sep 17 00:00:00 2001 From: Wenzong Fan Date: Sat, 15 Feb 2014 04:22:47 -0500 Subject: [PATCH] policy/modules/system/mount: make mount_t domain MLS trusted @@ -30,6 +30,3 @@ index 687c532e1..319ddd2bb 100644 selinux_get_enforce_mode(mount_t) --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0043-policy-modules-roles-sysadm-MLS-sysadm-rw-to-clearan.patch b/recipes-security/refpolicy/refpolicy/0043-policy-modules-roles-sysadm-MLS-sysadm-rw-to-clearan.patch index c2c2352..d60df92 100644 --- a/recipes-security/refpolicy/refpolicy/0043-policy-modules-roles-sysadm-MLS-sysadm-rw-to-clearan.patch +++ b/recipes-security/refpolicy/refpolicy/0043-policy-modules-roles-sysadm-MLS-sysadm-rw-to-clearan.patch @@ -1,4 +1,4 @@ -From 296b3dfb91f6d0c8943541c12e0c07a41d39f73c Mon Sep 17 00:00:00 2001 +From bc45c909d968444213865ac03863c9dd0d264471 Mon Sep 17 00:00:00 2001 From: Xin Ouyang Date: Mon, 28 Jan 2019 14:05:18 +0800 Subject: [PATCH] policy/modules/roles/sysadm: MLS - sysadm rw to clearance @@ -23,7 +23,7 @@ Signed-off-by: Yi Zhao 1 file changed, 2 insertions(+) diff --git a/policy/modules/roles/sysadm.te b/policy/modules/roles/sysadm.te -index 3a8242568..d783d4582 100644 +index d93e88b26..edb01ddae 100644 --- a/policy/modules/roles/sysadm.te +++ b/policy/modules/roles/sysadm.te @@ -57,6 +57,8 @@ logging_watch_all_logs(sysadm_t) @@ -35,6 +35,3 @@ index 3a8242568..d783d4582 100644 selinux_read_policy(sysadm_t) --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0044-policy-modules-services-rpc-make-nfsd_t-domain-MLS-t.patch b/recipes-security/refpolicy/refpolicy/0044-policy-modules-services-rpc-make-nfsd_t-domain-MLS-t.patch index 806499d..5e72249 100644 --- a/recipes-security/refpolicy/refpolicy/0044-policy-modules-services-rpc-make-nfsd_t-domain-MLS-t.patch +++ b/recipes-security/refpolicy/refpolicy/0044-policy-modules-services-rpc-make-nfsd_t-domain-MLS-t.patch @@ -1,4 +1,4 @@ -From d017af66a1eded70679188844c227ce239b0d794 Mon Sep 17 00:00:00 2001 +From 186f9fb2ac9aacc1e266e61390ddf66c8bd983f7 Mon Sep 17 00:00:00 2001 From: Xin Ouyang Date: Fri, 23 Aug 2013 12:01:53 +0800 Subject: [PATCH] policy/modules/services/rpc: make nfsd_t domain MLS trusted @@ -15,10 +15,10 @@ Signed-off-by: Yi Zhao 2 files changed, 7 insertions(+) diff --git a/policy/modules/kernel/kernel.te b/policy/modules/kernel/kernel.te -index cb82f6635..75aa94bc6 100644 +index f150103ad..31ea5b040 100644 --- a/policy/modules/kernel/kernel.te +++ b/policy/modules/kernel/kernel.te -@@ -392,6 +392,8 @@ mls_process_read_all_levels(kernel_t) +@@ -413,6 +413,8 @@ mls_process_read_all_levels(kernel_t) mls_process_write_all_levels(kernel_t) mls_file_write_all_levels(kernel_t) mls_file_read_all_levels(kernel_t) @@ -28,10 +28,10 @@ index cb82f6635..75aa94bc6 100644 ifdef(`distro_redhat',` # Bugzilla 222337 diff --git a/policy/modules/services/rpcbind.te b/policy/modules/services/rpcbind.te -index a0bedbe69..fdd93a469 100644 +index 3eb875743..24d159f01 100644 --- a/policy/modules/services/rpcbind.te +++ b/policy/modules/services/rpcbind.te -@@ -75,6 +75,11 @@ logging_send_syslog_msg(rpcbind_t) +@@ -78,6 +78,11 @@ logging_send_syslog_msg(rpcbind_t) miscfiles_read_localization(rpcbind_t) @@ -43,6 +43,3 @@ index a0bedbe69..fdd93a469 100644 ifdef(`distro_debian',` term_dontaudit_use_unallocated_ttys(rpcbind_t) ') --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0045-policy-modules-admin-dmesg-make-dmesg_t-MLS-trusted-.patch b/recipes-security/refpolicy/refpolicy/0045-policy-modules-admin-dmesg-make-dmesg_t-MLS-trusted-.patch index dadd446..c7049b8 100644 --- a/recipes-security/refpolicy/refpolicy/0045-policy-modules-admin-dmesg-make-dmesg_t-MLS-trusted-.patch +++ b/recipes-security/refpolicy/refpolicy/0045-policy-modules-admin-dmesg-make-dmesg_t-MLS-trusted-.patch @@ -1,4 +1,4 @@ -From 836b210ce616aed73769bff2c8b2a5904de900fe Mon Sep 17 00:00:00 2001 +From 419559f02ce386c974888bec5ac46ddb686b5604 Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Tue, 30 Jun 2020 10:18:20 +0800 Subject: [PATCH] policy/modules/admin/dmesg: make dmesg_t MLS trusted reading @@ -31,6 +31,3 @@ index 2b98b0e7f..9432cc78a 100644 optional_policy(` seutil_sigchld_newrole(dmesg_t) ') --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0046-policy-modules-kernel-kernel-make-kernel_t-MLS-trust.patch b/recipes-security/refpolicy/refpolicy/0046-policy-modules-kernel-kernel-make-kernel_t-MLS-trust.patch index 0c7490e..4ec74b8 100644 --- a/recipes-security/refpolicy/refpolicy/0046-policy-modules-kernel-kernel-make-kernel_t-MLS-trust.patch +++ b/recipes-security/refpolicy/refpolicy/0046-policy-modules-kernel-kernel-make-kernel_t-MLS-trust.patch @@ -1,4 +1,4 @@ -From 51446ea7377a19f2353c03cf0ad98261f8348c45 Mon Sep 17 00:00:00 2001 +From 23f3640ca8598453d32945b420aa0040964de965 Mon Sep 17 00:00:00 2001 From: Wenzong Fan Date: Fri, 13 Oct 2017 07:20:40 +0000 Subject: [PATCH] policy/modules/kernel/kernel: make kernel_t MLS trusted for @@ -59,10 +59,10 @@ Signed-off-by: Yi Zhao 1 file changed, 2 insertions(+) diff --git a/policy/modules/kernel/kernel.te b/policy/modules/kernel/kernel.te -index 75aa94bc6..329103506 100644 +index 31ea5b040..7afea5a10 100644 --- a/policy/modules/kernel/kernel.te +++ b/policy/modules/kernel/kernel.te -@@ -394,6 +394,8 @@ mls_file_write_all_levels(kernel_t) +@@ -415,6 +415,8 @@ mls_file_write_all_levels(kernel_t) mls_file_read_all_levels(kernel_t) mls_socket_write_all_levels(kernel_t) mls_fd_use_all_levels(kernel_t) @@ -71,6 +71,3 @@ index 75aa94bc6..329103506 100644 ifdef(`distro_redhat',` # Bugzilla 222337 --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0047-policy-modules-system-init-make-init_t-MLS-trusted-f.patch b/recipes-security/refpolicy/refpolicy/0047-policy-modules-system-init-make-init_t-MLS-trusted-f.patch index 3b71066..5b565ea 100644 --- a/recipes-security/refpolicy/refpolicy/0047-policy-modules-system-init-make-init_t-MLS-trusted-f.patch +++ b/recipes-security/refpolicy/refpolicy/0047-policy-modules-system-init-make-init_t-MLS-trusted-f.patch @@ -1,4 +1,4 @@ -From b2e14817293ee3b353e5a333e84c8e7aa82ab280 Mon Sep 17 00:00:00 2001 +From 786f4c752369f2683badc81c9c9d8f59027cac83 Mon Sep 17 00:00:00 2001 From: Wenzong Fan Date: Fri, 15 Jan 2016 03:47:05 -0500 Subject: [PATCH] policy/modules/system/init: make init_t MLS trusted for @@ -27,10 +27,10 @@ Signed-off-by: Yi Zhao 1 file changed, 4 insertions(+) diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te -index 388c9b28c..25b74378a 100644 +index 94df50d40..a71699800 100644 --- a/policy/modules/system/init.te +++ b/policy/modules/system/init.te -@@ -256,6 +256,10 @@ mls_process_write_all_levels(init_t) +@@ -260,6 +260,10 @@ mls_process_write_all_levels(init_t) mls_fd_use_all_levels(init_t) mls_process_set_level(init_t) @@ -41,6 +41,3 @@ index 388c9b28c..25b74378a 100644 # the following one is needed for libselinux:is_selinux_enabled() # otherwise the call fails and sysvinit tries to load the policy # again when using the initramfs --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0048-policy-modules-system-systemd-make-systemd-tmpfiles_.patch b/recipes-security/refpolicy/refpolicy/0048-policy-modules-system-systemd-make-systemd-tmpfiles_.patch index 57cc208..ae5de93 100644 --- a/recipes-security/refpolicy/refpolicy/0048-policy-modules-system-systemd-make-systemd-tmpfiles_.patch +++ b/recipes-security/refpolicy/refpolicy/0048-policy-modules-system-systemd-make-systemd-tmpfiles_.patch @@ -1,4 +1,4 @@ -From 4de0cdb34e58244bf7594c567c170c8923f4b907 Mon Sep 17 00:00:00 2001 +From ed2ff14cdabaed88df624bff746a937f7f9671d0 Mon Sep 17 00:00:00 2001 From: Wenzong Fan Date: Thu, 4 Feb 2016 06:03:19 -0500 Subject: [PATCH] policy/modules/system/systemd: make systemd-tmpfiles_t domain @@ -43,10 +43,10 @@ Signed-off-by: Yi Zhao 1 file changed, 5 insertions(+) diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te -index c7dc5570c..7ead872e9 100644 +index 3b3be2be6..ba0e1bed7 100644 --- a/policy/modules/system/systemd.te +++ b/policy/modules/system/systemd.te -@@ -2313,6 +2313,11 @@ sysnet_relabel_config(systemd_tmpfiles_t) +@@ -2338,6 +2338,11 @@ sysnet_relabel_config(systemd_tmpfiles_t) systemd_log_parse_environment(systemd_tmpfiles_t) @@ -58,6 +58,3 @@ index c7dc5570c..7ead872e9 100644 userdom_manage_user_runtime_root_dirs(systemd_tmpfiles_t) userdom_relabel_user_runtime_root_dirs(systemd_tmpfiles_t) --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0049-policy-modules-system-systemd-systemd-make-systemd_-.patch b/recipes-security/refpolicy/refpolicy/0049-policy-modules-system-systemd-systemd-make-systemd_-.patch index 2cb9fc5..f8259d9 100644 --- a/recipes-security/refpolicy/refpolicy/0049-policy-modules-system-systemd-systemd-make-systemd_-.patch +++ b/recipes-security/refpolicy/refpolicy/0049-policy-modules-system-systemd-systemd-make-systemd_-.patch @@ -1,4 +1,4 @@ -From 1ee01571a182d70db76fce86ddd447de4dfd3c32 Mon Sep 17 00:00:00 2001 +From 50ae17a013d4516737750d1d444cee997020d0e1 Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Thu, 18 Jun 2020 09:59:58 +0800 Subject: [PATCH] policy/modules/system/systemd: systemd-*: make systemd_*_t @@ -43,10 +43,10 @@ Signed-off-by: Yi Zhao 1 file changed, 12 insertions(+) diff --git a/policy/modules/system/systemd.te b/policy/modules/system/systemd.te -index 7ead872e9..26f06e482 100644 +index ba0e1bed7..0c599b1cd 100644 --- a/policy/modules/system/systemd.te +++ b/policy/modules/system/systemd.te -@@ -476,6 +476,9 @@ optional_policy(` +@@ -479,6 +479,9 @@ optional_policy(` unconfined_dbus_send(systemd_backlight_t) ') @@ -56,7 +56,7 @@ index 7ead872e9..26f06e482 100644 ####################################### # # Binfmt local policy -@@ -690,6 +693,9 @@ udev_read_runtime_files(systemd_generator_t) +@@ -698,6 +701,9 @@ udev_read_runtime_files(systemd_generator_t) # for systemd-getty-generator userdom_use_user_ttys(systemd_generator_t) @@ -66,7 +66,7 @@ index 7ead872e9..26f06e482 100644 ifdef(`distro_gentoo',` corecmd_shell_entry_type(systemd_generator_t) ') -@@ -1212,6 +1218,9 @@ userdom_relabelto_user_runtime_dirs(systemd_logind_t) +@@ -1220,6 +1226,9 @@ userdom_relabelto_user_runtime_dirs(systemd_logind_t) userdom_setattr_user_ttys(systemd_logind_t) userdom_use_user_terminals(systemd_logind_t) @@ -76,7 +76,7 @@ index 7ead872e9..26f06e482 100644 # Needed to work around patch not yet merged into the systemd-logind supported on RHEL 7.x # The change in systemd by Nicolas Iooss on 02-Feb-2016 with hash 4b51966cf6c06250036e428608da92f8640beb96 # should fix the problem where user directories in /run/user/$UID/ are not getting the proper context -@@ -1949,6 +1958,9 @@ udev_read_runtime_files(systemd_rfkill_t) +@@ -1965,6 +1974,9 @@ udev_read_runtime_files(systemd_rfkill_t) systemd_log_parse_environment(systemd_rfkill_t) @@ -86,6 +86,3 @@ index 7ead872e9..26f06e482 100644 ######################################### # # Resolved local policy --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0050-policy-modules-system-logging-add-the-syslogd_t-to-t.patch b/recipes-security/refpolicy/refpolicy/0050-policy-modules-system-logging-add-the-syslogd_t-to-t.patch index 8027c14..e9cb230 100644 --- a/recipes-security/refpolicy/refpolicy/0050-policy-modules-system-logging-add-the-syslogd_t-to-t.patch +++ b/recipes-security/refpolicy/refpolicy/0050-policy-modules-system-logging-add-the-syslogd_t-to-t.patch @@ -1,4 +1,4 @@ -From 48ce274e3d696199ea98d8b2e389e3824cf08071 Mon Sep 17 00:00:00 2001 +From 05ab3fd791005bfac6f466158f1d08ef1334038f Mon Sep 17 00:00:00 2001 From: Xin Ouyang Date: Thu, 22 Aug 2013 13:37:23 +0800 Subject: [PATCH] policy/modules/system/logging: add the syslogd_t to trusted @@ -18,7 +18,7 @@ Signed-off-by: Yi Zhao 1 file changed, 3 insertions(+) diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te -index 9200dcbdb..255b831f8 100644 +index fdc880a43..c0b71c4ba 100644 --- a/policy/modules/system/logging.te +++ b/policy/modules/system/logging.te @@ -495,6 +495,9 @@ fs_list_tmpfs(syslogd_t) @@ -31,6 +31,3 @@ index 9200dcbdb..255b831f8 100644 term_write_console(syslogd_t) # Allow syslog to a terminal --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0051-policy-modules-system-init-make-init_t-MLS-trusted-f.patch b/recipes-security/refpolicy/refpolicy/0051-policy-modules-system-init-make-init_t-MLS-trusted-f.patch index daef8c7..9d1506e 100644 --- a/recipes-security/refpolicy/refpolicy/0051-policy-modules-system-init-make-init_t-MLS-trusted-f.patch +++ b/recipes-security/refpolicy/refpolicy/0051-policy-modules-system-init-make-init_t-MLS-trusted-f.patch @@ -1,4 +1,4 @@ -From da5692ab6d8641e047575ea65273ed5113c87ce2 Mon Sep 17 00:00:00 2001 +From 633b99f1a0e3c81c10b31478662520e09eb39399 Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Tue, 28 May 2019 16:41:37 +0800 Subject: [PATCH] policy/modules/system/init: make init_t MLS trusted for @@ -17,10 +17,10 @@ Signed-off-by: Yi Zhao 1 file changed, 1 insertion(+) diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te -index 25b74378a..242ceb78c 100644 +index a71699800..84651d57d 100644 --- a/policy/modules/system/init.te +++ b/policy/modules/system/init.te -@@ -255,6 +255,7 @@ mls_file_write_all_levels(init_t) +@@ -259,6 +259,7 @@ mls_file_write_all_levels(init_t) mls_process_write_all_levels(init_t) mls_fd_use_all_levels(init_t) mls_process_set_level(init_t) @@ -28,6 +28,3 @@ index 25b74378a..242ceb78c 100644 # MLS trusted for lowering/raising the level of files mls_file_downgrade(init_t) --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0052-policy-modules-system-init-all-init_t-to-read-any-le.patch b/recipes-security/refpolicy/refpolicy/0052-policy-modules-system-init-all-init_t-to-read-any-le.patch index 161c584..b3f25b3 100644 --- a/recipes-security/refpolicy/refpolicy/0052-policy-modules-system-init-all-init_t-to-read-any-le.patch +++ b/recipes-security/refpolicy/refpolicy/0052-policy-modules-system-init-all-init_t-to-read-any-le.patch @@ -1,4 +1,4 @@ -From 1609f49b78df89b699a26406e795e439dbc33ece Mon Sep 17 00:00:00 2001 +From 060bc09c8312c133863406e626c6513da1b7c85d Mon Sep 17 00:00:00 2001 From: Wenzong Fan Date: Wed, 3 Feb 2016 04:16:06 -0500 Subject: [PATCH] policy/modules/system/init: all init_t to read any level @@ -22,10 +22,10 @@ Signed-off-by: Yi Zhao 1 file changed, 3 insertions(+) diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te -index 242ceb78c..8188f8aec 100644 +index 84651d57d..309d277d0 100644 --- a/policy/modules/system/init.te +++ b/policy/modules/system/init.te -@@ -261,6 +261,9 @@ mls_key_write_all_levels(init_t) +@@ -265,6 +265,9 @@ mls_key_write_all_levels(init_t) mls_file_downgrade(init_t) mls_file_upgrade(init_t) @@ -35,6 +35,3 @@ index 242ceb78c..8188f8aec 100644 # the following one is needed for libselinux:is_selinux_enabled() # otherwise the call fails and sysvinit tries to load the policy # again when using the initramfs --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0053-policy-modules-system-logging-allow-auditd_t-to-writ.patch b/recipes-security/refpolicy/refpolicy/0053-policy-modules-system-logging-allow-auditd_t-to-writ.patch index 944d3ae..267b6c4 100644 --- a/recipes-security/refpolicy/refpolicy/0053-policy-modules-system-logging-allow-auditd_t-to-writ.patch +++ b/recipes-security/refpolicy/refpolicy/0053-policy-modules-system-logging-allow-auditd_t-to-writ.patch @@ -1,4 +1,4 @@ -From f36eaaf7a0da3f7aec39bac3a1953742a8364155 Mon Sep 17 00:00:00 2001 +From f8e022825bf01bfbfce96ad82fd9be134b8b1892 Mon Sep 17 00:00:00 2001 From: Wenzong Fan Date: Thu, 25 Feb 2016 04:25:08 -0500 Subject: [PATCH] policy/modules/system/logging: allow auditd_t to write socket @@ -22,7 +22,7 @@ Signed-off-by: Yi Zhao 1 file changed, 2 insertions(+) diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te -index 255b831f8..1ee634f76 100644 +index c0b71c4ba..98f97df99 100644 --- a/policy/modules/system/logging.te +++ b/policy/modules/system/logging.te @@ -236,6 +236,8 @@ miscfiles_read_localization(auditd_t) @@ -34,6 +34,3 @@ index 255b831f8..1ee634f76 100644 seutil_dontaudit_read_config(auditd_t) --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0054-policy-modules-kernel-kernel-make-kernel_t-MLS-trust.patch b/recipes-security/refpolicy/refpolicy/0054-policy-modules-kernel-kernel-make-kernel_t-MLS-trust.patch index deceb3d..df91abc 100644 --- a/recipes-security/refpolicy/refpolicy/0054-policy-modules-kernel-kernel-make-kernel_t-MLS-trust.patch +++ b/recipes-security/refpolicy/refpolicy/0054-policy-modules-kernel-kernel-make-kernel_t-MLS-trust.patch @@ -1,4 +1,4 @@ -From b09860b6c092539deb05b7d4f0eff1d7505ab289 Mon Sep 17 00:00:00 2001 +From b24c09364f5af2c39e2f7d517004ec92450f483f Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Thu, 31 Oct 2019 17:35:59 +0800 Subject: [PATCH] policy/modules/kernel/kernel: make kernel_t MLS trusted for @@ -15,10 +15,10 @@ Signed-off-by: Yi Zhao 1 file changed, 1 insertion(+) diff --git a/policy/modules/kernel/kernel.te b/policy/modules/kernel/kernel.te -index 329103506..287b0098f 100644 +index 7afea5a10..3756a0135 100644 --- a/policy/modules/kernel/kernel.te +++ b/policy/modules/kernel/kernel.te -@@ -396,6 +396,7 @@ mls_socket_write_all_levels(kernel_t) +@@ -417,6 +417,7 @@ mls_socket_write_all_levels(kernel_t) mls_fd_use_all_levels(kernel_t) # https://bugzilla.redhat.com/show_bug.cgi?id=667370 mls_file_downgrade(kernel_t) @@ -26,6 +26,3 @@ index 329103506..287b0098f 100644 ifdef(`distro_redhat',` # Bugzilla 222337 --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0055-policy-modules-system-setrans-allow-setrans_t-use-fd.patch b/recipes-security/refpolicy/refpolicy/0055-policy-modules-system-setrans-allow-setrans_t-use-fd.patch index 69025fd..619ffc5 100644 --- a/recipes-security/refpolicy/refpolicy/0055-policy-modules-system-setrans-allow-setrans_t-use-fd.patch +++ b/recipes-security/refpolicy/refpolicy/0055-policy-modules-system-setrans-allow-setrans_t-use-fd.patch @@ -1,4 +1,4 @@ -From 9ee2c564ec3b5e2663356ac78b9b8709d557f4cb Mon Sep 17 00:00:00 2001 +From 773a0783685f57c67edc970594cd80572ce619b3 Mon Sep 17 00:00:00 2001 From: Roy Li Date: Sat, 22 Feb 2014 13:35:38 +0800 Subject: [PATCH] policy/modules/system/setrans: allow setrans_t use fd at any @@ -25,6 +25,3 @@ index 0a87a8d70..738badc52 100644 selinux_compute_access_vector(setrans_t) --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0056-policy-modules-system-systemd-make-_systemd_t-MLS-tr.patch b/recipes-security/refpolicy/refpolicy/0056-policy-modules-system-systemd-make-_systemd_t-MLS-tr.patch index 9a3d5bf..73f26e6 100644 --- a/recipes-security/refpolicy/refpolicy/0056-policy-modules-system-systemd-make-_systemd_t-MLS-tr.patch +++ b/recipes-security/refpolicy/refpolicy/0056-policy-modules-system-systemd-make-_systemd_t-MLS-tr.patch @@ -1,4 +1,4 @@ -From 61869545d8823fbfcbed0bab49838cdb0a5b2a95 Mon Sep 17 00:00:00 2001 +From f73df947af7dd0663abb17acb0039299a54b4c88 Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Mon, 22 Feb 2021 11:28:12 +0800 Subject: [PATCH] policy/modules/system/systemd: make *_systemd_t MLS trusted @@ -24,10 +24,10 @@ Signed-off-by: Yi Zhao 1 file changed, 3 insertions(+) diff --git a/policy/modules/system/systemd.if b/policy/modules/system/systemd.if -index 3a513a17e..4e3ec2bb0 100644 +index 34e8cdc57..704b14970 100644 --- a/policy/modules/system/systemd.if +++ b/policy/modules/system/systemd.if -@@ -267,6 +267,9 @@ template(`systemd_role_template',` +@@ -281,6 +281,9 @@ template(`systemd_role_template',` xserver_read_xdm_state($1_systemd_t) xserver_use_user_fonts($1_systemd_t) ') @@ -37,6 +37,3 @@ index 3a513a17e..4e3ec2bb0 100644 ') ###################################### --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy/0057-policy-modules-system-logging-make-syslogd_runtime_t.patch b/recipes-security/refpolicy/refpolicy/0057-policy-modules-system-logging-make-syslogd_runtime_t.patch index 2953fa1..8533431 100644 --- a/recipes-security/refpolicy/refpolicy/0057-policy-modules-system-logging-make-syslogd_runtime_t.patch +++ b/recipes-security/refpolicy/refpolicy/0057-policy-modules-system-logging-make-syslogd_runtime_t.patch @@ -1,4 +1,4 @@ -From b507082584e70abfcf6446e38da92b848f6ae586 Mon Sep 17 00:00:00 2001 +From fa14ec9b06a71d62569d27d2a09bab99ac675179 Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Sat, 18 Dec 2021 17:31:45 +0800 Subject: [PATCH] policy/modules/system/logging: make syslogd_runtime_t MLS @@ -31,7 +31,7 @@ Signed-off-by: Yi Zhao 1 file changed, 2 insertions(+) diff --git a/policy/modules/system/logging.te b/policy/modules/system/logging.te -index 1ee634f76..75c97645a 100644 +index 98f97df99..c14d4d408 100644 --- a/policy/modules/system/logging.te +++ b/policy/modules/system/logging.te @@ -459,6 +459,8 @@ allow syslogd_t syslogd_runtime_t:file map; @@ -43,6 +43,3 @@ index 1ee634f76..75c97645a 100644 kernel_read_system_state(syslogd_t) kernel_read_network_state(syslogd_t) kernel_read_kernel_sysctls(syslogd_t) --- -2.34.1 - diff --git a/recipes-security/refpolicy/refpolicy_git.inc b/recipes-security/refpolicy/refpolicy_git.inc index 67a727b..31c08e7 100644 --- a/recipes-security/refpolicy/refpolicy_git.inc +++ b/recipes-security/refpolicy/refpolicy_git.inc @@ -2,7 +2,7 @@ PV = "2.20260922+git" SRC_URI = "git://github.com/SELinuxProject/refpolicy.git;protocol=https;branch=main;name=refpolicy;destsuffix=refpolicy" -SRCREV_refpolicy = "8f247dafb92bd12cbfb53a11ff58be17a88df86a" +SRCREV_refpolicy = "720c02a1bc565fe5a6e3bdb299385167f582eac0" UPSTREAM_CHECK_GITTAGREGEX = "RELEASE_(?P\d+_\d+)" From patchwork Mon Nov 16 02:56:16 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Qi X-Patchwork-Id: 104299 Received: from cetc.com.cn (cetc.com.cn [220.181.39.39]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.20043.1794797799803784406 for ; Sun, 15 Nov 2026 18:56:40 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: cetc.com.cn, ip: 220.181.39.39, mailfrom: chenqi_hycx@cetc.com.cn) Received: from mail.cetc.com.cn (unknown [123.125.172.206]) by mtasvr (Coremail) with SMTP id _____wDHoIVncPpqYdQAAA--.940S3; Mon, 16 Nov 2026 10:54:31 +0800 (CST) Received: from chenqi-Redmi.. (unknown [123.125.172.206]) by front01 (Coremail) with SMTP id C6CowABn+WnccPpqPNA3AA--.14039S4; Mon, 16 Nov 2026 10:56:36 +0800 (CST) From: chenqi_hycx@cetc.com.cn To: yocto-patches@lists.yoctoproject.org Cc: chen_q07@163.com Subject: [PATCH 2/6] refpolicy: fix shadow lock issue Date: Mon, 16 Nov 2026 10:56:16 +0800 Message-ID: <20261116025620.2558594-3-chenqi_hycx@cetc.com.cn> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261116025620.2558594-1-chenqi_hycx@cetc.com.cn> References: <20261116025620.2558594-1-chenqi_hycx@cetc.com.cn> MIME-Version: 1.0 X-CM-TRANSID: C6CowABn+WnccPpqPNA3AA--.14039S4 X-CM-SenderInfo: xfkh015lbk5un06fv33fof0zgofq/1tbiAgYNCmr5tRgFSgAEs2 X-CM-DELIVERINFO: =?B?qfkun6c9tbm9bwt5VqgwP2Pu2dSP9LtrOQxHOAXUJl/eWtrOBydmTZkAAV6p44o2Ir PoONahKFcN3sR551ZGDSnKFd8y00cREoaKfNfTdZyeBFUSTBZgGszeRPd1GuvOmS9NP70t JRZr3n1awOO/ccPDTkd5aRBlGnxz2xTFyYapbkYP3iOEj+zlCz2ogC+v30esAw== X-Coremail-Antispam: 1Uk129KBj93XoWxWryrGr4rXFW7ZF15Gw1ktFc_yoW5KFy7pr 4rAa4YkFWkXFn2qFsrCF4UZr15K3y8Gws8Z3yUWF4UCrW5AF1kua1rJryDWrWS9r17GrZF vrsIkFy5t3WUAwbCm3ZEXasCq-sJn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3gc02F40EFcxC0VAKzVAqx4xG6I80ewCY02Avz4vE14v_GrUv73VFW2AG mfu7bjvjm3AaLaJ3UjIYCTnIWjp_UUUYh7kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2 IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wAFIxvE14AKwVWUGVWUXwA2ocxC64kIII0Yj41l 84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7xvwVC0I7 IYx2IY6xkF7I0E14v26F4j6r4UJwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK 6I8E87Iv6xkF7I0E14v26r4UJVWxJr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2 xF0cIa020Ex4CE44I27wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_ Jrv_JF1lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x 0EwIxGrwAKzVCY07xG64k0F24lc2xSY4AK67AK6r4UMxAIw28IcxkI7VAKI48JMxC20s02 6xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_Jr I_JrWlx4CE17CEb7AF67AKxVWUXVWUAwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v2 6r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4v20xvaj4 0_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVWUJVW8 JbIYCTnIWIevJa73UjIFyTuYvjxU2xhLUUUUU List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Mon, 16 Nov 2026 02:56:51 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/5399 From: Chen Qi Add a local patch to fix shadow lock issue. Upstream issue and PR: https://github.com/SELinuxProject/refpolicy/issues/1274 https://github.com/SELinuxProject/refpolicy/pull/1280 Signed-off-by: Chen Qi --- ...allow-creating-the-shadow-lock-files.patch | 41 +++++++++++++++++++ .../refpolicy/refpolicy_common.inc | 1 + 2 files changed, 42 insertions(+) create mode 100644 recipes-security/refpolicy/refpolicy/0058-authlogin-allow-creating-the-shadow-lock-files.patch diff --git a/recipes-security/refpolicy/refpolicy/0058-authlogin-allow-creating-the-shadow-lock-files.patch b/recipes-security/refpolicy/refpolicy/0058-authlogin-allow-creating-the-shadow-lock-files.patch new file mode 100644 index 0000000..b9f3542 --- /dev/null +++ b/recipes-security/refpolicy/refpolicy/0058-authlogin-allow-creating-the-shadow-lock-files.patch @@ -0,0 +1,41 @@ +From 69277d9047ebf1aee9af59c97a27a0fcad2a47ee Mon Sep 17 00:00:00 2001 +From: Chen Qi +Date: Mon, 9 Nov 2026 15:46:47 +0800 +Subject: [PATCH] authlogin: allow creating the shadow lock files + +auth_rw_shadow_lock() declares the file transitions for .pwd.lock, +passwd.lock and group.lock but only grants rw_file_perms, which has no +create. A domain that finds no lock file therefore cannot create it: + + avc: denied { create } for name=".pwd.lock" + scontext=system_u:system_r:systemd_sysusers_t:s0 + tcontext=system_u:object_r:shadow_lock_t:s0 tclass=file + +The problem was revealed by systemd-sysusers with systemd 262. But any +command that manages user password is likely to fail, e.g., `passwd root'. + +Upstream-Status: Inappropriate [OE Specific] +[ + Note that this patch is marked as 'Inappropriate' because there's a PR + upstream tracking this issue: https://github.com/SELinuxProject/refpolicy/pull/1280 + When that PR is merged, we should drop this patch. +] + +Signed-off-by: Chen Qi +--- + policy/modules/system/authlogin.if | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/policy/modules/system/authlogin.if b/policy/modules/system/authlogin.if +index 6518f230e..91a46ed08 100644 +--- a/policy/modules/system/authlogin.if ++++ b/policy/modules/system/authlogin.if +@@ -878,7 +878,7 @@ interface(`auth_rw_shadow_lock',` + type shadow_lock_t; + ') + +- allow $1 shadow_lock_t:file rw_file_perms; ++ allow $1 shadow_lock_t:file { create rw_file_perms }; + files_etc_filetrans($1, shadow_lock_t, file, ".pwd.lock") + files_etc_filetrans($1, shadow_lock_t, file, "passwd.lock") + files_etc_filetrans($1, shadow_lock_t, file, "group.lock") diff --git a/recipes-security/refpolicy/refpolicy_common.inc b/recipes-security/refpolicy/refpolicy_common.inc index 4b5108a..4fa2ae5 100644 --- a/recipes-security/refpolicy/refpolicy_common.inc +++ b/recipes-security/refpolicy/refpolicy_common.inc @@ -73,6 +73,7 @@ SRC_URI += " \ file://0055-policy-modules-system-setrans-allow-setrans_t-use-fd.patch \ file://0056-policy-modules-system-systemd-make-_systemd_t-MLS-tr.patch \ file://0057-policy-modules-system-logging-make-syslogd_runtime_t.patch \ + file://0058-authlogin-allow-creating-the-shadow-lock-files.patch \ " S = "${UNPACKDIR}/refpolicy" From patchwork Mon Nov 16 02:56:17 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Qi X-Patchwork-Id: 104300 Received: from cetc.com.cn (cetc.com.cn [220.181.39.39]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.20044.1794797801023615592 for ; Sun, 15 Nov 2026 18:56:41 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: cetc.com.cn, ip: 220.181.39.39, mailfrom: chenqi_hycx@cetc.com.cn) Received: from mail.cetc.com.cn (unknown [123.125.172.206]) by mtasvr (Coremail) with SMTP id _____wBnb9NncPpqY9QAAA--.912S3; Mon, 16 Nov 2026 10:54:32 +0800 (CST) Received: from chenqi-Redmi.. (unknown [123.125.172.206]) by front01 (Coremail) with SMTP id C6CowABn+WnccPpqPNA3AA--.14039S5; Mon, 16 Nov 2026 10:56:37 +0800 (CST) From: chenqi_hycx@cetc.com.cn To: yocto-patches@lists.yoctoproject.org Cc: chen_q07@163.com Subject: [PATCH 3/6] refpolicy_common: ensure we start from a clean state in do_compile Date: Mon, 16 Nov 2026 10:56:17 +0800 Message-ID: <20261116025620.2558594-4-chenqi_hycx@cetc.com.cn> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261116025620.2558594-1-chenqi_hycx@cetc.com.cn> References: <20261116025620.2558594-1-chenqi_hycx@cetc.com.cn> MIME-Version: 1.0 X-CM-TRANSID: C6CowABn+WnccPpqPNA3AA--.14039S5 X-CM-SenderInfo: xfkh015lbk5un06fv33fof0zgofq/1tbiAQYNCmr5ttwQhQAAss X-CM-DELIVERINFO: =?B?78kLhqc9tbm9bwt5VqgwP2Pu2dSP9LtrOQxHOAXUJl/eWtrOBydmTZkAAV6p44o2Ir PoOBNkiu0Ezb1p2pGXeRzsQOOetiK1i/XRcVR42sQdltV/w6xTdwCCCiTY/98Br6F5tuw9 kPmBKQlayPIxSCwzWfd5aRBlGnxz2xTFyYapbkYPu0kie1A4wdQL24IB56wyjQ== X-Coremail-Antispam: 1Uk129KBj93XoW7KrWUZF48Gr1rXryfJF1fAFc_yoW8Gr4Dpw 4jva4YyF4DXF1xWrs7uF43uF17KasxWw40v3yUCw40v3s8XFyxuw48t3sxWFWfZ3y3Xr9r GwnIv3y3WayUA3cCm3ZEXasCq-sJn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3gc02F40EFcxC0VAKzVAqx4xG6I80ewCY02Avz4vE14v_GrUv73VFW2AG mfu7bjvjm3AaLaJ3UjIYCTnIWjp_UUUYh7kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2 IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wAFIxvE14AKwVWUGVWUXwA2ocxC64kIII0Yj41l 84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7xvwVC0I7 IYx2IY6xkF7I0E14v26F4j6r4UJwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK 6I8E87Iv6xkF7I0E14v26r4UJVWxJr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2 xF0cIa020Ex4CE44I27wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_ Jrv_JF1lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x 0EwIxGrwAKzVCY07xG64k0F24lc2xSY4AK67AK6r4UMxAIw28IcxkI7VAKI48JMxC20s02 6xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_Jr I_JrWlx4CE17CEb7AF67AKxVWUXVWUAwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v2 6r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4v20xvaj4 0_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVWUJVW8 JbIYCTnIWIevJa73UjIFyTuYvjxU2xhLUUUUU List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Mon, 16 Nov 2026 02:56:51 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/5402 From: Chen Qi The `bare` make target is to "delete all remaining generated files, including modules.conf, and booleans.conf."[1] If we don't do 'make bare' at the start of do_compile, legacy build artifacts such as booleans.conf, generated_definitions.conf, etc. will remain there, making the building results unexpected. For example, if we enable ssh_sysadm_login in legacy build directory, things just don't take effect because even if do_compile is re-run due to signature change, the generated_definitions.conf will not be updated. [1] https://github.com/SELinuxProject/refpolicy/blob/main/doc/BUILD_INSTALL.md#general-make-targets Signed-off-by: Chen Qi --- recipes-security/refpolicy/refpolicy_common.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes-security/refpolicy/refpolicy_common.inc b/recipes-security/refpolicy/refpolicy_common.inc index 4fa2ae5..e6dac8e 100644 --- a/recipes-security/refpolicy/refpolicy_common.inc +++ b/recipes-security/refpolicy/refpolicy_common.inc @@ -194,6 +194,7 @@ set_policy_booleans() { } do_compile() { + oe_runmake bare if [ -f "${WORKDIR}/modules.conf" ] ; then cp -f ${WORKDIR}/modules.conf ${S}/policy/modules.conf fi From patchwork Mon Nov 16 02:56:18 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Qi X-Patchwork-Id: 104297 Received: from cetc.com.cn (cetc.com.cn [220.181.39.39]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.20383.1794797800727885700 for ; Sun, 15 Nov 2026 18:56:41 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: cetc.com.cn, ip: 220.181.39.39, mailfrom: chenqi_hycx@cetc.com.cn) Received: from mail.cetc.com.cn (unknown [123.125.172.206]) by mtasvr (Coremail) with SMTP id _____wBXXKRpcPpqZ9QAAA--.983S3; Mon, 16 Nov 2026 10:54:33 +0800 (CST) Received: from chenqi-Redmi.. (unknown [123.125.172.206]) by front01 (Coremail) with SMTP id C6CowABn+WnccPpqPNA3AA--.14039S6; Mon, 16 Nov 2026 10:56:37 +0800 (CST) From: chenqi_hycx@cetc.com.cn To: yocto-patches@lists.yoctoproject.org Cc: chen_q07@163.com Subject: [PATCH 4/6] oeqa: decide the SELinux cases on the domain, not the policy name Date: Mon, 16 Nov 2026 10:56:18 +0800 Message-ID: <20261116025620.2558594-5-chenqi_hycx@cetc.com.cn> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261116025620.2558594-1-chenqi_hycx@cetc.com.cn> References: <20261116025620.2558594-1-chenqi_hycx@cetc.com.cn> MIME-Version: 1.0 X-CM-TRANSID: C6CowABn+WnccPpqPNA3AA--.14039S6 X-CM-SenderInfo: xfkh015lbk5un06fv33fof0zgofq/1tbiAgYNCmr5tRgQJwAAsK X-CM-DELIVERINFO: =?B?iEfg5ac9tbm9bwt5VqgwP2Pu2dSP9LtrOQxHOAXUJl/eWtrOBydmTZkAAV6p44o2Ir PoONahKFcN3sR551ZGDSnKFd+z9ZEHcoFr0Ks4/O1So4K7w6xTdwCCCiTY/98Br6F5tuGL UsKlFSDEFfYYBh1W0Xh5aRBlGnxz2xTFyYapbkYPjiCkXy4MjAfzC1aLS5q5iw== X-Coremail-Antispam: 1Uk129KBj9fXoWfAFWfZF4fCw48JryUXFW8GrX_yoW5CF13Zo Z3Gw40v3W8tr1fCr1DKan8GrZ5Xa45Zr1fArn8XrWrta9FqryUKayUJwnxAay3A3WIqwnI q3Z3Xr4xXFs3trn3l-sFpf9Il3svdjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8wcxFpf 9Il3svdxBIdaVrn5kqx4xG64xvF2IEw4CE5I8CrVC2j2Wlc2xSY4AK67AK6r4UYxn0WfAS r-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUUbxxYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI 8I6I8E6xAIw20EY4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJ M28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2I x0cI8IcVCY1x0267AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xv wVC2z280aVCY1x0267AKxVWxJr0_GcWle2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2 xF0cIa020Ex4CE44I27wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_ JF0_Jw1lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x 0EwIxGrwAKzVCY07xG64k0F24lc2xSY4AK67AK6r4UMxAIw28IcxkI7VAKI48JMxC20s02 6xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_Jr I_JrWlx4CE17CEb7AF67AKxVWUXVWUAwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE 2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcV C2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVWUJVW8JbIYCTnIWIevJa73 UjIFyTuYvjxU7UUUUUUUU List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Mon, 16 Nov 2026 02:56:41 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/5401 From: Chen Qi The denial and module cases skipped on refpolicy-targeted because they decided from the policy name that administrators are unconfined there, and assumed an ssh login as root is confined elsewhere. The installed policy decides, not its name: an ssh login as root is staff_t on refpolicy-standard, -mcs and -mls, and unconfined_t on -targeted and -minimum. Decide on the domain read from /proc/self/attr/current. Skip the shadow case on unconfined_t alone: sysadm_t and secadm_t may only getattr and relabel shadow_t, so they are denied the read just as staff_t is, and only unconfined_t is allowed it. Where the session has no confined domain, log in as a test account mapped to user_u so that pam_selinux puts it in user_t; su cannot stand in for that, as pam_selinux is not in its PAM stack. The denial is provoked by reading a world-readable file whose label the policy withholds. /etc/shadow does not work for that: it is 0400, so a confined non-root session is stopped by the file mode and no AVC record is written, and refpolicy dontaudits staff_t reading shadow_t. The cases verify the mode, the label and the denial instead of assuming them. Verified on qemux86-64 and qemuarm64 with refpolicy-targeted (14 passed, 1 skipped) and refpolicy-mcs (15 passed), checking the installed refpolicy package in the image manifest each time. Assisted-by: Codewhale:deepseek-v4-flash Signed-off-by: Chen Qi --- lib/oeqa/runtime/cases/selinux.py | 543 ++++++++++++++++++++++++------ 1 file changed, 431 insertions(+), 112 deletions(-) diff --git a/lib/oeqa/runtime/cases/selinux.py b/lib/oeqa/runtime/cases/selinux.py index af79b39..c238532 100644 --- a/lib/oeqa/runtime/cases/selinux.py +++ b/lib/oeqa/runtime/cases/selinux.py @@ -15,21 +15,50 @@ # packagegroup-core-selinux (as core-image-selinux does) satisfies the package, # feature and kernel requirements of all of them. # -# The cases that inspect or change system state need an administrative domain -# (sysadm_t, unconfined_t, secadm_t). With refpolicy-mcs an ssh login as root -# lands in staff_t, which cannot read the policy store, the audit log or the -# kernel ring buffer, so those cases run their commands through newrole: +# Two domains matter here, and the cases pick whichever one lets them observe +# what they assert: # -# newrole -r sysadm_r -t sysadm_t -- -c '' +# administrative Needed to inspect or change system state: the policy store, +# the audit log, the kernel ring buffer, setenforce. The +# cases use the session's own domain when it is one, and +# otherwise switch with newrole: # -# The '--' arguments are the arguments of the login shell newrole execs, hence -# the -c. This needs a root account PAM can authenticate without a prompt, -# i.e. IMAGE_FEATURES "empty-root-password"; without that the cases skip. +# newrole -r sysadm_r -t sysadm_t -- -c '' # -# The denial, module and AVC cases additionally need a policy that confines -# administrators (the mcs and mls variants). The targeted and minimum variants -# run admins as unconfined_t on purpose, so those cases skip there. - +# The '--' arguments are those of the login shell newrole +# execs, hence the -c. Switching needs a root account PAM can +# authenticate without a prompt, i.e. IMAGE_FEATURES +# "empty-root-password"; without that the cases skip. +# +# confined Needed to assert that an access is denied. A domain only +# counts as confined here if the policy also withholds the +# administrative accesses above; the two are the same thing in +# practice, since refpolicy grants both to the domains in +# ADMIN_DOMAINS and neither to a restricted user domain. +# +# Which domain the ssh session lands in depends on the policy variant, not on +# anything the session can choose: +# +# refpolicy-targeted, -minimum unconfined_t. Their recipes make +# unconfined_u the default SELinux user and +# give administrators unconfined_t on purpose, +# "the same access as if SELinux was not +# enabled". +# +# refpolicy-standard, -mcs, -mls staff_t. root's SELinux user lists staff_r +# first and pam_selinux picks the first role, +# so the login is confined even though the user +# is uid 0. newrole then reaches sysadm_t. +# +# The cases therefore never test for a policy name; they read the domain from +# /proc/self/attr/current and decide from that. A denial needs a confined +# domain, so on the unconfined variants the cases fall back to logging in as a +# test account mapped to the SELinux user user_u, which pam_selinux puts in +# user_t - the restricted-user domain that the policy does confine. Note that +# su cannot be used for this: pam_selinux is not in its PAM stack, so it leaves +# the caller's context alone and ssh is the only login here that relabels. + +import os.path import re import shlex import time @@ -40,18 +69,42 @@ from oeqa.core.decorator.data import skipIfNotFeature from oeqa.runtime.decorator.package import OEHasPackage -# Domains that may administer SELinux. With refpolicy-mcs an ssh login as -# root lands in staff_t, but newrole can assume sysadm_r from there, which is -# how the cases below reach an administrative domain on a stock image. +# Domains that may administer SELinux. refpolicy grants these the policy +# store, the audit log, the kernel ring buffer and setenforce, and it grants +# nobody else; a session in one of them is also allowed everything the denial +# cases try to observe, so it cannot serve as their confined side. +# +# Being an administrative domain does not mean being unconfined: staff_t is not +# one of these, and sysadm_t and secadm_t are confined for most objects. In +# particular none of the three may read shadow_t. ADMIN_DOMAINS = ('sysadm_t', 'unconfined_t', 'secadm_t') -# Policy variants in which refpolicy confines administrators. The targeted and -# minimum variants deliberately run administrators as unconfined_t, with the -# same access as if SELinux were disabled (see refpolicy-targeted_git.bb), so -# the checks below that rely on an access being denied only apply here. -CONFINING_POLICIES = ('mcs', 'mls') +# Domains the policy deliberately leaves unconfined, with the access the caller +# would have with SELinux disabled. refpolicy-targeted and -minimum make +# unconfined_u the default SELinux user for that reason, so a denial cannot be +# asserted against a session in this domain. +UNCONFINED_DOMAINS = ('unconfined_t',) -# Name of the policy module built by SELinuxModuleTest. +# Files the denial cases read, most likely first. Each has to be readable by +# every user, so that a refusal cannot be the discretionary permissions, and +# carry a label restricted users may not read. /var/log/messages is 0644 +# var_log_t, and refpolicy allows no restricted user domain to read var_log_t. +# +# A dontaudited denial is no good here: /etc/shadow would be the obvious choice +# for "root is denied this", but refpolicy has +# 'dontaudit staff_t shadow_t:file { getattr ioctl lock open read }', so that +# denial is deliberately kept out of the audit log and no AVC record can be +# observed for it. +PROBE_PATHS = ('/var/log/messages', '/var/log/syslog') + +# Account logged in as when the session itself is unconfined. Its SELinux user +# is a restricted one, so pam_selinux puts the session in user_t. +CONFINED_USER = 'oeqa_selinux' +CONFINED_SELINUX_USER = 'user_u' + +# Name of the policy module built by +# SELinuxToolTest.test_semodule_load_remove. checkmodule requires it to match +# the basename of the file it compiles. TEST_MODULE_NAME = 'oeqa-local' # Directory on the target used for scratch files and for the output files of @@ -62,19 +115,25 @@ TEST_MODULE_DIR = '/tmp/oeqa-selinux' # own arguments: 'newrole ... -- -c ', not 'newrole ... -- '. NEWROLE = 'newrole -r sysadm_r -t sysadm_t -- -c ' -# Source of the test module. It grants the administrative domain the access -# refpolicy withholds by default, so loading and removing the module can be -# observed with an existing file instead of needing a reboot or a relabel. +# ssh options that keep a loopback login quiet and non-interactive. +SSH_OPTIONS = ('-n -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ' + '-o LogLevel=ERROR') + +# Source of the test module. It grants the confined domain one access the +# policy withholds, so that loading and removing the module can be observed on +# an existing file instead of needing a reboot or a relabel. Both the domain +# and the label are taken from the target, so the module follows a relabelled +# image instead of hard-coding a type. TEST_MODULE_TE = """\ module %(module)s 1.0; require { type %(domain)s; - type shadow_t; + type %(type)s; class file { getattr open read }; } -allow %(domain)s shadow_t:file { getattr open read }; +allow %(domain)s %(type)s:file { getattr open read }; """ @@ -96,12 +155,26 @@ def parse_sestatus(output): return info +def context_type(context): + """Return the type component of an SELinux context, or ''.""" + # A login through pam_selinux may print warnings before the context it + # ends up in, so take the last line that looks like a context rather than + # the first one. + for line in reversed(context.replace('\x00', '').splitlines()): + parts = line.strip().split(':') + if len(parts) >= 3 and parts[2]: + return parts[2] + return '' + + class SELinuxTest(OERuntimeTestCase): """Helpers shared by the SELinux runtime cases.""" - # Cached result of probing whether newrole reaches an admin domain; None - # until the first test asks. Shared by all the cases. + # Cached results of the probes below; None until a test asks for them. + # Shared by all the cases, because each probe costs command round trips. _admin_domain = None + _confined_domain = None + _probe_path = None def run_cmd(self, command, timeout=None): status, output = self.target.run(command, timeout=timeout) @@ -128,16 +201,27 @@ class SELinuxTest(OERuntimeTestCase): def selinux_domain(self): """Return the type component of the session's SELinux context.""" - parts = self.process_context().split(':') - return parts[2] if len(parts) > 2 else '' + return context_type(self.process_context()) + + def is_admin_domain(self, domain): + """Return whether `domain' may administer SELinux.""" + return domain in ADMIN_DOMAINS + + def is_unconfined_domain(self, domain): + """Return whether the policy leaves `domain' unconfined on purpose.""" + return domain in UNCONFINED_DOMAINS + + # + # Running commands in an administrative domain. + # def require_admin(self): """ Return the domain administrative commands run in, or skip. The session itself may already be administrative; if it is not, the - commands are run through newrole, which needs the root password to be - empty so that PAM can authenticate without a prompt. + commands run through newrole, which needs the root password to be empty + so that PAM can authenticate without a prompt. """ domain = self.admin_domain() if not domain: @@ -151,12 +235,8 @@ class SELinuxTest(OERuntimeTestCase): return domain def admin_domain(self): - """ - Return the domain the administrative commands end up in, or ''. - - Probed once per class, because the probe costs a command round trip. - """ - if self.selinux_domain() in ADMIN_DOMAINS: + """Return the domain the administrative commands end up in, or ''.""" + if self.is_admin_domain(self.selinux_domain()): return self.selinux_domain() cls = type(self) @@ -164,9 +244,9 @@ class SELinuxTest(OERuntimeTestCase): status, output = self.run_admin('cat /proc/self/attr/current') domain = '' if status == 0: - parts = output.replace('\x00', '').strip().split(':') - if len(parts) > 2 and parts[2] in ADMIN_DOMAINS: - domain = parts[2] + candidate = context_type(output) + if self.is_admin_domain(candidate): + domain = candidate cls._admin_domain = domain self.logger.info('newrole gives domain %r' % domain) return cls._admin_domain @@ -189,7 +269,7 @@ class SELinuxTest(OERuntimeTestCase): def run_admin(self, command, timeout=None): """Run `command' in an administrative domain, return (status, output).""" - if self.selinux_domain() in ADMIN_DOMAINS: + if self.is_admin_domain(self.selinux_domain()): return self.run_cmd(command, timeout) self.run_cmd(self._newrole(command), timeout) @@ -213,42 +293,195 @@ class SELinuxTest(OERuntimeTestCase): return rc, body def run_admin_ok(self, command, timeout=None): - status, output = self.run_admin(command, timeout) + status, output = self.run_admin(command, timeout=timeout) self.assertEqual(status, 0, "Command '%s' failed in the admin domain with status " "%s:\n%s" % (command, status, output)) return output - def require_confining_policy(self): + # + # Running commands in a confined domain. + # + + def require_confined(self): + """Return a confined domain to assert a denial in, or skip.""" + domain = self.confined_domain() + if not domain: + self.skipTest('This test needs a confined non-administrative ' + 'SELinux domain, but the session runs as %r and no ' + 'confined login could be set up' + % (self.selinux_domain() + or self.process_context())) + return domain + + def confined_domain(self): + """Return the confined domain a denial can be asserted in, or ''.""" + if self.selinux_domain() and not self.is_admin_domain( + self.selinux_domain()): + # The session is already a restricted user domain, which is what an + # ssh login as root gives on the confining policy variants. + return self.selinux_domain() + + cls = type(self) + if cls._confined_domain is None: + cls._confined_domain = self.setup_confined_login() + self.logger.info('confined login gives domain %r' + % cls._confined_domain) + return cls._confined_domain + + def setup_confined_login(self): """ - Skip unless the loaded policy confines administrative domains. + Log in as a confined user, return its domain or ''. - The refpolicy-targeted and -minimum variants explicitly give admins - unconfined_t, so on those images an access such as reading /etc/shadow - is deliberately allowed and cannot be tested for denial. + Used on the variants that run administrators as unconfined_t, where the + session has no confined domain to offer. A login that goes through + pam_selinux is what relabels the session, and ssh is the only one of + those available on a minimal image, so the account is reached over + loopback ssh. """ - info = self.sestatus() - policy = info.get('Loaded policy name') - if policy not in CONFINING_POLICIES: - self.skipTest('Test expects a confining policy (%s), but %r is ' - 'loaded; targeted and minimum run administrators ' - 'unconfined on purpose' - % ('/'.join(CONFINING_POLICIES), policy)) + if not self.admin_domain(): + self.logger.info('no administrative domain, so a confined login ' + 'cannot be set up') + return '' + if self.run_cmd('pidof sshd')[0] != 0: + self.logger.info('sshd is not running, so a confined login cannot ' + 'be made') + return '' - def write_file(self, path, content): - self.run_ok('mkdir -p %s' % path.rsplit('/', 1)[0]) - self.run_ok("cat > %s << 'OEQA_EOF'\n%sOEQA_EOF" % (path, content)) + if self.run_cmd('id %s' % CONFINED_USER)[0] != 0: + status, output = self.run_cmd( + 'adduser -D -s /bin/sh %s' % CONFINED_USER) + if status != 0: + self.logger.info('cannot create %s:\n%s' + % (CONFINED_USER, output)) + return '' + + # pam_selinux labels the session, but only for an account PAM + # authenticates without asking. sshd then accepts the empty password + # because sshd_config sets PermitEmptyPasswords. + self.run_cmd('passwd -d %s' % CONFINED_USER) + + if self.run_admin('semanage login -a -s %s %s' + % (CONFINED_SELINUX_USER, CONFINED_USER))[0] != 0: + # -m updates the mapping a previous run left behind. + self.run_admin('semanage login -m -s %s %s' + % (CONFINED_SELINUX_USER, CONFINED_USER)) + + status, output = self.run_cmd('%s -l %s 127.0.0.1 -- id -Z' + % (self.ssh(), CONFINED_USER)) + if status != 0: + self.logger.info('cannot log in as %s:\n%s' + % (CONFINED_USER, output)) + return '' + domain = context_type(output) + if not domain or self.is_admin_domain(domain): + # Nothing was gained: the policy left this login unconfined too. + self.logger.info('%s logs in as %r, which is not confined' + % (CONFINED_USER, domain or '?')) + return '' + return domain - def shadow_read_denied(self): - """Return True when reading /etc/shadow is blocked by SELinux.""" - status, output = self.run_cmd('cat /etc/shadow') - return status != 0 and 'Permission denied' in output + def ssh(self): + """Return the ssh command line used for loopback logins.""" + return 'ssh %s' % SSH_OPTIONS + + def run_confined(self, command, timeout=None): + """Run `command' in the confined domain, return (status, output).""" + if self.confined_domain() == self.selinux_domain(): + return self.run_cmd(command, timeout) + return self.run_cmd('%s -l %s 127.0.0.1 -- %s' + % (self.ssh(), CONFINED_USER, shlex.quote(command)), + timeout) + + def probe_path(self): + """ + Return a world-readable file the confined domain may not read, or ''. + + Candidates are tried in turn and the first one that exists, is readable + by every user and whose label the policy withholds is used. Anything + else would make a case assert a policy denial while what it is looking + at is a permission check that SELinux never sees. + """ + cls = type(self) + if cls._probe_path is not None: + return cls._probe_path + + cls._probe_path = '' + domain = self.confined_domain() + if not domain: + return '' + + for path in PROBE_PATHS: + # The mode is a property of the file, so read it where the policy + # raises no obstacle; a confined domain may be denied even the + # stat, which would say nothing about the file's permissions. + status, output = self.run_admin('stat -c %%A %s' % path) + if status != 0: + continue + # '-rw-r--r--': index 7 is the read bit for everyone else. + mode = output.strip() + if len(mode) < 10 or mode[7] != 'r': + self.logger.info('%s is not world readable' % path) + continue + status, output = self.run_confined('cat %s' % path) + if status == 0: + self.logger.info('%r may read %s' % (domain, path)) + continue + if 'Permission denied' not in output: + self.logger.info('%r cannot read %s for another reason: %s' + % (domain, path, output.strip())) + continue + self.logger.info('%r is denied reading %s' % (domain, path)) + cls._probe_path = path + break + return cls._probe_path + + def probe_label(self): + """Return the type of the probe file's label, or ''.""" + status, output = self.run_admin('stat -c %%C %s' % self.probe_path()) + return context_type(output) if status == 0 else '' + + def probe_read(self): + """Read the probe file in the confined domain, return (status, output).""" + return self.run_confined('cat %s' % self.probe_path()) + + def require_probe_denial(self): + """ + Return the confined domain and the probe file's label type, or skip. + + Both are verified rather than assumed: the cases need the policy to + withhold the file, so that loading a module can be seen lifting that, + and the module needs the file's actual type. + """ + domain = self.require_confined() - def require_shadow_denial(self): - """Skip unless reading /etc/shadow is blocked, as this test needs it.""" - if not self.shadow_read_denied(): - self.skipTest('Reading /etc/shadow is allowed, so this test has ' - 'no denied access to work with') + path = self.probe_path() + if not path: + self.skipTest('None of %s is a world-readable file that the policy ' + 'denies %r, so there is no denial to observe' + % (', '.join(PROBE_PATHS), domain)) + + type_ = self.probe_label() + if not type_: + self.skipTest('Cannot read the SELinux label of %s' % path) + + status, output = self.probe_read() + self.assertNotEqual( + status, 0, + 'Reading %s as %s was allowed; the policy no longer denies it:\n%s' + % (path, domain, output)) + self.assertIn('Permission denied', output, + 'Reading %s as %s failed for a reason other than an ' + 'SELinux denial:\n%s' % (path, domain, output)) + return domain, type_ + + # + # Miscellaneous helpers. + # + + def write_file(self, path, content): + self.run_ok('mkdir -p %s' % os.path.dirname(path)) + self.run_ok("cat > %s << 'OEQA_EOF'\n%sOEQA_EOF" % (path, content)) def memtotal_mb(self): """Return the target's total RAM in MB, or None if it cannot tell.""" @@ -294,19 +527,47 @@ class SELinuxStatusTest(SELinuxTest): class SELinuxDenialTest(SELinuxTest): - """Access that the policy denies must be denied.""" + """A confined root must be denied files that only the policy withholds.""" @skipIfNotFeature('selinux', 'Test requires selinux in DISTRO_FEATURES') @OEHasPackage('policycoreutils-sestatus') @OETestDepends(['selinux.SELinuxStatusTest.test_kernel_enforcing']) def test_read_shadow_denied(self): - # /etc/shadow is readable by root alone, so a failure to read it cannot - # be a plain permission problem: it is the policy withholding - # shadow_t:file from the confined session domain. staff_t is confined - # just as sysadm_t is, so this runs for either. - self.require_confining_policy() - context = self.process_context() + # /etc/shadow is 0400 and owned by root, so a session that is uid 0 and + # still cannot read it was not stopped by the discretionary + # permissions: it is the policy withholding shadow_t:file. Both halves + # of that matter, and neither can be arranged on every variant: + # + # - It has to be the session itself, because a confined login as a + # non-root account would be refused by the file mode alone and the + # test would then pass without SELinux having decided anything. + # - The session has to be confined rather than unconfined, which an + # ssh login as root is on refpolicy-standard, -mcs and -mls + # (staff_t), but not on refpolicy-targeted and -minimum, where + # administrators run as unconfined_t by design and reading the file + # is allowed. Note that being an administrative domain is not the + # same test: staff_t is not one and is still confined, while + # sysadm_t and secadm_t are ones and are denied shadow_t as well. + # + # So this case skips on the variants whose policy has no confined + # administrator. The confidential data of a confined *user* is covered + # by test_avc_recorded, which does not need the session to be root. + domain = self.selinux_domain() + if not domain: + self.skipTest('Cannot determine the SELinux domain of the session') + if self.is_unconfined_domain(domain): + self.skipTest('The session runs as unconfined %r: this variant ' + 'gives administrators the access they would have ' + 'with SELinux disabled, so there is no denial to ' + 'assert' % domain) + + status, output = self.run_cmd('id -u') + self.assertEqual(output.strip(), '0', + 'The session is not root, so /etc/shadow is denied by ' + 'its file mode rather than by the policy; the denial ' + 'would prove nothing') + context = self.process_context() status, output = self.run_cmd('cat /etc/shadow') self.assertNotEqual( status, 0, @@ -428,11 +689,14 @@ class SELinuxToolTest(SELinuxTest): @OEHasPackage('policycoreutils-semodule') @OEHasPackage('checkpolicy') @OEHasPackage('semodule-utils-semodule-package') - @OETestDepends(['selinux.SELinuxToolTest.test_matchpathcon']) + @OETestDepends(['selinux.SELinuxStatusTest.test_kernel_enforcing']) def test_semodule_load_remove(self): - self.require_confining_policy() - domain = self.require_admin() - self.require_shadow_denial() + # The module grants the confined domain a read the policy withholds, so + # both loading and removing it are observable without a reboot. Which + # domain that is depends on the variant, but it only has to be a + # confined one, never the session's as such. + domain, type_ = self.require_probe_denial() + path = self.probe_path() # semodule re-expands the whole policy, which does not fit on a small # qemu guest: it gets OOM-killed rather than reporting an error. @@ -451,33 +715,32 @@ class SELinuxToolTest(SELinuxTest): checkmodule = 'checkmodule -m %s-o %s %s' % ('-M ' if mls else '', mod, te) self.write_file(te, TEST_MODULE_TE % {'module': TEST_MODULE_NAME, - 'domain': domain}) + 'domain': domain, + 'type': type_}) try: self.run_ok(checkmodule) self.run_ok('semodule_package -o %s -m %s' % (pp, mod)) - self.run_admin_ok('semodule -i %s' % pp) - self.assertIn(TEST_MODULE_NAME, self.run_admin_ok('semodule -l'), + self.run_admin_ok('semodule -i %s' % pp, timeout=300) + self.assertIn(TEST_MODULE_NAME, + self.run_admin_ok('semodule -l', timeout=120), 'Installed module is not listed by semodule -l') - # The new rule allows the domain to read /etc/shadow. - status, output = self.run_admin('cat /etc/shadow') + status, output = self.probe_read() self.assertEqual(status, 0, - 'Reading /etc/shadow is still denied after loading ' - '%s for %s:\n%s' - % (TEST_MODULE_NAME, domain, output)) + 'Reading %s is still denied after loading %s for ' + '%s:\n%s' % (path, TEST_MODULE_NAME, domain, output)) finally: - self.run_admin('semodule -r %s' % TEST_MODULE_NAME) + self.run_admin('semodule -r %s' % TEST_MODULE_NAME, timeout=300) - output = self.run_admin_ok('semodule -l') + output = self.run_admin_ok('semodule -l', timeout=120) self.assertNotIn(TEST_MODULE_NAME, output, 'Removed module is still listed by semodule -l:\n%s' % output) - status, output = self.run_admin('cat /etc/shadow') + status, output = self.probe_read() self.assertNotEqual(status, 0, - 'Reading /etc/shadow is still allowed after ' - 'removing %s:\n%s' - % (TEST_MODULE_NAME, output)) + 'Reading %s is still allowed after removing %s:\n%s' + % (path, TEST_MODULE_NAME, output)) class SELinuxAuditTest(SELinuxTest): @@ -530,30 +793,86 @@ class SELinuxAuditTest(SELinuxTest): @skipIfNotFeature('selinux', 'Test requires selinux in DISTRO_FEATURES') @OEHasPackage('auditd') - @OETestDepends(['selinux.SELinuxDenialTest.test_read_shadow_denied']) + @OETestDepends(['selinux.SELinuxAuditTest.test_auditctl_status']) def test_avc_recorded(self): - self.require_admin() + # The denial is provoked here rather than borrowed from another case, + # so that the record is written moments before it is looked for and + # comes from a confined domain on every variant that has one. + domain, _ = self.require_probe_denial() + path = self.probe_path() - # The denied read of /etc/shadow, asserted by the test this depends on, - # is the event whose record is looked for below. + source = self.avc_source() + before = self.avc_records(domain, source) - # AVC records reach the audit log when auditd is consuming them and - # the kernel ring buffer otherwise; accept either, but give auditd a - # moment to flush the record it just received. - deadline = time.time() + 15 + status, output = self.probe_read() + self.assertNotEqual(status, 0, + 'Reading %s as %s was allowed, so no AVC record ' + 'can be expected:\n%s' % (path, domain, output)) + + # Compare record sets rather than asking for records since a timestamp: + # the audit ids are unique, so the difference is exactly what this + # denial added, and a rolling '-ts recent' window cannot hide it. + record = '' + deadline = time.time() + 30 while True: - status, ausearch = self.run_admin('ausearch -m AVC -ts recent') - status, dmesg = self.run_admin('dmesg') - records = '%s\n%s' % (ausearch, dmesg) - if re.search(r'avc:\s+denied', records) and 'shadow' in records: - self.logger.info('AVC record found in the audit log:\n%s' - % ausearch.strip()) - return + # Give auditd a moment to flush the record before looking. + time.sleep(2) + fresh = self.avc_records(domain, source) - before + if fresh: + record = '\n'.join(sorted(fresh)) + self.logger.info('AVC record found in the %s:\n%s' + % (source, record)) + break if time.time() >= deadline: break - time.sleep(3) - self.fail('No AVC record for the denied read of /etc/shadow was found ' - 'in the audit log or the kernel ring buffer.\n' - 'ausearch:\n%s\ndmesg (tail):\n%s' - % (ausearch, '\n'.join(dmesg.splitlines()[-20:]))) + self.assertTrue( + record, + 'No AVC record for the denied read of %s as %s appeared in the ' + '%s after 30s.\nRecords for the domain already present:\n%s' + % (path, domain, source, + '\n'.join(sorted(self.avc_records(domain, source))[-10:]))) + + def avc_source(self): + """Return where the kernel's audit records can be read from.""" + # Ask in the admin domain: a confined session is not allowed to see + # whether auditd runs, and mistaking that for 'auditd is absent' sends + # the search to the ring buffer, which holds no record while auditd is + # consuming them. + if self.run_admin('pidof auditd')[0] == 0: + return 'audit log' + return 'kernel ring buffer' + + def audit_log(self): + """Return the file auditd writes to, as configured.""" + # auditd.conf is only readable in an administrative domain. + output = self.run_admin_ok( + "sed -n 's/^[[:space:]]*log_file[[:space:]]*=[[:space:]]*//p' " + '/etc/audit/auditd.conf') + return output.strip() or '/var/log/audit/audit.log' + + def avc_records(self, domain, source): + """Return the audit records the kernel wrote for `domain' as a set.""" + # Narrow the selection on the target, since the audit log holds + # thousands of records; repeat the filter in Python so that the match + # does not depend on how grep splits the fields. + marker = ':%s:' % domain + basename = os.path.basename(self.probe_path()) + if source == 'audit log': + # Name the log file: ausearch reads its input from stdin when stdin + # is /dev/null, which is what an ssh command gets, and then reports + # "no matches" while the log holds the records. + command = ('ausearch -if %s -m AVC 2>/dev/null | grep "avc:" ' + '| grep -F %s | grep -F %s || true' + % (shlex.quote(self.audit_log()), + shlex.quote(marker), shlex.quote(basename))) + else: + command = ('dmesg 2>/dev/null | grep "avc:" | grep -F %s ' + '| grep -F %s || true' + % (shlex.quote(marker), shlex.quote(basename))) + status, output = self.run_admin(command) + + # Match the source context and the file, so that a record left by an + # earlier run or written for another process cannot satisfy the check. + return {line for line in output.splitlines() + if 'avc:' in line and marker in line and basename in line} From patchwork Mon Nov 16 02:56:19 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Qi X-Patchwork-Id: 104301 Received: from cetc.com.cn (cetc.com.cn [220.181.39.39]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.20385.1794797803756046463 for ; Sun, 15 Nov 2026 18:56:44 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: cetc.com.cn, ip: 220.181.39.39, mailfrom: chenqi_hycx@cetc.com.cn) Received: from mail.cetc.com.cn (unknown [123.125.172.206]) by mtasvr (Coremail) with SMTP id _____wCHj9NscPpqa9QAAA--.933S3; Mon, 16 Nov 2026 10:54:36 +0800 (CST) Received: from chenqi-Redmi.. (unknown [123.125.172.206]) by front01 (Coremail) with SMTP id C6CowABn+WnccPpqPNA3AA--.14039S7; Mon, 16 Nov 2026 10:56:39 +0800 (CST) From: chenqi_hycx@cetc.com.cn To: yocto-patches@lists.yoctoproject.org Cc: chen_q07@163.com Subject: [PATCH 5/6] refpolicy_common: use ??= for POLICY_BOOLEANS Date: Mon, 16 Nov 2026 10:56:19 +0800 Message-ID: <20261116025620.2558594-6-chenqi_hycx@cetc.com.cn> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261116025620.2558594-1-chenqi_hycx@cetc.com.cn> References: <20261116025620.2558594-1-chenqi_hycx@cetc.com.cn> MIME-Version: 1.0 X-CM-TRANSID: C6CowABn+WnccPpqPNA3AA--.14039S7 X-CM-SenderInfo: xfkh015lbk5un06fv33fof0zgofq/1tbiAQYNCmr5ttwQhgAAsv X-CM-DELIVERINFO: =?B?BNCAPac9tbm9bwt5VqgwP2Pu2dSP9LtrOQxHOAXUJl/eWtrOBydmTZkAAV6p44o2Ir PoOBNkiu0Ezb1p2pGXeRzsQOMxYjOueDKtUdoWQlRhwX8fb0nd4pHWhteIJrZHQV4seFPO cY/ShaWwYz/MzElIRuN5aRBlGnxz2xTFyYapbkYP9Cckka7bXSkdtk1axUgKHA== X-Coremail-Antispam: 1Uk129KBj9xXoW7Jw4xJr45urW8JrWkKrW8KrX_yoWDZFb_Kr 9Fv347Awn0yF4rGa1SyFyfJ3Wqv340kr4agr10ka4aq3s0ya1fKr4jq3WrCrW3JF15t3W7 tFyagFy0kr17XosvyTuYvTs0mTUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUj1kv1TuYvT s0mT0YCTnIWjgY5I8CrVACY4xI64kE6c02F40Ex7xfMxkIecxEwVAFwVW8JbIjqfuFe4nv WSU5nxnvy29KBjDU0xBIdaVrnRJUUUvYb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20V C2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2 F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xIIjx v20xvEc7CjxVAFwI0_Cr0_Gr1UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vE x4A2jsIEc7CjxVAFwI0_Cr1j6rxdM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12 xvs2x26I8E6xACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r12 6r1DMcIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64 vIr41lw4CEc2x0rVAKj4xxMxkIecxEwVAFwVW8JwCF04k20xvY0x0EwIxGrwCFx2IqxVCF s4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r 1rMI8E67AF67kF1VAFwI0_Jrv_JF1lIxAIcVC0I7IYx2IY67AKxVWUCVW8JwCI42IY6xII jxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4 A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU 0xZFpf9x07jUUUUUUUUU= List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Mon, 16 Nov 2026 02:56:51 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/5403 From: Chen Qi Let's use '??=' for POLICY_BOOLEANS in refpolicy_common.inc so that refpolicy variants such as refpolicy-targeted could override to its own default value via '?='. And users can easily override things via '=' in conf files such as local.conf. Signed-off-by: Chen Qi --- recipes-security/refpolicy/refpolicy_common.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-security/refpolicy/refpolicy_common.inc b/recipes-security/refpolicy/refpolicy_common.inc index e6dac8e..4664a2f 100644 --- a/recipes-security/refpolicy/refpolicy_common.inc +++ b/recipes-security/refpolicy/refpolicy_common.inc @@ -123,7 +123,7 @@ POLICY_MCS_CATS ?= "1024" # Space-separated policy boolean/tunable settings in name=value format. # Values must be either true or false. -POLICY_BOOLEANS ?= "" +POLICY_BOOLEANS ??= "" EXTRA_OEMAKE = "NAME=${POLICY_NAME} \ TYPE=${POLICY_TYPE} \ From patchwork Mon Nov 16 02:57:14 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Qi X-Patchwork-Id: 104302 Received: from cetc.com.cn (cetc.com.cn [220.181.39.39]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.20393.1794797855624434548 for ; Sun, 15 Nov 2026 18:57:36 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: cetc.com.cn, ip: 220.181.39.39, mailfrom: chenqi_hycx@cetc.com.cn) Received: from mail.cetc.com.cn (unknown [123.125.172.206]) by mtasvr (Coremail) with SMTP id _____wC3rbCacPpqhtQAAA--.912S3; Mon, 16 Nov 2026 10:55:22 +0800 (CST) Received: from chenqi-Redmi.. (unknown [123.125.172.206]) by front01 (Coremail) with SMTP id C6CowAB3umoScfpqcNA3AA--.13220S2; Mon, 16 Nov 2026 10:57:22 +0800 (CST) From: chenqi_hycx@cetc.com.cn To: yocto-patches@lists.yoctoproject.org Cc: chen_q07@163.com Subject: [PATCH 6/6] refpolicy-targeted: allow ssh_sysadm_login by default Date: Mon, 16 Nov 2026 10:57:14 +0800 Message-ID: <20261116025714.2558951-1-chenqi_hycx@cetc.com.cn> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CM-TRANSID: C6CowAB3umoScfpqcNA3AA--.13220S2 X-CM-SenderInfo: xfkh015lbk5un06fv33fof0zgofq/1tbiAgYNCmr5tRgQNgAAsb X-CM-DELIVERINFO: =?B?CbqBJKc9tbm9bwt5VqgwP2Pu2dSP9LtrOQxHOAXUJl/eWtrOBydmTZkAAV6p44o2Ir PoONahKFcN3sR551ZGDSnKFd9i0T6pGC08Xw7uUtzS3miiAjbl+DknbSKnvAtVxjrlZ7iG q2n8NxEkW6588qFF1gyvoKZCNGM4BpGFYvUeMAH/q5kRIfSAfxVdrEVE0OP7CA== X-Coremail-Antispam: 1Uk129KBj93XoW7KrykXrykZw1rCFW8Ww1fKrX_yoW8JFW7pr WrtayYyF1xXFyxCw17C3WFgr17ta45Cr4UZayUGw18Aan8ZF4DCw4rW343WFs5ur43JrZ2 vF43Z3y3Wa1UJrXCm3ZEXasCq-sJn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3gc02F40EFcxC0VAKzVAqx4xG6I80ewCY02Avz4vE14v_GrUv73VFW2AG mfu7bjvjm3AaLaJ3UjIYCTnIWjp_UUUYc7kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2 IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l 84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7xvwVC0I7 IYx2IY6xkF7I0E14v26F4j6r4UJwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK 6I8E87Iv6xkF7I0E14v26F4UJVW0owAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07 AIYIkI8VC2zVCFFI0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWU AVWUtwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7V AKI48JM4kE6xkIj40Ew7xC0wCY02Avz4vE14v_Gr1l42xK82IYc2Ij64vIr41l4I8I3I0E 4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGV WUWwC2zVAF1VAY17CE14v26r1Y6r17MIIF0xvE2Ix0cI8IcVAFwI0_JFI_Gr1lIxAIcVC0 I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I 8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73 UjIFyTuYvjxU7UUUUUUUU List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Mon, 16 Nov 2026 02:57:41 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/5404 From: Chen Qi The targeted repolicy is a looser policy than standard/mcs/mls variants. What surprises users is that a looser repolicy does not allow ssh login while the sticter ones do. This is because Yocto's targeted policy is making users land in unconfined_u selinux user by default, and unconfined_u is treated as privileged user, thus being forbidden by default as the default value of ssh_sysadm_login is false. Change to enable ssh_sysadm_login for targeted thus minimal by default. Signed-off-by: Chen Qi --- recipes-security/refpolicy/refpolicy-targeted_git.bb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes-security/refpolicy/refpolicy-targeted_git.bb b/recipes-security/refpolicy/refpolicy-targeted_git.bb index b4bec46..32457f1 100644 --- a/recipes-security/refpolicy/refpolicy-targeted_git.bb +++ b/recipes-security/refpolicy/refpolicy-targeted_git.bb @@ -15,3 +15,5 @@ SRC_URI += " \ file://0001-refpolicy-targeted-Revert-users-Move-unconfined_u-definition-to-unconfi.patch \ file://0002-refpolicy-targeted-make-unconfined_u-the-default-sel.patch \ " + +POLICY_BOOLEANS ?= "ssh_sysadm_login=true"