Repository navigation
Conversation
A kernel that publishes a catacomb by atomic replacement writes the complete file under a fixed temporary name, ".<name>.new", in /var/lib, and renames it over the catacomb. SELinux labels a file when it is created and rename keeps that label, so the temporary must be created with the state type, not var_lib_t. Give the three temporary names aurora_sep_state_t with type_transition rules and file contexts, and let the kernel set attributes on (to reset a temporary's mode to 0600 after a restrictive caller umask), rename and unlink state files. Bump the module to 1.4.0 and the package to 1-14. This policy has to be installed before a kernel with atomic catacomb replacement, so it lands and ships on its own first. It only adds labels and permissions; current kernels are unaffected. Signed-off-by: Matt <mmdisbro@gmail.com>
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR checklist audit at live head 41a02cefcf581d3905149bd012353d73ee69fc12.
Splitting the SELinux policy precursor out of #2966 directly addresses the §1 chicken-and-egg upgrade-order blocker, and the policy rules themselves are well-aligned with #2966 (store_shim.c). However, CI has not run on this fork PR and §5 policy-build + Fedora SELinux Enforcing verification is still missing, so this cannot enter MERGETRAIN-LINUX4 yet.
Technical Audit (Cross-checked against #2966)
- SELinux TE/FC rules (
aurora_sep.te,aurora_sep.fc):- Bumps
policy_module(aurora_sep, 1.4.0)cleanly. - Adds named
type_transition kernel_t var_lib_t:file aurora_sep_state_t ".apple-sep-catacomb-{master,owner,user}.bin.new";and matching.fcregex/var/lib/\.apple-sep-catacomb-(master|owner|user)\.bin\.new -- gen_context(system_u:object_r:aurora_sep_state_t,s0), matchingstore_shim.c's".%s.new"names so renamed inodes preserveaurora_sep_state_t. - Adds valid refpolicy macros
setattr_file_perms({ setattr }),rename_file_perms({ getattr rename }), anddelete_file_perms({ getattr unlink }) toallow kernel_t aurora_sep_state_t:file, matchingnotify_change(),vfs_rename(), andvfs_unlink()executed underoverride_creds(kern)in #2966. - Preserves the
test_no_access_to_generic_var_libinvariant (noallow ... var_lib_tadded).
- Bumps
- Spec & backward compatibility (
aurora-sep.spec,test_sep_selinux_state.py):- Cleanly bumps
Release: 14%{?dist}with upgrade-order changelog note; strictly additive over1-13and backwards-compatible with current truncate-in-place kernels. - Unit tests verify
.fc,type_transition, andallowrules without depending onstore_shim.c. - (Non-blocking packaging note:
fedora-aurora/packages/aurora-sepis currently ahead oflinux/tools/aurora-sepat1-22, so once this precursor lands, the same.te/.fcdelta will need to be mirrored into the distribution package before shipping #2966.)
- Cleanly bumps
Blockers Before Approval
- CI not executed (
action_required): Fork PR (mmdisbrow/aurora-silicon-linux) has emptystatusCheckRollup; bothSEP source checks(run45183622208) andHost tests(run45183621928) areaction_required. Both workflows must be run and green on the final head before merge. - §5 Policy build & Fedora SELinux Enforcing verification missing:
test_sep_selinux_state.pyonly inspects.te/.fctext with regexes; it does not compileaurora_sep.ppviaselinux-policy-devel(make -f /usr/share/selinux/devel/Makefile aurora_sep.pp) or verify module installation/upgrade. As noted in the PR body, live Fedora SELinux Enforcing build and upgrade testing are still pending. Before approval, please report:- Successful
aurora_sep.ppcompilation / RPM build withselinux-policy-devel. - Fedora SELinux Enforcing upgrade check (
1-13->1-14) on a Mac with SEP/Touch ID running the current kernel, confirmingsemoduleinstallation,matchpathconon/var/lib/.apple-sep-catacomb-{master,owner,user}.bin.new->aurora_sep_state_t, no regressions on existing truncate-in-place SEP state, and the §5 regression tuple (0 SELinux denials, 0 failed units, 0 new kernel errors).
- Successful
Checklist (§1–§6)
- §1 No model gating / chicken-and-egg: Pass (clean precursor split ahead of #2966).
- §2 Production-ready, no hacks: Pass.
- §3 Safety: Conditional on §5 policy compilation and Enforcing upgrade verification.
- §4 Clean-room & attribution: Pass — commit
41a02cefcf58carries human author/committer (Matt <mmdisbro@gmail.com>) and humanSigned-off-by:only, with zero AI trailers in commits; PR body includesAssisted-by:. - §5 Evidence: Blocked (see Blocker #2).
- §6 Naming & CI: Naming Pass; CI Blocked (
action_required, 0 checks run).
Assisted-by: LLM (Gemini 4 Neon)
|
Added Fedora 45 (
Remaining open blockers on this PR:
|
Why
Atomic catacomb replacement in #2966 writes each catacomb to
/var/lib/.apple-sep-catacomb-{master,owner,user}.bin.new, resets its mode to0600when a caller's umask cleared bits, renames it over the target file, and unlinks any leftover temporary file. Underaurora-sep-selinux1-13 (module 1.3.0), those temporary files inheritvar_lib_tinstead ofaurora_sep_state_tandkernel_tlacks module-scopedsetattr,rename, andunlinkrules onaurora_sep_state_t. Per §1 review on #2966, split the SELinux policy update soaurora-sep-selinux1-14 can land and ship ahead of the kernel consumer.What changed
tools/aurora-sep/aurora_sep.te: bump module to1.4.0, addsetattr_file_perms rename_file_perms delete_file_permstoallow kernel_t aurora_sep_state_t:file, and add namedtype_transitionrules for.apple-sep-catacomb-{master,owner,user}.bin.new.tools/aurora-sep/aurora_sep.fc: add file-context pattern for/var/lib/\.apple-sep-catacomb-(master|owner|user)\.bin\.new.tools/aurora-sep/packaging/fedora/aurora-sep.spec: bump Release to1-14with changelog entry.tools/aurora-sep/tests/test_sep_selinux_state.py: verify the temporary file contexts,type_transitionrules, andkernel_tallow rule without depending ondrivers/soc/apple/store_shim.c.Scope
SELinux policy, Fedora RPM spec, and policy unit tests only (
drivers/unchanged from110861f43). Backwards-compatible with current truncate-in-place kernels.Verification
41a02cefc(Rust 1.85.0): all 16 Python test commands fromsep-source.ymlpass, includingtest_sep_selinux_state.py(14/14) andtest_packaging.py(4/4).checkpatch.plreports 0 errors and 0 warnings;git diff --checkis clean.registry.fedoraproject.org/fedora:45(aarch64) container (selinux-policy-targeted-45.24-1.fc45,selinux-policy-devel-45.24-1.fc45,policycoreutils-3.11-2.fc45,setools-console-4.7.1-1.fc45):tools/aurora-sep/packaging/fedora/build.shcompiledaurora_sep.ppwith 0 errors and builtaurora-sep-1-14.fc45.noarch.rpm,aurora-sep-selinux-1-14.fc45.noarch.rpm, andaurora-sep-1-14.fc45.src.rpm.semodule -s targeted -N -iupgrade from1-13(110861f43) to1-14(extracted fromaurora-sep-selinux-1-14.fc45.noarch.rpm) succeeded cleanly intopolicy.35.matchpathcon -f /etc/selinux/targeted/contexts/files/file_contextsmoved/var/lib/.apple-sep-catacomb-{master,owner,user}.bin.newfromsystem_u:object_r:var_lib_t:s0(1-13) tosystem_u:object_r:aurora_sep_state_t:s0(1-14), while keeping the canonical catacombs,aurora-sep-keybag.bin, and/dev/sep-biounchanged.sesearchon/etc/selinux/targeted/policy/policy.35confirmed all 13type_transition kernel_t var_lib_t:file aurora_sep_state_trules (including the three.newnames) and intactkernel_t/fprintd_t/kmod_t/init_tfile rules.SEP source checksandHost tests), and live Fedora SELinux Enforcing1-13to1-14upgrade check on a Touch ID Mac running the current kernel (0 SELinux denials, 0 failed units, 0 new kernel errors).Assisted-by: OpenAI Codex (original change and cross-family review), Claude Code and Gemini (split, rework, and verification)