Repository navigation
aop-boot-guard-k114: guarded AOP and speaker DAI module load - #2918
joshuaswarren wants to merge 1 commit into
Conversation
The M5 Max MacBook Pro boots with the AOP and its speaker DAI module unloaded, and loading them can hang the boot. This ships a root oneshot that loads both modules at most once per boot under a byte-pinned watchdog runner and refuses unless every trust check passes: exact model compatible, a manifest for exactly the running kernel release pinning the sha256 of the stock aop.ko and snd-soc-t8152-aop-audio.ko, matching vermagic, root-owned and not group or other writable files and parents, the runner's own hash, and speakerguardd-k114 installed at 0.1.12-4. A durable inflight latch blocks later boots until a load exits zero, so a half-finished load is never retried blind. No manifests ship with the package: the kernel build or the machine owner drops /usr/lib/aop-boot-guard/manifests/<release>/manifest.json in per pinned kernel, and the loader refuses unknown kernels, so the package is inert until pins exist. tests/aop-boot-guard-k114.py compiles the shipped loader and runner bytes and runs them against a virtual filesystem: refusal cases for hash, vermagic, permissions, ownership, compatible and package pin, latch durability across simulated reboots and crashes, runner exit status mapping, and per-release manifest selection. Wired into the self-tests job beside the other package tests. Proof: the suite fails against the package-less tree (loader missing) and passes 20/20 with it; a mutant loader that skips the module hash comparison is killed by the valid-vermagic wrong-hash case. Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
[Medium impact] The PR adds an opt-in boot-time module load for one MacBook model. Fix the watchdog deadline before merging so a stuck module load receives the promised recovery. Findings
SummaryAdds an opt-in package that checks the model, kernel manifest, module bytes, runner bytes, and speaker daemon version before loading two modules.
Intentional limits noted by
|
| while p.poll() is None: | ||
| os.write(fd, b"\0") | ||
| time.sleep(2) |
There was a problem hiding this comment.
If insmod gets stuck while other processes can still run, this loop keeps feeding /dev/watchdog every two seconds. The watchdog therefore cannot trigger the promised 90-second reset. Under the shipped service, recovery instead waits for TimeoutStartSec=300 to stop the runner before the watchdog can expire.
Add a deadline that stops feeding the watchdog when the load takes too long, and test a child that never exits.
|
GREEN on 589b3a1 Independent review (wAQ, cross-model; I did not write this PR). Comment only, no approve, no merge. Checked at this exact head:
Notes, not blocking:
Not verified here: no package build, no hardware, no real |
|
Model correction (wAQ), not a new review. My review comment(s) on this PR (comment 6924917224) carried the line 'Model: zai/glm-5.3'. That was wrong. The reviewing session ran anthropic/claude-sonnet-5-5 (per the pane header and the session log's model_change at 2026-11-16T17:18:43Z). The correct model line is: Model: anthropic/claude-sonnet-5-5. Verdicts, heads, findings and checks in those comments are unchanged. |
|
Same-model flag (wAQ), not a new review. My review of this PR ran anthropic/claude-sonnet-5-5. The implementing lane (wAS, branch wAS/aop-boot-guard) also runs Sonnet 5.5 (pane headers, Main, 2026-11-16 13:31 CST). This was not a cross-model review. wAW is being assigned a second-model review. My verdict stands as a Sonnet 5.5 review only. |
|
Review by SWE-2 Flash (Devin), head 589b3a1. Verdict: GREEN — the fail-closed design is thorough and the contract test passes locally ( Verified by reading:
Notes, not blockers:
|
One guarded AOP and speaker DAI module load per boot for the MacBook Pro
14-inch (M5 Max, K114c), as an opt-in package.
Why: loading the AOP and its speaker DAI module at boot can hang the
machine, so the load runs under a byte-pinned watchdog runner (pets
/dev/watchdog while insmod runs; a hung load resets the SoC after 90 s)
and every trust check fails closed: exact model compatible, a per-kernel
manifest pinning the sha256 of the stock aop.ko and
snd-soc-t8152-aop-audio.ko plus matching vermagic, root-owned and
unwritable-by-others files and parent chains, the runner hash, and
speakerguardd-k114 installed at exactly 0.1.12-4. At most one load
attempt per boot; a durable inflight latch keeps later boots from
retrying until a load exits zero, for manual review.
No manifests ship with the package. The kernel build or the machine
owner drops /usr/lib/aop-boot-guard/manifests//manifest.json in
for each pinned kernel; on any kernel without one the unit refuses and
loads nothing. The shipped /usr/share/doc/aop-boot-guard-k114/README.md
documents the manifest contract.
The load pairs with speakerguardd-k114 (#2719): the loader pins that
package at 0.1.12-4, so it goes live once that PR carries the pkgrel 4
hand-off fix.
Test: tests/aop-boot-guard-k114.py compiles the shipped loader and
runner bytes and executes them against a virtual filesystem; it covers
refusals (hash, vermagic, permissions, ownership, compatible, package
pin, manifest shape), the once-per-boot marker, latch durability across
simulated reboots, crashes and runner faults, runner exit status
mapping, and manifest selection by running release. Wired into the
self-tests job in .github/workflows/test.yml beside the other package
tests. Red: the suite fails on a package-less tree (loader missing).
Green: 20/20 pass. Mutation: disabling the module hash comparison is
killed by the valid-vermagic wrong-hash case.