https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=76972

Conrad Meyer <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|[email protected]            |[email protected]
           Keywords|                            |patch, patch-ready
             Status|Open                        |In Progress
                 CC|                            |[email protected]

--- Comment #6 from Conrad Meyer <[email protected]> ---
I wrote a small program to empirically validate the proposed patch under some
assumptions.

"tu" (total time in microseconds) is drawn from [1, ~1000 years] (0 is
uninteresting).

"tt" (total time in ticks) is tu / 1000.

"ut" or "st" is <= tt.

With randomly drawn tu and ut/st in the given ranges (not precisely uniform due
to lack of arc4random_uniform64, but close to uniform distribution), I observe
overflow in something like 99.999976% of the input range with the current
algorithm and 0% (absolutely zero) instances of overflow with the proposed
patch.  Also, the result is correct, and not truncated, in all cases with the
bounds given above.

I believe it fixes the issue and can be committed.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to