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
Unknown Object (File)
Wed, Dec 3, 5:51 AM
Unknown Object (File)
Thu, Nov 27, 4:16 AM
Unknown Object (File)
Sun, Nov 23, 12:51 PM
Unknown Object (File)
Nov 21 2025, 1:44 PM
Unknown Object (File)
Nov 16 2025, 9:11 PM
Unknown Object (File)
Nov 16 2025, 11:47 AM
Unknown Object (File)
Nov 13 2025, 1:02 AM
Unknown Object (File)
Nov 8 2025, 8:23 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 Skipped
Unit
Tests Skipped

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.Oct 3 2025, 4:32 PM
This revision is now accepted and ready to land.Oct 4 2025, 11:57 AM