Page MenuHomeFreeBSD

clockcalib: Fix an overflow bug
ClosedPublic

Authored by markj on Jan 19 2022, 10:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 27, 11:03 AM
Unknown Object (File)
Tue, Oct 22, 8:40 PM
Unknown Object (File)
Oct 7 2024, 2:32 PM
Unknown Object (File)
Oct 7 2024, 2:32 PM
Unknown Object (File)
Oct 7 2024, 2:32 PM
Unknown Object (File)
Oct 7 2024, 2:02 PM
Unknown Object (File)
Oct 2 2024, 7:49 AM
Unknown Object (File)
Oct 2 2024, 4:35 AM

Details

Summary

tc_counter_mask is an unsigned int and in the TSC timecounter is equal
to UINT_MAX, so the addition tc->tc_counter_mask + 1 can overflow to 0,
resulting in a hang during boot.

Fixes: c2705ceaeb09 ("x86: Speed up clock calibration")

Diff Detail

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

Event Timeline

Oops! Thanks for catching this.

This revision is now accepted and ready to land.Jan 20 2022, 5:49 AM
This revision was automatically updated to reflect the committed changes.

@markj could it be possible to backport this fix to the FreeBSD 13.1 while there is still time?
My FreeBSD 13.1 VM (virtualbox) freezes randomly during boot and this commit fixes it.

@markj could it be possible to backport this fix to the FreeBSD 13.1 while there is still time?
My FreeBSD 13.1 VM (virtualbox) freezes randomly during boot and this commit fixes it.

Oh. Ugh. I didn't realize that this was never backported. :(

And of course RC6 is already building. Ok, I'll see what I can do. Thanks for the report.