Page MenuHomeFreeBSD

x86: Close race condition on MCA task queues at startup
ClosedPublic

Authored by jtl on Sep 8 2017, 3:20 PM.
Tags
None
Referenced Files
F132004769: D12276.diff
Sun, Oct 12, 9:20 PM
Unknown Object (File)
Fri, Oct 10, 9:43 PM
Unknown Object (File)
Thu, Oct 9, 5:44 PM
Unknown Object (File)
Thu, Oct 9, 5:44 PM
Unknown Object (File)
Thu, Oct 9, 5:44 PM
Unknown Object (File)
Thu, Oct 9, 5:44 PM
Unknown Object (File)
Thu, Oct 9, 3:39 PM
Unknown Object (File)
Aug 18 2025, 6:31 PM
Subscribers

Details

Summary

Currently, the CMCI handler checks the cold variable to determine whether it can schedule a task. The task queue is setup as part of the mca_startup() function, which is run well after the configure_final() function sets the cold variable to 0. Therefore, if an MCA arrives in the window between configure_final() and mca_startup() running, the code could try to schedule a task on an unintitalized task queue.

Close the race by specifically checking whether the mca_startup() function has run.

Diff Detail

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

Event Timeline

Alternatively we could check some variable that this sysinit sets (like mca_tq) instead of cold, but this is fine.

This revision is now accepted and ready to land.Sep 8 2017, 6:20 PM
jtl retitled this revision from Make sure we set up the MCA task queue before cold is changed to 0 to x86: Close race condition on MCA task queues at startup.
jtl edited the summary of this revision. (Show Details)
jtl added reviewers: markj, glebius.
jtl changed the repository for this revision from rS FreeBSD src repository - subversion to rG FreeBSD src repository.

Updating the diff to account for 8 years of bit rot.

This revision now requires review to proceed.Fri, Oct 3, 4:32 PM
This revision is now accepted and ready to land.Sat, Oct 4, 11:57 AM