[tor-bugs] #30920 [Core Tor/Tor]: Detect uint64 overflow in config_parse_units()

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Sep 18 10:15:30 UTC 2019


#30920: Detect uint64 overflow in config_parse_units()
---------------------------+------------------------------------
 Reporter:  nickm          |          Owner:  (none)
     Type:  defect         |         Status:  new
 Priority:  Low            |      Milestone:  Tor: 0.4.2.x-final
Component:  Core Tor/Tor   |        Version:
 Severity:  Minor          |     Resolution:
 Keywords:  easy overflow  |  Actual Points:
Parent ID:                 |         Points:
 Reviewer:                 |        Sponsor:
---------------------------+------------------------------------

Comment (by guigom):

 First of all, sorry for the late reply

 Replying to [comment:9 nickm]:
 > >  Is this the expected behavior, or should it fallback to UINT64_MAX?
 >
 > I think that's a better behavior for config_parse_memunit().  In the
 case of config_parse_memunit(), it's better that the user be told about
 the problem than to have us silently ignore their request.

 Understood, in that case is it ok to detect overflow inside
 config_parse_memunit() by check if nowrap_multiplication yielded
 UINTMAX_64? It seems quite strange in my opinion to specify such value
 explicitly.

 In addition to that I'm not sure if float multiplication should be handled
 as well or this ticket should just focus on unsigned integer.

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


More information about the tor-bugs mailing list