Opened 3 months ago

Last modified 2 months ago

#30031 new defect

Test circuitpadding with zero monotonic time deltas, and fix any bugs

Reported by: teor Owned by:
Priority: Low Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Normal Keywords: wtf-pad
Cc: Actual Points:
Parent ID: Points: 2
Reviewer: Sponsor: Sponsor2-can

Description

Any pre-ratchet monotime increment can be zero or negative, because the Windows API and gettimeofday() don't provide monotonic source times.

So after Tor applies the ratchet, any number of calls to the monotonic time functions may return the same value.

We have seen this happen when:

We know it can also happen when:

  • Tor uses gettimeofday() and a ratchet to emulate monotime, and the wall clock time goes backwards

But these circumstances are rare:

  1. unit tests like test_util_monotonic_time() pass on Linux, macOS, and Windows CI
  2. Sleeping Windows boxes don't care about padding timing accuracy
  3. macOS VMs are rare
  4. Systems without monotime functions are rare, and clock changes on those systems are also rare

Child Tickets

Change History (2)

comment:1 Changed 3 months ago by teor

Sponsor: Sponsor2-can

comment:2 Changed 2 months ago by mikeperry

Priority: MediumLow

#28634 doesn't even use monotime. This analysis is not needed until a research machine that needs token removal or RTT estimate.

However, in either case I still think the risk of any serious bugs coming from this problem are low.

Note: See TracTickets for help on using tickets.