[tor-bugs] #29527 [Core Tor/Tor]: Division by zero: undefined behaviour in circuitpadding/circuitpadding_sample_distribution test

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Feb 26 10:55:36 UTC 2019


#29527: Division by zero: undefined behaviour in
circuitpadding/circuitpadding_sample_distribution test
-------------------------------------------------+-------------------------
 Reporter:  teor                                 |          Owner:  (none)
     Type:  defect                               |         Status:
                                                 |  needs_review
 Priority:  High                                 |      Milestone:  Tor:
                                                 |  0.4.0.x-final
Component:  Core Tor/Tor                         |        Version:
 Severity:  Normal                               |     Resolution:
 Keywords:  regression, tor-ci, tor-test,        |  Actual Points:
  040-must                                       |
Parent ID:                                       |         Points:
 Reviewer:  mikeperry                            |        Sponsor:
-------------------------------------------------+-------------------------

Comment (by asn):

 Replying to [comment:13 riastradh]:
 > Replying to [comment:11 asn]:
 > > The first commit (a64ccf151f) fixes the probability distribution
 parameters that Riastradh mentioned with bold in comment:7. The second
 commit (f708055e9f) silences float-divide-by-zero as suggested by #29528.
 >
 > Cool.  One suggestion for a change and one comment:
 >
 > - It might be helpful if you put a comment on each line describing what
 the name and purpose of the parameter is, like `/* k, shape parameter */`,
 because I can never remember which one goes first and which one goes last.
 >

 Agreed! I pushed a fixup that tries to do this:
 https://github.com/torproject/tor/pull/722/commits/5b616a4831979bf25ad3429b0673c00f2757dd25

 > - This is the kind of code where the `struct weibull dist = {
 WEIBULL(dist), .k = ..., .lambda = ... }` can be much more legible than
 `struct circpad_distribution dist = { .type = CIRCPAD_DIST_WEIBULL,
 .param1 = ..., .param2 = ... }`.  (Obviously changing the code to work
 like that here is more involved than would be warranted, even if you
 wanted it, for this particular issue, of course.)

 Agreed. Let's not try to do this in this bugfix ticket but we can probably
 do it in 041 as part of #28636:
 https://trac.torproject.org/projects/tor/ticket/28636#comment:13

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


More information about the tor-bugs mailing list