You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(M17): expire admin_mode after idle timeout, refresh on activity
admin_mode was cleared only by explicit logout and USB disconnect, never by
time. On a permanently attached host stdio_usb_connected() stays true, so one
login persisted indefinitely and anyone later reaching the host or cable
inherited admin.
Record an absolute time_us_64() deadline = now + ADMIN_IDLE_TIMEOUT_US (5 min)
whenever admin is granted (new commands_admin_grant(), called from every
cmd_login grant path). The dispatcher expires a stale session before honoring
any admin-gated command (clears admin_mode, refuses) and refreshes the deadline
after each successful admin command so active use extends the window. USB
disconnect now also clears the deadline. A zero deadline is treated as
never-expiring so direct admin_mode toggles (host harness) are not spuriously
logged out.
harness_commands gains an injectable time_us_64() and an assertion that an admin
command is allowed within the window (refreshing it) and refused + auto-cleared
after it. Host asan/valgrind/coverage/ci-check all 0.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments