Page MenuHomeFreeBSD

filt_timerexpire: do not iterate over the interval
ClosedPublic

Authored by kib on May 1 2021, 3:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 24, 4:17 PM
Unknown Object (File)
Fri, Oct 18, 5:36 AM
Unknown Object (File)
Oct 4 2024, 9:11 PM
Unknown Object (File)
Oct 4 2024, 5:53 PM
Unknown Object (File)
Oct 4 2024, 8:58 AM
Unknown Object (File)
Oct 2 2024, 3:05 PM
Unknown Object (File)
Oct 2 2024, 6:25 AM
Unknown Object (File)
Oct 2 2024, 6:11 AM
Subscribers

Details

Summary

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 by: pho

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib requested review of this revision.May 1 2021, 3:08 PM
kib created this revision.
sys/kern/kern_event.c
742

This case represents the timer firing early - why do we adjust anything here?

kib marked an inline comment as done.May 3 2021, 3:37 PM
kib added inline comments.
sys/kern/kern_event.c
742

Because it is activating knote, which was done before too.

This revision is now accepted and ready to land.May 3 2021, 3:59 PM
kib marked an inline comment as done.

Skip activation for the case now <= kc_next, and do not increment data.

This revision now requires review to proceed.May 3 2021, 4:03 PM
This revision is now accepted and ready to land.May 3 2021, 4:16 PM