tpm2-software/tpm2-tss

JSON file suddenly empty

Closed this issue · 8 comments

One of the json files, which is used for TPM NVRAM index data, suddenly becomes empty.

Has someone else encountered such a beast?
I am attaching the log file.

tss2_logfile.txt

Some additional info:
It seems like this issue coincided with the SATA flash drive memory running out (had left the logfile writing option ON for some time and the tss2_logfile.txt had become 4GB+).
I think the two are not interconnected, because this issue (the empty json file) happened few times in the near past, and if memory serves me well, the out-of-hard-drive-space problem hadnt been encountered at the same time before that.

@JuergenReppSIT do you have any insight on the matter?

@JordanLBogdanov Did the problem also occur when enough space was available on the hard drive?

@JuergenReppSIT it has not occurred since I posted this issue. But from what I remember it has happened with even enough hard drive space available. I will keep an eye out for that.
I would be thankful if you could spare a look at the logfile to see if there is something suspicious.

@JordanLBogdanov If not enough space is available the reason might be that an unnecessary write to keystore is executed in your case. This should be fixed with:
#2883
But in other cases where the write is necessary it still will be a problem. If enough space is available I have no explanation.

Thank you.

Reopening the issue for a short discussion.

@JuergenReppSIT regarding the earlier issue with the suddenly-empty json file, do you know what would be the result of powering down the PC, during a writing operation to the TPM chip's nvram.

Can you please test this, when you have the time.
Thank you so much in advance.

@JordanLBogdanov I did run a test where I wrote a big file to nvram and did power down the RaspberryPi during the write operation. Afterwards I checked the content of the NV ram and saw that only half of the data was written to nvram. The FAPI nv object still could be used and the JSON file in the keystore was OK.

@JuergenReppSIT thank you a lot for your effort.
We will continue to investigate this behavior. Have a good workday and weekend.