summaryrefslogtreecommitdiffstats
path: root/contrib/diff/lib/unlocked-io.h
diff options
context:
space:
mode:
authordavide <davide@FreeBSD.org>2013-09-26 10:06:50 +0000
committerdavide <davide@FreeBSD.org>2013-09-26 10:06:50 +0000
commit5c31dfc658f44c1e71a209ff72ec107a6e65d5bc (patch)
treeb8c9ad7d1762c4af521a8ed6f259332fff3c2211 /contrib/diff/lib/unlocked-io.h
parent9439877e985eb4df023ef814794a47111ca4d892 (diff)
downloadFreeBSD-src-5c31dfc658f44c1e71a209ff72ec107a6e65d5bc.zip
FreeBSD-src-5c31dfc658f44c1e71a209ff72ec107a6e65d5bc.tar.gz
Make the callout arithmetic more robust adding checks for overflow.
Without these, if the timeout value passed is "large enough", the value of the sum of it and other factors (e.g. current time as returned by sbinuptime() or 'precision' argument) might result in a negative number. This negative number is then passed to eventtimers(4), which causes et_start() routine to load et_min_period into eventtimer, making the CPU where the thread is stuck forever in timer interrupt handler routine. This is now avoided rounding to INT64_MAX the timeout period in case of overflow. Reported by: kib, pho Discussed with: kib, mav Tested by: pho (stress2 suite, kevent7.sh scenario) Approved by: re (kib)
Diffstat (limited to 'contrib/diff/lib/unlocked-io.h')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud