reset tcti_common->state in tcti_device_receive when return TSS2_TCTI… #2929
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
when IO device has something wrong, It needs to reset tcti_common->state to TCTI_STATE_TRANSMIT. Or when another message was sent to tcti_device(E.g. tpm2_getcap) it will fail in tcti_common_transmit_checks.
the tpm2-tss version is 3.1.0 and the tpm2-abrmd version is 2.6.1
Here is the Error log:(It looks like read failure leads to this bug. Then other command fails(E.g. tpm2_getcap)).
tpm2-abrmd[15049]: ERROR:tcti:src/tss2-tcti/tcti-device.c:262:tcti_device_receive() Failed to read response from fd 5, got errno 62: Timer expired
tpm2-abrmd[15049]: [src/tcti.c:152] Tss2_Tcti_Receive failed: tcti:IO failure (RC: 0xa000a)
tpm2-abrmd[15049]: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
tpm2-abrmd[15049]: save_session: TCTI failed while saving session context from SessionEntry, got RC 0xa000a
tpm2-abrmd[15049]: [src/tcti.c:134] Tss2_Tcti_Transmit failed: tcti:Function called in the wrong order (RC: 0xa0007)
tpm2-abrmd[15049]: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
tpm2-abrmd[15049]: save_session: TCTI failed while saving session context from SessionEntry, got RC 0xa0007
tpm2-abrmd[15049]: save_session_callback: failed to save SessionEntry, flushing
tpm2-abrmd[15049]: [src/tpm2.c:577] Tss2_Sys_FlushContext failed: tcti:Function called in the wrong order (RC: 0xa0007)
tpm2-abrmd[15049]: flush_session: failed to flush session context with handle 0x3000000: 0xa0007
tpm2-abrmd[15049]: [src/tpm2.c:529] Tss2_Sys_ContextLoad failed: tcti:Function called in the wrong order (RC: 0xa0007)
tpm2-abrmd[15049]: Failed to load context: 0xa0007
tpm2-abrmd[15049]: [src/tcti.c:134] Tss2_Tcti_Transmit failed: tcti:Function called in the wrong order (RC: 0xa0007)
tpm2-abrmd[15049]: [src/tcti.c:134] Tss2_Tcti_Transmit failed: tcti:Function called in the wrong order (RC: 0xa0007)