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
Hi,
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):
https://mailman.powerdns.com/pipermail/pdns-users/2019-January/025739.html
Bert Hubert of PowerDNS led me to
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227689
and it definitely looks like this is the bug causing the disappearing
graphs that I see. In
https://mailman.powerdns.com/pipermail/pdns-users/2019-January/025742.html
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
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227689
to
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=76972
which has an attachment (kern_resource.c.patch.txt) at
https://bz-attachments.freebsd.org/attachment.cgi?id=50537
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
https://svnweb.freebsd.org/base/head/sys/kern/kern_resource.c?view=markup
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
person.
- 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