Page MenuHomeFreeBSD

fix integer overflow bugs in *stosbt
ClosedPublic

Authored by imp on Apr 6 2022, 2:10 AM.
Tags
None
Referenced Files
F102910421: D34790.diff
Mon, Nov 18, 3:35 PM
Unknown Object (File)
Fri, Nov 1, 6:10 AM
Unknown Object (File)
Oct 7 2024, 8:05 AM
Unknown Object (File)
Oct 7 2024, 8:04 AM
Unknown Object (File)
Oct 7 2024, 8:04 AM
Unknown Object (File)
Oct 7 2024, 7:33 AM
Unknown Object (File)
Oct 5 2024, 4:23 AM
Unknown Object (File)
Sep 28 2024, 7:53 AM
Subscribers
None

Details

Summary

68f57679d660 Fixed another class of integer overflows, but introduced
a boundary condition for ~2-4s in ns conversion, ~2000-~4000s in us
conversions and ~2,000,000-~4,000,000s in ms conversions. This was
because we bogusly used SBT_1S for the notion of 1 second, instead of
the appropriate power of 10. To fix, just use the appropriate power of

This caused some sleeps in ZFS to be on the order of an hour.

MFC: 1 day
PR: 263073

Sponsored by: Netflix

Test Plan

Alan is writing ATF tests for these functions
The inverse us and ms (but not ns) functions have issues as well, but the time scales are much larger and will be corrected later.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 45014
Build 41902: arc lint + arc unit

Event Timeline

imp requested review of this revision.Apr 6 2022, 2:10 AM
imp created this revision.
imp added a reviewer: asomers.

LGTM except for the commit message. The problems with ustosbt are in the range of 2s - 4295s. For nstosbt it's 2s - 4s. And for mstosbt it's 2s - 4294967s.

This revision is now accepted and ready to land.Apr 6 2022, 2:34 AM

LGTM except for the commit message. The problems with ustosbt are in the range of 2s - 4295s. For nstosbt it's 2s - 4s. And for mstosbt it's 2s - 4294967s.

Ah, quite right. I improperly generalized....

This revision was automatically updated to reflect the committed changes.