[tor-bugs] #24423 [Core Tor/Tor]: Fix STACK warnings in Tor

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Dec 12 19:07:51 UTC 2017


#24423: Fix STACK warnings in Tor
-----------------------------+------------------------------------
 Reporter:  nickm            |          Owner:  nickm
     Type:  defect           |         Status:  accepted
 Priority:  Medium           |      Milestone:  Tor: 0.3.3.x-final
Component:  Core Tor/Tor     |        Version:
 Severity:  Normal           |     Resolution:
 Keywords:  review-group-27  |  Actual Points:
Parent ID:                   |         Points:
 Reviewer:  catalyst         |        Sponsor:
-----------------------------+------------------------------------

Comment (by catalyst):

 It looks like STACK is complaining about the comparison on line 498 `if
 (earliest_start_time >= now)` being simplified based on the assumption
 that the `earliest_start_time` computation doesn't overflow or underflow,
 and therefore the algebraic equivalences hold (cancelling the `now` from
 the comparison).  The added `tor_assert(cert_lifetime <= INT_MAX)` adds
 some constraints to `cert_lifetime` but apparently that's not enough.
 STACK doesn't seem to know any constraints on `now`, so maybe as far as
 it's concerned, the subtraction could still underflow. (or the additions
 could overflow)

 Perhaps the comparison on line 498 should be `if (cert_lifetime <
 min_real_lifetime + start_granularity)`, with the original
 `earliest_start_time` computation moved into an `else` clause.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/24423#comment:19>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list