HomeFreeBSD

posix timers: Check for overflow when converting to ns

Description

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
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30233

(cherry picked from commit 8b3c4231abf0ef6ac79655e463d0ef98ad84cd51)

Details

Provenance
markjAuthored on May 13 2021, 12:33 PM
Reviewer
kib
Differential Revision
D30233: posix timers: Check for overflow when converting to ns
Parents
rGb98b323813f0: sort: Hook NetBSD tests up to the build
Branches
Unknown
Tags
Unknown