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)
Mon, Mar 17, 7:31 AM
Unknown Object (File)
Sat, Mar 15, 1:42 PM
Unknown Object (File)
Sat, Mar 15, 4:04 AM
Unknown Object (File)
Sun, Mar 9, 1:57 PM
Unknown Object (File)
Mon, Feb 24, 10:50 AM
Unknown Object (File)
Thu, Feb 20, 6:47 AM
Unknown Object (File)
Jan 24 2025, 5:26 PM
Unknown Object (File)
Jan 24 2025, 3:52 PM
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