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)
Mar 9 2024, 7:43 PM
Unknown Object (File)
Mar 9 2024, 7:43 PM
Unknown Object (File)
Mar 6 2024, 3:33 AM
Unknown Object (File)
Mar 6 2024, 3:31 AM
Unknown Object (File)
Mar 5 2024, 5:26 AM
Unknown Object (File)
Dec 20 2023, 8:06 AM
Unknown Object (File)
Dec 10 2023, 10:54 PM
Unknown Object (File)
Oct 10 2023, 6:52 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 Not Applicable
Unit
Tests Not Applicable

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