64-bit integer overflow computing user cpu time in calcru() in kern_resource.c

sthaug at nethelp.no sthaug at nethelp.no
Mon Feb 4 07:37:11 UTC 2019


We use FreeBSD 11.2-STABLE for 5 recursive name servers, with PowerDNS
recursor as the actual name server software.

I recently complained on the pdns-users list that some graphs based
on information from the name server process stopped working after a
while (typically a week or less):


Bert Hubert of PowerDNS led me to


and it definitely looks like this is the bug causing the disappearing
graphs that I see. In


you can see the effect on the getrusage() call - in short, the values
simply stop incrementing after a while.

I fixed the problem by following the link from




which has an attachment (kern_resource.c.patch.txt) at


After adding this patch and rebooting, the problem has not recoccurred
in nearly two weeks. I'm reasonably sure that the problem really has
been fixed.

I checked the code at the same place in HEAD, from


and the bug appears to still be present in HEAD.

So, I'd love it if somebody could

- Update bugs 76972 and 227689 to note that this affects more than one

- Fix this in HEAD and hopefully also MFC to 11.2-STABLE.

Steinar Haug, Nethelp consulting, sthaug at nethelp.no

More information about the freebsd-stable mailing list