]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
posix timers: Check for overflow when converting to ns
authorMark Johnston <markj@FreeBSD.org>
Thu, 13 May 2021 12:33:37 +0000 (08:33 -0400)
committerMark Johnston <markj@FreeBSD.org>
Thu, 13 May 2021 12:34:03 +0000 (08:34 -0400)
commit8b3c4231abf0ef6ac79655e463d0ef98ad84cd51
tree7a676abdcba1130d38536dcd67c41971a55eacc4
parent9246b3090cbc82c54350391601b9acef2aa9a625
posix timers: Check for overflow when converting to ns

Disallow a time or timer period value when the conversion to nanoseconds
would overflow.  Otherwise it is possible to trigger a divison by zero
in realtime_expire_l(), where we compute the number of overruns by
dividing by the timer interval.

Fixes: 7995dae9 ("posix timers: Improve the overrun calculation")
Reported by: syzbot+5ab360bd3d3e3c5a6e0e@syzkaller.appspotmail.com
Reported by: syzbot+157b74ff493140d86eac@syzkaller.appspotmail.com
Reviewed by: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30233
sys/kern/kern_time.c