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
F147433315: D12276.id32804.diff
Tue, Mar 10, 11:18 PM
Unknown Object (File)
Mon, Mar 2, 12:01 AM
Unknown Object (File)
Sun, Mar 1, 10:53 AM
Unknown Object (File)
Fri, Feb 27, 9:42 PM
Unknown Object (File)
Fri, Feb 27, 12:57 PM
Unknown Object (File)
Fri, Feb 27, 6:07 AM
Unknown Object (File)
Thu, Feb 26, 9:21 PM
Unknown Object (File)
Sat, Feb 21, 5:18 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