You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm using older version of WolfTPM but see this part of code is same in newest version.
What my program does is intense usage of TPM2_GetRandom from few threads in parallel, for couple of minutes.
Observation is that in some cases /dev/tpm0 cannot be opened with errno=Success that caused then cascade of errno=Device or resource busy.
As from Linux man for open(0 can be seen that open() valid return value is nonnegative integer, thus 0 is valid value.
On success, open(), openat(), and creat() return the new file
descriptor (a nonnegative integer). On error, -1 is returned and
[errno](https://man7.org/linux/man-pages/man3/errno.3.html) is set to indicate the error.
Suggest to change a condition fro > to >= to:
fd=open(TPM2_LINUX_DEV, O_RDWR | O_NONBLOCK);
if (fd >= 0) {
/* Send the TPM command */
After fix, I see no more issues with my code using wolfTPM library.
The text was updated successfully, but these errors were encountered:
Hi,
I'm using older version of WolfTPM but see this part of code is same in newest version.
What my program does is intense usage of TPM2_GetRandom from few threads in parallel, for couple of minutes.
Observation is that in some cases /dev/tpm0 cannot be opened with
errno=Success
that caused then cascade oferrno=Device or resource busy
.As from Linux man for open(0 can be seen that open() valid return value is nonnegative integer, thus 0 is valid value.
Suggest to change a condition fro
>
to>=
to:After fix, I see no more issues with my code using wolfTPM library.
The text was updated successfully, but these errors were encountered: