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
F106770907: D30069.diff
Sun, Jan 5, 4:05 AM
Unknown Object (File)
Fri, Jan 3, 1:04 PM
Unknown Object (File)
Nov 26 2024, 6:06 PM
Unknown Object (File)
Nov 7 2024, 4:39 PM
Unknown Object (File)
Nov 7 2024, 4:35 PM
Unknown Object (File)
Nov 7 2024, 2:42 PM
Unknown Object (File)
Oct 24 2024, 4:17 PM
Unknown Object (File)
Oct 18 2024, 5:36 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