tpm2-software / tpm2-tools

The source repository for the Trusted Platform Module (TPM2.0) tools
https://tpm2-software.github.io
708 stars 377 forks source link

ERROR:tcti:src/tss2-tcti/tcti-device.c:286:tcti_device_receive() Failed to read response from fd 3, got errno 62: Timer expired #3416

Closed luvkrai closed 1 month ago

luvkrai commented 1 month ago

All of my tpm2-tools CLI commands suddenly stopped working on an appliance with TPM2.0 Hardware.

# export TSS2_LOG=all+DEBUG
# tpm2_selftest
debug:tcti:src/tss2-tcti/tctildr-dl.c:293:tctildr_get_tcti() name: "(null)", conf: "(null)" 
debug:tcti:src/tss2-tcti/tctildr-dl.c:240:tctildr_get_default() Attempting to connect using standard TCTI: Access libtss2-tcti-default.so 
debug:tcti:src/tss2-tcti/tctildr-dl.c:88:handle_from_name() Could not load TCTI file: "libtss2-tcti-default.so": libtss2-tcti-default.so: cannot open shared object file: No such file or directory 
debug:tcti:src/tss2-tcti/tctildr-dl.c:103:handle_from_name() Could not load TCTI file "libtss2-tcti-default.so": libtss2-tcti-libtss2-tcti-default.so.so.0: cannot open shared object file: No such file or directory 
debug:tcti:src/tss2-tcti/tctildr-dl.c:116:handle_from_name() Failed to load TCTI for name "libtss2-tcti-default.so": libtss2-tcti-libtss2-tcti-default.so.so: cannot open shared object file: No such file or directory 
debug:tcti:src/tss2-tcti/tctildr-dl.c:245:tctildr_get_default() Failed to load standard TCTI number 0 
debug:tcti:src/tss2-tcti/tctildr-dl.c:240:tctildr_get_default() Attempting to connect using standard TCTI: Access libtss2-tcti-tabrmd.so 
debug:tcti:src/tss2-tcti/tctildr-dl.c:88:handle_from_name() Could not load TCTI file: "libtss2-tcti-tabrmd.so.0": libtss2-tcti-tabrmd.so.0: cannot open shared object file: No such file or directory 
debug:tcti:src/tss2-tcti/tctildr-dl.c:103:handle_from_name() Could not load TCTI file "libtss2-tcti-tabrmd.so.0": libtss2-tcti-libtss2-tcti-tabrmd.so.0.so.0: cannot open shared object file: No such file or directory 
debug:tcti:src/tss2-tcti/tctildr-dl.c:116:handle_from_name() Failed to load TCTI for name "libtss2-tcti-tabrmd.so.0": libtss2-tcti-libtss2-tcti-tabrmd.so.0.so: cannot open shared object file: No such file or directory 
debug:tcti:src/tss2-tcti/tctildr-dl.c:245:tctildr_get_default() Failed to load standard TCTI number 1 
debug:tcti:src/tss2-tcti/tctildr-dl.c:240:tctildr_get_default() Attempting to connect using standard TCTI: Access libtss2-tcti-device.s0 with /dev/tpmrm0 
debug:tcti:src/tss2-tcti/tctildr.c:68:tcti_from_init() Initialized TCTI for config: /dev/tpmrm0 
debug:tcti:src/tss2-tcti/tctildr.c:96:tcti_from_info() Initialized TCTI named: tcti-device 
debug:tcti:src/tss2-tcti/tctildr-dl.c:158:tcti_from_file() Initialized TCTI file: libtss2-tcti-device.so.0 
debug:marshal:src/tss2-mu/base-types.c:179:Tss2_MU_TPM2_ST_Marshal() Marshalling TPM2_ST from 0x7ffca43e5e7c to buffer 0x5602e656b3e0 at index 0x0 
debug:marshal:src/tss2-mu/base-types.c:179:Tss2_MU_TPM2_ST_Marshal() offset parameter non-NULL, updated to 2 
debug:marshal:src/tss2-mu/base-types.c:169:Tss2_MU_UINT8_Marshal() Marshalling UINT8 from 0x7ffca43e5f0c to buffer 0x5602e656b3e0 at index 0xa 
debug:marshal:src/tss2-mu/base-types.c:169:Tss2_MU_UINT8_Marshal() offset parameter non-NULL, updated to 11 
debug:tcti:src/tss2-tcti/tcti-device.c:114:tcti_device_transmit() sending 11 byte command buffer: (size=11): 
        80010000000b0000
        014300 
debug:tcti:src/util/io.c:90:write_all() writing 11 bytes starting at 0x5602e656b3e0 to fd 3 
debug:tcti:src/util/io.c:101:write_all() wrote 11 bytes to fd 3 
ERROR:tcti:src/tss2-tcti/tcti-device.c:286:tcti_device_receive() Failed to read response from fd 3, got errno 62: Timer expired 
ERROR:esys:src/tss2-esys/api/Esys_SelfTest.c:273:Esys_SelfTest_Finish() Received a non-TPM Error 
ERROR:esys:src/tss2-esys/api/Esys_SelfTest.c:95:Esys_SelfTest() Esys Finish ErrorCode (0x000a000a) 
ERROR: Esys_SelfTest(0xA000A) - tcti:IO failure
ERROR: Unable to run tpm2_selftest
tpm2_selftest --tcti=device:/dev/tpm0
debug:tcti:src/tss2-tcti/tctildr.c:130:tctildr_conf_parse() name_conf: "device:/dev/tpm0" 
debug:tcti:src/tss2-tcti/tctildr.c:148:tctildr_conf_parse() TCTI name: "device" 
debug:tcti:src/tss2-tcti/tctildr.c:153:tctildr_conf_parse() TCTI conf: "/dev/tpm0" 
debug:tcti:src/tss2-tcti/tctildr-dl.c:293:tctildr_get_tcti() name: "device", conf: "/dev/tpm0" 
debug:tcti:src/tss2-tcti/tctildr-dl.c:88:handle_from_name() Could not load TCTI file: "device": device: cannot open shared object file: No such file or directory 
debug:tcti:src/tss2-tcti/tctildr.c:68:tcti_from_init() Initialized TCTI for config: /dev/tpm0 
debug:tcti:src/tss2-tcti/tctildr.c:96:tcti_from_info() Initialized TCTI named: tcti-device 
debug:tcti:src/tss2-tcti/tctildr-dl.c:158:tcti_from_file() Initialized TCTI file: device 
debug:marshal:src/tss2-mu/base-types.c:179:Tss2_MU_TPM2_ST_Marshal() Marshalling TPM2_ST from 0x7ffc04bdad0c to buffer 0x56259e5b01b0 at index 0x0 
debug:marshal:src/tss2-mu/base-types.c:179:Tss2_MU_TPM2_ST_Marshal() offset parameter non-NULL, updated to 2 
debug:marshal:src/tss2-mu/base-types.c:169:Tss2_MU_UINT8_Marshal() Marshalling UINT8 from 0x7ffc04bdad9c to buffer 0x56259e5b01b0 at index 0xa 
debug:marshal:src/tss2-mu/base-types.c:169:Tss2_MU_UINT8_Marshal() offset parameter non-NULL, updated to 11 
debug:tcti:src/tss2-tcti/tcti-device.c:114:tcti_device_transmit() sending 11 byte command buffer: (size=11): 
        80010000000b0000
        014300 
debug:tcti:src/util/io.c:90:write_all() writing 11 bytes starting at 0x56259e5b01b0 to fd 3 
debug:tcti:src/util/io.c:101:write_all() wrote 11 bytes to fd 3 
ERROR:tcti:src/tss2-tcti/tcti-device.c:286:tcti_device_receive() Failed to read response from fd 3, got errno 62: Timer expired 
ERROR:esys:src/tss2-esys/api/Esys_SelfTest.c:273:Esys_SelfTest_Finish() Received a non-TPM Error 
ERROR:esys:src/tss2-esys/api/Esys_SelfTest.c:95:Esys_SelfTest() Esys Finish ErrorCode (0x000a000a) 
ERROR: Esys_SelfTest(0xA000A) - tcti:IO failure
ERROR: Unable to run tpm2_selftest
ls -l /dev/tpm*
crw------- 1 root root  10,   224 Jan 23 16:33 /dev/tpm0
crw------- 1 root root 253, 65536 Jan 23 16:33 /dev/tpmrm0
# tpm2_getcap properties-fixed --tcti=device:/dev/tpm0
debug:tcti:src/tss2-tcti/tctildr.c:130:tctildr_conf_parse() name_conf: "device:/dev/tpm0" 
debug:tcti:src/tss2-tcti/tctildr.c:148:tctildr_conf_parse() TCTI name: "device" 
debug:tcti:src/tss2-tcti/tctildr.c:153:tctildr_conf_parse() TCTI conf: "/dev/tpm0" 
debug:tcti:src/tss2-tcti/tctildr-dl.c:293:tctildr_get_tcti() name: "device", conf: "/dev/tpm0" 
debug:tcti:src/tss2-tcti/tctildr-dl.c:88:handle_from_name() Could not load TCTI file: "device": device: cannot open shared object file: No such file or directory 
debug:tcti:src/tss2-tcti/tctildr.c:68:tcti_from_init() Initialized TCTI for config: /dev/tpm0 
debug:tcti:src/tss2-tcti/tctildr.c:96:tcti_from_info() Initialized TCTI named: tcti-device 
debug:tcti:src/tss2-tcti/tctildr-dl.c:158:tcti_from_file() Initialized TCTI file: device 
debug:marshal:src/tss2-mu/base-types.c:179:Tss2_MU_TPM2_ST_Marshal() Marshalling TPM2_ST from 0x7ffc5390ec6c to buffer 0x55d52850a1b0 at index 0x0 
debug:marshal:src/tss2-mu/base-types.c:179:Tss2_MU_TPM2_ST_Marshal() offset parameter non-NULL, updated to 2 
debug:marshal:src/tss2-mu/base-types.c:173:Tss2_MU_UINT32_Marshal() Marshalling UINT32 from 0x7ffc5390ecfc to buffer 0x55d52850a1b0 at index 0xa 
debug:marshal:src/tss2-mu/base-types.c:173:Tss2_MU_UINT32_Marshal() offset parameter non-NULL, updated to 14 
debug:marshal:src/tss2-mu/base-types.c:173:Tss2_MU_UINT32_Marshal() Marshalling UINT32 from 0x7ffc5390ecfc to buffer 0x55d52850a1b0 at index 0xe 
debug:marshal:src/tss2-mu/base-types.c:173:Tss2_MU_UINT32_Marshal() offset parameter non-NULL, updated to 18 
debug:marshal:src/tss2-mu/base-types.c:173:Tss2_MU_UINT32_Marshal() Marshalling UINT32 from 0x7ffc5390ecfc to buffer 0x55d52850a1b0 at index 0x12 
debug:marshal:src/tss2-mu/base-types.c:173:Tss2_MU_UINT32_Marshal() offset parameter non-NULL, updated to 22 
debug:tcti:src/tss2-tcti/tcti-device.c:114:tcti_device_transmit() sending 22 byte command buffer: (size=22): 
        8001000000160000
        017a000000060000
        01000000007f 
debug:tcti:src/util/io.c:90:write_all() writing 22 bytes starting at 0x55d52850a1b0 to fd 3 
debug:tcti:src/util/io.c:101:write_all() wrote 22 bytes to fd 3 
ERROR:tcti:src/tss2-tcti/tcti-device.c:286:tcti_device_receive() Failed to read response from fd 3, got errno 62: Timer expired 
ERROR:esys:src/tss2-esys/api/Esys_GetCapability.c:307:Esys_GetCapability_Finish() Received a non-TPM Error 
ERROR:esys:src/tss2-esys/api/Esys_GetCapability.c:107:Esys_GetCapability() Esys Finish ErrorCode (0x000a000a) 
ERROR: Esys_GetCapability(0xA000A) - tcti:IO failure
ERROR: Unable to run tpm2_getcap
strace tpm2_selftest --tcti=device:/dev/tpm0
execve("/usr/bin/tpm2_selftest", ["tpm2_selftest", "--tcti=device:/dev/tpm0"], 0x7fffea87bcf8 /* 21 vars */) = 0
brk(NULL)                               = 0x55fed98e2000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=33554, ...}) = 0
mmap(NULL, 33554, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f124642a000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/libtss2-esys.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200P\1\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1774440, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1246428000
mmap(NULL, 2863008, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f1245f4f000
mprotect(0x7f1246006000, 2097152, PROT_NONE) = 0
mmap(0x7f1246206000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xb7000) = 0x7f1246206000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/libtss2-mu.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200s\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=446856, ...}) = 0
mmap(NULL, 2373792, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f1245d0b000
mprotect(0x7f1245d4e000, 2093056, PROT_NONE) = 0
mmap(0x7f1245f4d000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x42000) = 0x7f1245f4d000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/libcrypto.so.1.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\220\7\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=2847720, ...}) = 0
mmap(NULL, 4960352, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f124584f000
mprotect(0x7f1245ad7000, 2097152, PROT_NONE) = 0
mmap(0x7f1245cd7000, 192512, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x288000) = 0x7f1245cd7000
mmap(0x7f1245d06000, 16480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f1245d06000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/libtss2-tctildr.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\23\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=59040, ...}) = 0
mmap(NULL, 2126592, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f1245647000
mprotect(0x7f124564e000, 2093056, PROT_NONE) = 0
mmap(0x7f124584d000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7f124584d000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/libtss2-rc.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\22\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=41448, ...}) = 0
mmap(NULL, 2127416, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f124543f000
mprotect(0x7f1245443000, 2097152, PROT_NONE) = 0
mmap(0x7f1245643000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0x7f1245643000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\35\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=2030928, ...}) = 0
mmap(NULL, 4131552, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f124504e000
mprotect(0x7f1245235000, 2097152, PROT_NONE) = 0
mmap(0x7f1245435000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1e7000) = 0x7f1245435000
mmap(0x7f124543b000, 15072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f124543b000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/libtss2-sys.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\254\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=595856, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1246426000
mmap(NULL, 2277792, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f1244e21000
mprotect(0x7f1244e4c000, 2097152, PROT_NONE) = 0
mmap(0x7f124504c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2b000) = 0x7f124504c000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\16\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=14560, ...}) = 0
mmap(NULL, 2109712, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f1244c1d000
mprotect(0x7f1244c20000, 2093056, PROT_NONE) = 0
mmap(0x7f1244e1f000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f1244e1f000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000b\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=144976, ...}) = 0
mmap(NULL, 2221184, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f12449fe000
mprotect(0x7f1244a18000, 2093056, PROT_NONE) = 0
mmap(0x7f1244c17000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19000) = 0x7f1244c17000
mmap(0x7f1244c19000, 13440, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f1244c19000
close(3)                                = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1246424000
arch_prctl(ARCH_SET_FS, 0x7f12464251c0) = 0
mprotect(0x7f1245435000, 16384, PROT_READ) = 0
mprotect(0x7f1244c17000, 4096, PROT_READ) = 0
mprotect(0x7f1244e1f000, 4096, PROT_READ) = 0
mprotect(0x7f1245f4d000, 4096, PROT_READ) = 0
mprotect(0x7f124504c000, 4096, PROT_READ) = 0
mprotect(0x7f1245643000, 4096, PROT_READ) = 0
mprotect(0x7f124584d000, 4096, PROT_READ) = 0
mprotect(0x7f1245cd7000, 180224, PROT_READ) = 0
mprotect(0x7f1246206000, 8192, PROT_READ) = 0
mprotect(0x55fed8926000, 4096, PROT_READ) = 0
mprotect(0x7f1246433000, 4096, PROT_READ) = 0
munmap(0x7f124642a000, 33554)           = 0
set_tid_address(0x7f1246425490)         = 2714
set_robust_list(0x7f12464254a0, 24)     = 0
rt_sigaction(SIGRTMIN, {sa_handler=0x7f1244a03cb0, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x7f1244a10980}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x7f1244a03d50, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f1244a10980}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
brk(NULL)                               = 0x55fed98e2000
brk(0x55fed9903000)                     = 0x55fed9903000
futex(0x7f1244e200c8, FUTEX_WAKE_PRIVATE, 2147483647) = 0
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=33554, ...}) = 0
mmap(NULL, 33554, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f124642a000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/tls/haswell/x86_64/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64-linux-gnu/tls/haswell/x86_64", 0x7fffd7c56380) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/tls/haswell/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64-linux-gnu/tls/haswell", 0x7fffd7c56380) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/tls/x86_64/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64-linux-gnu/tls/x86_64", 0x7fffd7c56380) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/tls/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64-linux-gnu/tls", 0x7fffd7c56380) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/haswell/x86_64/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64-linux-gnu/haswell/x86_64", 0x7fffd7c56380) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/haswell/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64-linux-gnu/haswell", 0x7fffd7c56380) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/x86_64/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64-linux-gnu/x86_64", 0x7fffd7c56380) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64-linux-gnu", {st_mode=S_IFDIR|0755, st_size=12288, ...}) = 0
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/tls/haswell/x86_64/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64-linux-gnu/tls/haswell/x86_64", 0x7fffd7c56380) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/tls/haswell/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64-linux-gnu/tls/haswell", 0x7fffd7c56380) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/tls/x86_64/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64-linux-gnu/tls/x86_64", 0x7fffd7c56380) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/tls/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64-linux-gnu/tls", 0x7fffd7c56380) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/haswell/x86_64/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64-linux-gnu/haswell/x86_64", 0x7fffd7c56380) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/haswell/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64-linux-gnu/haswell", 0x7fffd7c56380) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/x86_64/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64-linux-gnu/x86_64", 0x7fffd7c56380) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64-linux-gnu", {st_mode=S_IFDIR|0755, st_size=20480, ...}) = 0
openat(AT_FDCWD, "/lib/tls/haswell/x86_64/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/tls/haswell/x86_64", 0x7fffd7c56380) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/tls/haswell/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/tls/haswell", 0x7fffd7c56380) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/tls/x86_64/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/tls/x86_64", 0x7fffd7c56380) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/tls/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/tls", 0x7fffd7c56380)        = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/haswell/x86_64/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/haswell/x86_64", 0x7fffd7c56380) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/haswell/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/haswell", 0x7fffd7c56380)    = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/x86_64/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64", 0x7fffd7c56380)     = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
openat(AT_FDCWD, "/usr/lib/tls/haswell/x86_64/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/tls/haswell/x86_64", 0x7fffd7c56380) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/tls/haswell/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/tls/haswell", 0x7fffd7c56380) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/tls/x86_64/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/tls/x86_64", 0x7fffd7c56380) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/tls/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/tls", 0x7fffd7c56380)    = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/haswell/x86_64/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/haswell/x86_64", 0x7fffd7c56380) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/haswell/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/haswell", 0x7fffd7c56380) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/x86_64/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64", 0x7fffd7c56380) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/device", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
munmap(0x7f124642a000, 33554)           = 0
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=33554, ...}) = 0
mmap(NULL, 33554, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f124642a000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/libtss2-tcti-device.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\21\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=51160, ...}) = 0
mmap(NULL, 2118240, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f12447f8000
mprotect(0x7f12447fd000, 2093056, PROT_NONE) = 0
mmap(0x7f12449fc000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0x7f12449fc000
close(3)                                = 0
mprotect(0x7f12449fc000, 4096, PROT_READ) = 0
munmap(0x7f124642a000, 33554)           = 0
openat(AT_FDCWD, "/dev/tpm0", O_RDWR|O_NONBLOCK) = 3
futex(0x7f1245d08898, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7f1245d0888c, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7f1245d08884, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7f1245d05ccc, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7f1245d08744, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7f1245d086dc, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7f1245d086d0, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7f1245d0887c, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7f1245d08838, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7f1245d08830, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7f1245d08990, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7f1245d08870, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7f1245d08868, FUTEX_WAKE_PRIVATE, 2147483647) = 0
write(3, "\200\1\0\0\0\v\0\0\1C\0", 11) = 11
poll([{fd=3, events=POLLIN}], 1, -1)    = 1 ([{fd=3, revents=POLLIN}])
read(3, 0x55fed98e41b0, 4096)           = -1 ETIME (Timer expired)
write(2, "ERROR:tcti:src/tss2-tcti/tcti-de"..., 129ERROR:tcti:src/tss2-tcti/tcti-device.c:286:tcti_device_receive() Failed to read response from fd 3, got errno 62: Timer expired 
) = 129
write(2, "ERROR:esys:src/tss2-esys/api/Esy"..., 98ERROR:esys:src/tss2-esys/api/Esys_SelfTest.c:273:Esys_SelfTest_Finish() Received a non-TPM Error 
) = 98
write(2, "ERROR:esys:src/tss2-esys/api/Esy"..., 100ERROR:esys:src/tss2-esys/api/Esys_SelfTest.c:95:Esys_SelfTest() Esys Finish ErrorCode (0x000a000a) 
) = 100
write(2, "ERROR: ", 7ERROR: )                  = 7
write(2, "Esys_SelfTest(0xA000A) - tcti:IO"..., 40Esys_SelfTest(0xA000A) - tcti:IO failure) = 40
write(2, "\n", 1
)                       = 1
write(2, "ERROR: ", 7ERROR: )                  = 7
write(2, "Unable to run tpm2_selftest", 27Unable to run tpm2_selftest) = 27
write(2, "\n", 1
)                       = 1
close(3)                                = 0
munmap(0x7f12447f8000, 2118240)         = 0
exit_group(1)                           = ?
+++ exited with 1 +++

Kernel logs are also capturing this failure

dmesg | grep -i tpm
[15278450.178957] tpm tpm0: tpm_transmit: tpm_recv: error -5
[15278450.178959] tpm tpm0: tpm2_save_context: failed with a system error -5
[15278450.178996] tpm tpm0: tpm_try_transmit: send(): error -5
[15278450.179031] tpm tpm0: tpm_try_transmit: send(): error -5
[15278450.179032] tpm tpm0: tpm2_commit_space: error -14
[15303901.147923] tpm tpm0: tpm_try_transmit: send(): error -62
[15627684.524865] tpm tpm0: tpm_try_transmit: send(): error -62
[15627786.495098] tpm tpm0: tpm_try_transmit: send(): error -62
[15627841.618088] tpm tpm0: tpm_try_transmit: send(): error -62
[15628363.984849] tpm tpm0: tpm_try_transmit: send(): error -62
[15628870.519936] tpm tpm0: tpm_try_transmit: send(): error -62
[15629214.913962] tpm tpm0: tpm_try_transmit: send(): error -62
[15629228.857679] tpm tpm0: tpm_try_transmit: send(): error -62
[15629260.337140] tpm tpm0: tpm_try_transmit: send(): error -62
[15629735.072824] tpm tpm0: tpm_try_transmit: send(): error -62
[15629788.359907] tpm tpm0: tpm_try_transmit: send(): error -62
[15630196.040564] tpm tpm0: tpm_try_transmit: send(): error -62
[15630213.408259] tpm tpm0: tpm_try_transmit: send(): error -62
[15630431.712325] tpm tpm0: tpm_try_transmit: send(): error -62
[15630480.395475] tpm tpm0: tpm_try_transmit: send(): error -62
[15630574.557799] tpm tpm0: tpm_try_transmit: send(): error -62
[15630592.437446] tpm tpm0: tpm_try_transmit: send(): error -62
[15631411.010707] tpm tpm0: tpm_try_transmit: send(): error -62

This was captured from the time when the commands were working

# tpm2_getcap properties-fixed
TPM2_PT_FAMILY_INDICATOR:
  raw: 0x322E3000
  value: "2.0"
TPM2_PT_LEVEL:
  raw: 0
TPM2_PT_REVISION:
  value: 1.16
TPM2_PT_DAY_OF_YEAR:
  raw: 0xF
TPM2_PT_YEAR:
  raw: 0x7E0
TPM2_PT_MANUFACTURER:
  raw: 0x49465800
  value: "IFX"
TPM2_PT_VENDOR_STRING_1:
  raw: 0x534C4239
  value: "SLB9"
TPM2_PT_VENDOR_STRING_2:
  raw: 0x36373000
  value: "670"
TPM2_PT_VENDOR_STRING_3:
  raw: 0x0
  value: ""
TPM2_PT_VENDOR_STRING_4:
  raw: 0x0
  value: ""
TPM2_PT_VENDOR_TPM_TYPE:
  raw: 0x0
TPM2_PT_FIRMWARE_VERSION_1:
  raw: 0x7003E
TPM2_PT_FIRMWARE_VERSION_2:
  raw: 0xC3600
TPM2_PT_INPUT_BUFFER:
  raw: 0x400
TPM2_PT_HR_TRANSIENT_MIN:
  raw: 0x3
TPM2_PT_HR_PERSISTENT_MIN:
  raw: 0x7
TPM2_PT_HR_LOADED_MIN:
  raw: 0x3
TPM2_PT_ACTIVE_SESSIONS_MAX:
  raw: 0x40
TPM2_PT_PCR_COUNT:
  raw: 0x18
TPM2_PT_PCR_SELECT_MIN:
  raw: 0x3
TPM2_PT_CONTEXT_GAP_MAX:
  raw: 0xFFFF
TPM2_PT_NV_COUNTERS_MAX:
  raw: 0x8
TPM2_PT_NV_INDEX_MAX:
  raw: 0x680
TPM2_PT_MEMORY:
  raw: 0x6
TPM2_PT_CLOCK_UPDATE:
  raw: 0x80000
TPM2_PT_CONTEXT_HASH:
  raw: 0xB
TPM2_PT_CONTEXT_SYM:
  raw: 0x6
TPM2_PT_CONTEXT_SYM_SIZE:
  raw: 0x80
TPM2_PT_ORDERLY_COUNT:
  raw: 0xFF
TPM2_PT_MAX_COMMAND_SIZE:
  raw: 0x500
TPM2_PT_MAX_RESPONSE_SIZE:
  raw: 0x500
TPM2_PT_MAX_DIGEST:
  raw: 0x20
TPM2_PT_MAX_OBJECT_CONTEXT:
  raw: 0x3B8
TPM2_PT_MAX_SESSION_CONTEXT:
  raw: 0xEB
TPM2_PT_PS_FAMILY_INDICATOR:
  raw: 0x1
TPM2_PT_PS_LEVEL:
  raw: 0x0
TPM2_PT_PS_REVISION:
  raw: 0x100
TPM2_PT_PS_DAY_OF_YEAR:
  raw: 0x0
TPM2_PT_PS_YEAR:
  raw: 0x0
TPM2_PT_SPLIT_MAX:
  raw: 0x80
TPM2_PT_TOTAL_COMMANDS:
  raw: 0x5A
TPM2_PT_LIBRARY_COMMANDS:
  raw: 0x59
TPM2_PT_VENDOR_COMMANDS:
  raw: 0x1
TPM2_PT_NV_BUFFER_MAX:
  raw: 0x300

I'm building and using https://github.com/tpm2-software/tpm2-tools.git (commit ID https://github.com/tpm2-software/tpm2-tools/commit/ef3bd3aa2c190a8d2d4b38ea4f1442dcc994cc69) and https://github.com/tpm2-software/tpm2-tss.git (commit ID 8b635f806f002fac0167fa730f4f761cb3ada724)

OS

Ubuntu 18.04

Kernel

5.4.0-139-generic #156~18.04.1 SMP Thu Feb 23 08:50:29 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Work-around

Rebooting the server is seemingly fixing the issue, but this is the second time i am facing the same problem

Can i please get some pointers as to where the problem might be? kernel/Firmware or the hardware itself?

AndreasFuchsTPM commented 1 month ago

Given the problems are reported in the kernel driver, this appears to not be an issue of tpm2-tss or tpm2-tools. Thus, you should contact your TPM vendor via your account representative. Also, you do not have the latest firmware installed. You can drop me an email, if you don't already have a contact point.