]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
kqueue: don't arbitrarily restrict long-past values for NOTE_ABSTIME
authorKyle Evans <kevans@FreeBSD.org>
Wed, 29 Sep 2021 19:55:59 +0000 (14:55 -0500)
committerKyle Evans <kevans@FreeBSD.org>
Wed, 6 Oct 2021 07:07:07 +0000 (02:07 -0500)
commitf9765c9c1acbd42c074841c96c0e84d32ad1b1a1
treeaa1b659f26eb9338ccea97088be4a48562c95fd9
parent53939dd23fdbe987f829f0f9549bf3f59158a923
kqueue: don't arbitrarily restrict long-past values for NOTE_ABSTIME

NOTE_ABSTIME values are converted to values relative to boottime in
filt_timervalidate(), and negative values are currently rejected.  We
don't reject times in the past in general, so clamp this up to 0 as
needed such that the timer fires immediately rather than imposing what
looks like an arbitrary restriction.

Another possible scenario is that the system clock had to be adjusted
by ~minutes or ~hours and we have less than that in terms of uptime,
making a reasonable short-timeout suddenly invalid. Firing it is still
a valid choice in this scenario so that applications can at least
expect a consistent behavior.

(cherry picked from commit 9c999a259f00b35f0467acd351fea9157ed7e1e4)
(cherry picked from commit 2f4dbe279f6b5eb87ec493d96f6943ffdb603ba0)
sys/kern/kern_event.c
tests/sys/kqueue/libkqueue/timer.c