Skip to content

fix(safety): secure helper and recover interrupted hardware control - #24

Merged
harryisfish merged 4 commits into
mainfrom
fix/four-safety-issues
Oct 23, 2026
Merged

harryisfish merged 4 commits into
mainfrom
fix/four-safety-issues

Conversation

@harryisfish

@harryisfish harryisfish commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Why

The root daemon could execute a user-replaceable helper, and interrupted hardware writes or foreground discharge could leave manual control active. Non-finite temperature inputs could also bypass the thermal guard.

What changed

  • Install an atomic, protected helper copy and update the upgrade instructions.
  • Roll failed fan operations back to auto, retry incomplete recovery, and reject non-finite safety inputs.
  • Supervise foreground discharge in the daemon with connection ownership, a monotonic renewal deadline, target checks, and restoration retries.

Scope

Fix the four high-priority findings. Other audit findings and hardware-specific DDC changes are excluded. Old daemons must be reinstalled before the new CLI will start supervised discharge.

Blast Radius

Touches daemon installation, all manual fan write callers, thermal safety, and adapter control. Manual adapter toggles remain separate from supervised discharge. Homebrew upgrades now require sudo smctl daemon install to update the protected copy.

Verification

  • Before the fix, focused fan/guard regressions produced 10 assertion failures.
  • 133 related tests passed, including filesystem copy/permission/ACL checks, fan rollback/retry, non-finite inputs, lease expiry, session ownership, and a real anonymous XPC disconnect with a mock SMC backend.
  • Current-head CI passed debug build, the full test suite, and release build: https://github.com/leaperone/smctl/actions/runs/39926269811. No actual helper installation or hardware write was performed.

Install a protected helper copy and supervise foreground discharge in the
root daemon. Restore failed fan operations, retry incomplete recovery, and
reject non-finite safety inputs.
Reject extended ACLs on the fixed installation path and clear copied ACLs
inside a private staging directory. Let connection invalidation end only
its own discharge session and correct the restart help text.
@harryisfish
harryisfish merged commit da3055d into main Oct 23, 2026
1 check passed
@harryisfish
harryisfish deleted the fix/four-safety-issues branch October 23, 2026 08:53
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