Page MenuHomeFreeBSD

bhyve: do not hold CRB mutex when executing TPM commands
ClosedPublic

Authored by corvink on Jun 23 2023, 9:34 AM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 3 2024, 7:14 PM
Unknown Object (File)
Oct 3 2024, 7:14 PM
Unknown Object (File)
Oct 3 2024, 11:01 AM
Unknown Object (File)
Sep 28 2024, 4:27 AM
Unknown Object (File)
Sep 27 2024, 12:06 PM
Unknown Object (File)
Sep 27 2024, 9:01 AM
Unknown Object (File)
Sep 5 2024, 8:26 PM
Unknown Object (File)
Sep 1 2024, 2:43 PM
Subscribers

Details

Summary

TPM commands can take up to several seconds to execute. If we hold the
CRB mutex while executing the command, MMIO accesses could be blocked
for a long time. Therefore, just copy all required values and work on
the copied values.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 52390
Build 49281: arc lint + arc unit

Event Timeline

usr.sbin/bhyve/tpm_intf_crb.c
226

Now it's possible for the thread to miss wakeups. Suppose the thread is processing a command, and tpm_crb_deinit() is called while the lock is dropped. The thread will reacquire the lock and go to sleep without checking crb->closing.

  • fix race on thread signalling
This revision is now accepted and ready to land.Jul 4 2023, 3:45 PM