Skip to content

aurora-sep: run the loader in its own SELinux domain - #129

Merged
RyanTheTide merged 1 commit into
mainfrom
fix/aurora-sep-load-domain
Nov 2, 2026
Merged

RyanTheTide merged 1 commit into
mainfrom
fix/aurora-sep-load-domain

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

aurora-sep 1-18. This fixes the boot AVC that fails the SELinux gate on the M2:

avc: denied { view } for comm="gdm-session-wor" scontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tcontext=system_u:system_r:unconfined_service_t:s0 tclass=key

Cause

  • At an automatic login, gdm-session-worker reads /proc/keys as root. A temporary syscall audit context showed the AVC on a read() of that file.
  • proc_keys_show() asks SELinux for view on every key whose DAC bits allow it. aurora-sep-load's probe keys and session keyring are owned by root, with user view set, and labelled unconfined_service_t, so the check is denied and logged.
  • The keys exist only while the probe runs, 5.5 to 9.8 s on the M2, where GDM starts at 5.8 s.
  • On the J616s and Neo, aurora-sep-greeter-fingerprint.service orders GDM after the loader. On the M1 Pro, GDM happens to start 80 ms after the probe ends. Any Mac without that ordering can hit it, and so can any root tool that reads /proc/keys during the probe.

Change

  • New domain aurora_sep_load_t for /usr/libexec/aurora-sep-load (and the /usr/local/sbin copy that tools/aurora-sep installs), via init_daemon_domain plus unconfined_domain.
    • Checked against selinux-policy 44.11: its attribute set is the same as unconfined_service_t plus daemon, and init_t transitions into it. The loader keeps the access it had.
  • dontaudit domain aurora_sep_load_t:key view;
    • The denial is the intended result: other processes must not see the probe keys, and the listing leaves them out. Only the log line goes.
    • No allow rule is added. The policy uses the same idiom for the openshift key-view case.
  • %posttrans labels an installed loader; %selinux_relabel_post would also catch it.
  • Tests: the loader labels, the single scoped dontaudit with no key allow, and the upgrade relabel. Full suite 247 passed.

Testing

  • M2, fleet14o, enforcing, module installed at priority 200. On 2 boots (4e36f744 and 357152e3) GDM started inside the probe window.
    • selinux-gate PASS with 0 AVC on both
    • aurora-sep and aurora-sep-ready active, Touch ID restored, enrolled finger listed, -p3 0
  • J616s, fleet14o, enforcing (gdm is ordered after the loader there, so this is a regression check): boots 4a9679f1 and 75d698df, selinux-gate PASS with 0 AVC, aurora-sep, aurora-sep-ready and greeter-fingerprint active, Touch ID restored, accel0, -p3 0.
  • Neo and M1 Pro (read-only): 0 key AVCs over the last 6 boots each.

🤖 Generated with Claude Code

At an automatic login the GDM session worker lists /proc/keys as root. If
that happens while aurora-sep-load is still checking that the enclave seals
and unseals a trusted key, the kernel asks SELinux whether xdm_t may view
the probe keys. They are labelled unconfined_service_t, so the answer is no
and an AVC is logged on every boot. The M2 shows it because GDM starts at
5.8 s there and the probe runs until about 9.8 s. On Macs where the greeter
fingerprint unit orders GDM after the loader the window is missed.

Give the loader its own domain, aurora_sep_load_t. It stays unconfined, with
the same attributes it had as unconfined_service_t plus daemon. Its keys then
carry that label, and the module stops logging the view check other domains
make on them. Nothing gains access to the keys: the listing still leaves
them out, which is what we want. Label an installed loader on upgrade.

Tested on the M2 (fleet14o, enforcing) with GDM starting inside the probe
window on 2 boots: 0 AVCs, aurora-sep ready, Touch ID restored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@RyanTheTide
RyanTheTide marked this pull request as ready for review November 2, 2026 14:23
@RyanTheTide
RyanTheTide merged commit db61ee8 into main Nov 2, 2026
12 checks passed
@RyanTheTide
RyanTheTide deleted the fix/aurora-sep-load-domain branch November 2, 2026 14:24
RyanTheTide added a commit that referenced this pull request Nov 9, 2026
…134, #133)

RC8.2 = RC8.1 + speakerguardd#134: a switch in the running boot grants at
once (aurora-speaker-upgrade's umask 077 leaked into v2's provisioning, so
/run/speakerguardd-graph was unreadable to the seat user and the speakers
stayed silent until a reboot; found by the RC8 E2E on the M1 Pro and M2),
#133 (the MacBook Neo's speaker PCM wakes on period interrupts), and voicing
parity #129/#135. aurora-speaker-upgrade rides on the same commit.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant