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)
Sat, Nov 8, 8:23 PM
Unknown Object (File)
Fri, Nov 7, 9:22 AM
Unknown Object (File)
Sun, Nov 2, 8:27 PM
Unknown Object (File)
Fri, Oct 31, 8:24 AM
Unknown Object (File)
Thu, Oct 30, 10:18 AM
Unknown Object (File)
Wed, Oct 29, 2:05 AM
Unknown Object (File)
Wed, Oct 29, 1:22 AM
Unknown Object (File)
Tue, Oct 28, 10:17 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