Accept device-initiated Bluetooth Just Works pairing - #12897
Chessing234 wants to merge 3 commits into
Conversation
|
Two actionable issues remain at Verified: On a private D-Bus with synthetic BlueZ objects and unattended stdin, the old agent rejected Auto-accept is not restricted to the claimed pairing window
This is a source-derived flow, with the success replies also tested over private D-Bus without a panel running. BlueZ documents Impact: Incoming requests that reach the agent can be authorized outside a user pairing action. The inaccurate comment existed previously, but replacing rejection with success makes the missing guard consequential. No over-the-air pairing or exploit was demonstrated. Suggested change: Establish an explicit, bounded pairing-consent policy, including closed/startup/error states. If relying on Existing sessions keep the old rejecting agentThe unit change updates Impact: Users already running the old agent still encounter its rejection when retesting the fix. This is an upgrade-activation gap, not a new pairing regression; a fresh agent start uses the replacement. Suggested change: Add a focused migration to reload the user manager and restart the active agent, leaving intentionally inactive services alone. Review informationTest scope: Pinned source, real agents/clients against synthetic BlueZ on private D-Bus, bond-state controls, and focused repository suites. No physical Bluetooth/HID, rendered panel, or actual package-upgrade test; upgrade behavior is source-derived. Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review. Automated AI review: Astra initial inspection, independent Opus 5 and Astra technical reviews, followed by verification of claims against targeted evidence and technical adjudication. |
The panel raises Pairable only while open (and clears BlueZ's default at load), the agent rejects pairing outside that window, and a migration restarts an already-active bt-agent so upgrades leave the old rejector.
|
addressed both points:
|
|
also covers #7889 — pairable only while the panel is open |
Automated AI review
Follow-up to the earlier review and the author's reply, checked at Resolved: "Existing sessions keep the old rejecting agent". Partly addressed: "Auto-accept is not restricted to the claimed pairing window". The agent now rejects pairing requests when no adapter is Pairable, and the panel clears Pairable on the default adapter when it loads and closes. Pairable can still be on with every panel closed in three states, described below. Turning Pairable off also has a new side effect: pairing started outside the panel no longer bonds. Verified: the agents at both heads, called as bluetoothd would call them, against a synthetic BlueZ on a private D-Bus (device under
"Pairing requests" means
Pairable can still be on with every panel closedIn Omarchy, only the panel clears Pairable, and only on its own load, open and close events ( The agent's decision covers LE Just Works and PIN/passkey pairing. For Classic devices without a stored key, the kernel accepts SSP bonding by itself whenever Pairable is on, as it did at the base. Source reading of the kernel and bluetoothd also limits who can reach these requests: links the host makes or accepts (known devices, devices the user connects to), not arbitrary nearby devices. No over-the-air test was done. Impact: in these states, pairing is not limited to the time a panel is open. That is the guarantee the agent header and unit comment describe and the new #7889 claim relies on. The #7889 reproduction on the default controller (open the panel, close it, Suggested change: let the always-running agent own the closed default. After Pairing started outside the panel no longer bondsWhen the adapter is not Pairable, the kernel removes bonding even from pairing the host starts: Classic in The panel's own Pair action is affected the same way if the panel is closed before the device bonds. Impact: pairing from a terminal or another tool with no panel open, which bonded at the base, now leaves a device that has to be paired again after each disconnect. This comes from source reading; it was not run. Suggested change: raise Pairable for the duration of a host-initiated pair in
Optional test improvement: Migration file mode: Related open PRs:
Review informationTest scope: follow-up limited to the Pairable gate, the panel's Pairable handling, AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
Summary
bt-agentwithomarchy-bluetooth-agent, which returns success fromRequestAuthorization/RequestConfirmation/AuthorizeServiceso Xbox controllers and BLE keyboards can bond.Bonded: yes, and route trusted-but-unbonded devices back through pair in the panel.Fixes #10771.
Fixes #7889.
Test plan
bash test/shell.d/bluetooth-test.shbash test/shell.d/systemd-test.shBonded: yesand HID input