Open dgarrett-microsoft opened 2 years ago
We need an in-kernel tee-supplicant, for RPMB access at least. See also discussion about StandAloneMM support (https://lkml.kernel.org/lkml/20230622085112.1521-3-masahisa.kojima@linaro.org/T/#m9552b4a9a88a20753bf068cf21ced84f6cbe880f)
I've found that the fTPM TA crashes consistently during Linux powerdown/reboot. The issue seems to be that the Linux TPM driver issues TPM2_Shutdown to attached TPMs during powerdown. The fTPM's implementation of TPM2_Shutdown makes some writes to storage, which fail because tee-supplicant is already stopped as a result of the powerdown.
I was able to work around this with the following systemd unit that unloads the fTPM Linux driver before tee-supplicant is stopped:
But as far as I can tell, this is a bug. Does anyone have any thoughts on where this should be fixed? Or is my systemd unit likely the best solution here to get the appropriate order of operations?