Repository navigation
Revert USB and Thunderbolt authorization and undo installed protection - #14938
omarchybot wants to merge 6 commits into
Conversation
Reverts merge commit 5cb3131 from PR #11874 using its first parent. Preserve later per-unit service startup and LUKS provisioning guards while removing the feature and accessory-only expectations from the LUKS journal test. This reverts source changes; installed authorization policies and boot settings require separate rollback.
Removing the source alone leaves USBGuard and Bolt blocking accessories after their approval commands disappear. Retain the deployed boot and policy recovery routines under the migration directory, restore signed USB images before disabling enforcement, preserve live manual Bolt policies and keys, and repair automatic enrollment in factory snapshots. Serialize rollback across users and publish every rewritten file atomically with explicit error checks because conditional calls suppress Bash errexit. Retain the original factory Bolt mode and read-only state across interruptions. Co-Authored-By: Codex Medium <noreply@openai.com>
|
GPT-6 in Codex reviewed this revert and its installed-state migration. Codex Medium supplied the required second opinion, contributed checks for cold Bolt startup, factory mode and read-only recovery, and interrupted file publication, and found no remaining actionable defects at Verification ran on disposable ISO workers without credentials. The CLI suite, affected provisioning and menu tests, signed USB archive and enrollment tests, and new rollback regressions passed. Mutation checks proved that the regressions reject the reviewed failure paths. A native migration with real USBGuard, Bolt, systemd and kernel USB authorization passed, including a stopped legacy watcher unit fixture, cold Bolt startup, protected root startup and repeated execution. The Security menu was inspected on the worker desktop. The complete candidate suite recorded 5,506 passing assertions and failures in eight files: Physical Thunderbolt firmware restoration was not exercised; the worker has no such controller. Signed boot conversion requires the original signing keys, temporary space and any custom image builder, and firmware restoration requires the original controllers to be online. Failed rollback keeps the migration pending and recovery data intact. USB boot changes require a reboot. This intentionally removes the approval barrier added by #11874. Waiting on the maintainer to decide whether to land it. |
|
|
Confirmed a remaining P2 at With the main unit symlink pointing into a missing checkout, I reproduced this using the actual migration in an isolated fixture, with real offline systemctl for enabled-state resolution. The minimal systemctl behavior is: fixture=$(mktemp -d)
unit=omarchy-thunderbolt-authorization.service
mkdir -p "$fixture/etc/systemd/system/graphical-session.target.wants"
ln -s /missing/checkout/unit "$fixture/etc/systemd/system/$unit"
ln -s "../$unit" "$fixture/etc/systemd/system/graphical-session.target.wants/$unit"
systemctl --root="$fixture" is-enabled "$unit" # not-found, exit 4Please explicitly remove the retired watchers' enablement symlinks even when the main unit is missing, and add the wants-link fixture to the migration regression. Keep failures stopping active services fatal. The existing dangling-unit test covers only the main link, so it currently passes without catching this. This affects our #14936/#14937 cleanup too; I am fixing those. I separately verified that this PR handles the missing-marker Thunderbolt recovery and stopped-Bolt cases and repairs the old factory enrollment code, which our versions had missed. |
Repair staged and retained factory roots before a reset activates them, stop orphaned watchers by their running state, and record machine-wide completion so later users need no privilege prompt. Attempt independent repairs even after another fails, preserve manual USBGuard policy, archive obsolete IPC grants, and bind recovery services to packaged root code. Keep a user retry checkpoint when privileged cleanup fails while still stopping its watchers. Regression fixtures cover both shipped startup forms and actual snapshot boot paths; removal of each fix makes its regression fail. Co-Authored-By: Opus 5.5 XHigh <noreply@anthropic.com>
A reboot before the user migration must still authorize already trusted Thunderbolt devices, so retain the original boot units with protected daemon and guard-only bridges into packaged recovery code. Restore the live USB module default as well as existing hubs so later controllers authorize input after USBGuard stops. Bind sibling libraries to the canonical package directory and record reset repair errors in the advertised log. Exercise both compatibility actions, newly registered controller defaults, recovery-unit branches, root completion cleanup and the enrolling user flag. Co-Authored-By: Opus 5.5 XHigh <noreply@anthropic.com>
Package upgrades restore the original Thunderbolt unit and Bolt guard, so leave those compatibility files unchanged and inert after marker removal rather than rewriting and archiving them. Refuse to disable USBGuard when a manual default-deny boot parameter would strand input on the next boot. A verified Omarchy boot-removal receipt allows retry before reboot and is tied to the running boot so it cannot excuse a later manual deny boot. Cover a failed independent USB repair followed by package-file reinstatement and retry, plus current and stale boot receipts. Co-Authored-By: Opus 5.5 XHigh <noreply@anthropic.com>
The verified boot-removal receipt must also identify Omarchy-owned USB state after a later enforcement failure, so another user without a local policy flag can finish the rollback. Read and validate the running boot identity once before conversion, and cover the receipt actually generated while the running kernel still denies authorization. Assert that accepted receipts both disable USBGuard and restore live devices, while refused and stale receipts never stop enforcement. Co-Authored-By: Opus 5.5 XHigh <noreply@anthropic.com>
|
Reviewed On a disposable worker, the exact-head full suite recorded 5,533 passing assertions. Seven failing files also fail on the unchanged base: ASCII width, branding animation, agent migration, cold compositor startup, passwordless grant lifecycle, bar ordering, and screenshot sanity. Apple brightness-cache and Kitty configuration checks were skipped. Focused rollback regressions pass as both user and root; twenty-one deliberate removals of fixes make their regressions fail, and the restored tree passes. Native systemd, USBGuard and Bolt checks pass, including a running not-found watcher, a package-owned recovery daemon publishing snapshots, IPC retirement and a non-wheel second user requiring no sudo. A real pre-migration reboot retained Bolt and the recovery daemon, and the real packaged reset-root action repaired a fixture and logged rejected custom enrollment. Using real Historical compatibility concerns were checked against the merge history: the original batch and later per-unit first-run forms are both covered, and Opus 5.5 XHigh in Claude Code’s final static pass found no blocking defects and confirmed the receipt, ownership and retry changes. Its optional test-ordering assertion would strengthen coverage; the source already reads the boot identity before conversion. Optional receipt symlink hardening requires an unprivileged writer under the state path, which is root-owned and mode 0755 in the native install; no such writer was found. Five Claude passes were completed, including two focused confirmations beyond the initial three-pass plan. Claude contributed verified failure mechanisms; independence of the final agreement is not guaranteed because the confirmation prompts include the checked findings and repairs. The branch awaits the maintainer’s decision. Greptile’s separate automated review was still running when this report was posted. |
Reverts #11874 (
5cb31317b488dce2734c867fd9dc21f9fb7a7e9a) and removes its installed protection, restoring the previous behavior for USB and Thunderbolt accessories at the maintainer’s request. This intentionally removes the mandatory approval barrier that #11874 added.A source revert alone would leave USBGuard blocking devices without approval commands and Bolt’s saved authorization settings and boot restrictions in place. The upgrade migration restores permissive USB boot images and snapshot metadata before stopping USBGuard, restores live USB authorization for existing and newly registered host controllers, hands Omarchy-enrolled Bolt records back to automatic policy while preserving independent manual policies and saved secure keys, restores the saved firmware allowlists and original Bolt authorization mode, and retires watcher enable links and copied Polkit definitions. Signed USB image conversion and transactional Bolt recovery remain under the migration directory solely to undo the state already deployed. Independent Thunderbolt, USB and factory repairs all run even if another fails. Failures leave the migration pending and retain recovery data; Thunderbolt handoff requires the original controllers to be online. A verified USB boot-removal receipt preserves ownership across failed enforcement removal and is tied to the running boot when bypassing the boot-deny interlock, allowing retries before reboot. A manual default-deny kernel parameter in the running boot keeps USBGuard in place until the administrator removes the parameter, rebuilds, reboots and retries. USB boot changes take effect after reboot. Signed USB image conversion requires the existing signing keys and temporary disk space; custom measured-boot or multi-profile images require their original builder.
An existing factory snapshot is repaired without reenrolling accessories on the next reset, while preserving its original Bolt mode and read-only status across retries. Factory script repairs publish complete files atomically. Factory reset also repairs the staged clone and retained baseline before activation, so it remains safe before the login migration runs. Root rollback is serialized across users and records machine-wide completion; later users need no sudo for their own watcher cleanup. Fresh machines without feature residue skip root work. Running watchers are stopped even when package removal has erased their unit files or privileged rollback fails, and dangling enable links are removed. A user checkpoint keeps unfinished root work pending after watcher cleanup.
Removes the feature’s user-facing commands, install and provisioning enrollment, menu entries, policy definitions, enrollment migrations, documentation, and approval tests. Preserves later unrelated fixes, including per-unit first-run startup and the LUKS provisioning completion guard. USB removal requires Omarchy-generated policy or marked boot settings; an unrelated kernel parameter or watcher alone does not disable manual USBGuard policy. Known Omarchy IPC grants are archived outside USBGuard; custom grants are preserved, and the installed USBGuard package is left in place. Recovery root units execute only the packaged helper, with compatibility units retained unchanged while removal is incomplete. Package updates can restore these units without breaking a retry; after removal, their marker condition fails and the Bolt guard does nothing. Saved USB rules, disabled Omarchy trust records, and live Bolt keys are retained. Hidden daemon and guard-only compatibility entrypoints retain the original boot unit and Bolt guard while installed protection awaits removal, including a reboot before the user migration runs. Historical system snapshots still contain their original software; after restoring one, update and rerun the rollback with
rm -f ~/.local/state/omarchy/migrations/1791673477.sh && omarchy-migrate, because per-user migration markers in/homesurvive a root snapshot restore.No separate issue is closed.