[Bug 2228] New: ssh-agent passwords do not timeout properly

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Wed Apr 16 22:03:45 EST 2014


https://bugzilla.mindrot.org/show_bug.cgi?id=2228

            Bug ID: 2228
           Summary: ssh-agent passwords do not timeout properly
           Product: Portable OpenSSH
           Version: 6.4p1
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P5
         Component: ssh-agent
          Assignee: unassigned-bugs at mindrot.org
          Reporter: john.haxby at oracle.com

Created attachment 2425
  --> https://bugzilla.mindrot.org/attachment.cgi?id=2425&action=edit
proposed patch

I habitually run "ssh-add -t10h" when I open up my laptop in the
morning and then suspend it at the end of the working day, usually a
little while before the lifetime of the identities expires.

Recently, however, this hasn't worked because the agent still has the
identities the following morning.

I believe that this is because monotime() uses CLOCK_MONOTONIC but in
recent kernels this has changed slightly.  From clock_gettime(2):

    CLOCK_MONOTONIC
           Clock that cannot be set and  represents  monotonic  time
           since some unspecified starting point.  This clock is not
           affected by discontinuous jumps in the system time (e.g.,
           if  the system administrator manually changes the clock),
           but is affected by the incremental adjustments  performed
           by adjtime(3) and NTP.

    CLOCK_BOOTTIME (since Linux 2.6.39; Linux-specific)
           Identical to CLOCK_MONOTONIC, except it also includes any
           time  that the system is suspended.  This allows applica‐
           tions to get a suspend-aware monotonic clock without hav‐
           ing  to  deal  with  the complications of CLOCK_REALTIME,
           which may have discontinuities if  the  time  is  changed
           using settimeofday(2).

The attached patch seems to fix this: if CLOCK_MONOTONIC is available
then additionally check for CLOCK_BOOTTIME.  CLOCK_BOOTTIME is Linux
specific and will never be defined unless CLOCK_MONOTONIC is also
defined.

So far as I can tell this has not been addressed in the current
version.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list