mbox series

[0/6] meta-selinux: fix systemd 262 denials and ensure SELinux tests work on every variant

Message ID 20261116025620.2558594-1-chenqi_hycx@cetc.com.cn
Headers show
Series meta-selinux: fix systemd 262 denials and ensure SELinux tests work on every variant | expand

Message

Chen Qi Nov. 16, 2026, 2:56 a.m. UTC
From: Chen Qi <chenqi_hycx@cetc.com.cn>

1-3 make the policy usable.  Bump refpolicy to 720c02a1b for the
systemd 262 fixes, carry the shadow lock fix that upstream has not
merged (PR #1280), and run `make bare` before do_compile so a changed
POLICY_BOOLEANS is not defeated by stale generated files.

4 decides the cases from /proc/self/attr/current, and logs in as a
user_u test account where the session is unconfined.

5-6 make the variable overridable with ??= and default
ssh_sysadm_login to true on targeted, where ssh root otherwise fails
with "/bin/sh: Permission denied".

Tested with core-image-minimal on qemux86-64 and qemuarm64,
refpolicy-mcs 15 passed, refpolicy-targeted 14 passed 1 skipped.

Chen Qi (6):
  refpolicy: bump to latest
  refpolicy: fix shadow lock issue
  refpolicy_common: ensure we start from a clean state in do_compile
  oeqa: decide the SELinux cases on the domain, not the policy name
  refpolicy_common: use ??= for POLICY_BOOLEANS
  refpolicy-targeted: allow ssh_sysadm_login by default

 lib/oeqa/runtime/cases/selinux.py             | 543 ++++++++++++++----
 .../refpolicy/refpolicy-targeted_git.bb       |   2 +
 ...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 +-
 ...allow-creating-the-shadow-lock-files.patch |  41 ++
 .../refpolicy/refpolicy_common.inc            |   4 +-
 recipes-security/refpolicy/refpolicy_git.inc  |   2 +-
 64 files changed, 620 insertions(+), 432 deletions(-)
 create mode 100644 recipes-security/refpolicy/refpolicy/0058-authlogin-allow-creating-the-shadow-lock-files.patch