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)
Apr 7 2024, 8:43 AM
Unknown Object (File)
Apr 5 2024, 7:04 PM
Unknown Object (File)
Mar 29 2024, 4:11 PM
Unknown Object (File)
Jan 13 2024, 11:47 AM
Unknown Object (File)
Dec 23 2023, 10:55 PM
Unknown Object (File)
Dec 20 2023, 3:25 AM
Unknown Object (File)
Dec 12 2023, 6:49 PM
Unknown Object (File)
Nov 27 2023, 7:11 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.