Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Feb 2019 20:58:13 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 76972] [kernel] [patch] 64-bit integer overflow computing user cpu time in calcru() in kern_resource.c
Message-ID:  <bug-76972-227-TNu10j3Je7@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-76972-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-76972-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D76972

Conrad Meyer <cem@freebsd.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|bugs@FreeBSD.org            |cem@freebsd.org
           Keywords|                            |patch, patch-ready
             Status|Open                        |In Progress
                 CC|                            |cem@freebsd.org

--- Comment #6 from Conrad Meyer <cem@freebsd.org> ---
I wrote a small program to empirically validate the proposed patch under so=
me
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 <=3D 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 obse=
rve
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 t=
he
bounds given above.

I believe it fixes the issue and can be committed.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-76972-227-TNu10j3Je7>