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

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
rG9246b3090cbc: fork: Suspend other threads if both RFPROC and RFMEM are not set
Branches
Unknown
Tags
Unknown