]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
filt_timerexpire: do not iterate over the interval
authorKonstantin Belousov <kib@FreeBSD.org>
Wed, 28 Apr 2021 16:28:49 +0000 (19:28 +0300)
committerKonstantin Belousov <kib@FreeBSD.org>
Mon, 3 May 2021 16:49:54 +0000 (19:49 +0300)
commit7cb40543e96451092d5bc6bb3d96ebee364327e0
treeea681a4ed4c9fc4b9908b9a7295cd75a1c28e941
parentb87a5b266d88b658ac0afa10f5f82adc21f4382a
filt_timerexpire: do not iterate over the interval

User-supplied data might make this loop too time-consuming. Divide
directly, and handle both the possibility that we were woken up earlier,
and arithmetic overflows/underflows from the calculation.

Reported and tested by: pho (previous version)
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D30069
sys/kern/kern_event.c