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
F170818597: D30069.id.diff
Sun, Sep 6, 8:04 PM
F170767906: D30069.id.diff
Sun, Sep 6, 12:46 PM
F170742561: D30069.id88559.diff
Sun, Sep 6, 8:56 AM
Unknown Object (File)
Sun, Sep 6, 3:52 AM
Unknown Object (File)
Sun, Sep 6, 2:12 AM
Unknown Object (File)
Sat, Sep 5, 11:39 PM
Unknown Object (File)
Sat, Sep 5, 5:01 PM
Unknown Object (File)
Sat, Sep 5, 11:49 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 Skipped
Unit
Tests Skipped

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