tpm2-software / tpm2-tools

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

Problem with ressourcemanager / abrmd : ERROR: Could not load tcti, got: "device" #1238

Closed ghost closed 5 years ago

ghost commented 5 years ago

Hello,

i am testing tpm stack on a dell xps with a tpm2 integrated. OS is ubuntu 18.04 LTS kernel version: 4.15.0-36-generic

I have compiled sources as described on the documentation, i can start either abrmd or ressourcemanager services using systemd,

the problem is that when i execute simple command with the ressource manager or abrmd started i get this error:

ERROR:tcti:src/tss2-tcti/tcti-device.c:319:Tss2_Tcti_Device_Init() Failed to open device file /dev/tpm0: Device or resource busy 
ERROR: tcti init allocation routine failed for library: "device" options: "(null)"
ERROR: Could not load tcti, got: "device"

without a abrmd or ressourcemanager commands line are working fine.

until i get this error when trying to load a key:


root@iRRo1:~/tpm2-src/tpm2-tools# tpm2_load -C context.primary -u key.pub -r key.priv -o key.ctx
ERROR: Tss2_Sys_Load(0x902) - tpm:warn(2.0): out of memory for object contexts

i saw in other thread that only 3 handle can be supported once and that ressourcemanager is suppossing dealing with that.

could you please tell me if i am missing something ?

ghost commented 5 years ago

hi i just applied what was mentionned here:

https://github.com/tpm2-software/tpm2-tools/blob/master/man/common/tcti.md

root@iRRo1:~# sudo -u tss G_MESSAGES_DEBUG=all tpm2-abrmd 
** INFO: 17:49:40.165: tabrmd startup
** INFO: 17:49:40.165: logging to stdout
** (tpm2-abrmd:15617): DEBUG: 17:49:40.165: tcti_conf_parse
** (tpm2-abrmd:15617): DEBUG: 17:49:40.165: tcti_conf_parse: combined conf is null
** (tpm2-abrmd:15617): DEBUG: 17:49:40.165: tcti_dynamic_set_property: TctiDynamic 0x560774494c00 set filename: libtss2-tcti-device.so.0
** (tpm2-abrmd:15617): DEBUG: 17:49:40.166: tcti_dynamic_set_property: TctiDynamic 0x560774494c00 PROP_CONF_STR set to: (null)
** INFO: 17:49:40.166: entering g_main_loop
** INFO: 17:49:40.166: init_thread_func start
** (tpm2-abrmd:15617): DEBUG: 17:49:40.166: random_class_init
** (tpm2-abrmd:15617): DEBUG: 17:49:40.166: opening entropy source: /dev/urandom
** (tpm2-abrmd:15617): DEBUG: 17:49:40.166: reading from entropy source: /dev/urandom
** (tpm2-abrmd:15617): DEBUG: 17:49:40.166: seeding rand with 1541989115453376185
** (tpm2-abrmd:15617): DEBUG: 17:49:40.166: connection_manager_set_property: 0x560774485300
** (tpm2-abrmd:15617): DEBUG: 17:49:40.166:   max_connections: 0x1b
** (tpm2-abrmd:15617): DEBUG: 17:49:40.166: ConnectionManager: 0x560774485300
** (tpm2-abrmd:15617): DEBUG: 17:49:40.166: IpcFrontendDbus set bus_name: com.intel.tss2.Tabrmd
** (tpm2-abrmd:15617): DEBUG: 17:49:40.166: ipc_frontend_connect: 0x7f2138003460
** (tpm2-abrmd:15617): DEBUG: 17:49:40.166: tcti_initialize: 0x560774494c00
** (tpm2-abrmd:15617): DEBUG: 17:49:40.166: tcti_dynamic_initialize: TctiDynamic 0x560774494c00
** (tpm2-abrmd:15617): DEBUG: 17:49:40.166: tcti_util_discover_info
** (tpm2-abrmd:15617): DEBUG: 17:49:40.167: tcti_util_dynamic_init
** (tpm2-abrmd:15617): DEBUG: 17:49:40.167: sapi_context_init w/ Tcti: 0x560774494c00
** (tpm2-abrmd:15617): DEBUG: 17:49:40.167: tcti_peek_context: 0x560774494c00
** (tpm2-abrmd:15617): DEBUG: 17:49:40.167: Allocating 0x1048 bytes for SAPI context
** (tpm2-abrmd:15617): DEBUG: 17:49:40.167: access_broker_set_property: 0x7f21380190c0
** (tpm2-abrmd:15617): DEBUG: 17:49:40.167:   sapi_context: 0x7f2138017870
** (tpm2-abrmd:15617): DEBUG: 17:49:40.167: access_broker_set_property: 0x7f21380190c0
** (tpm2-abrmd:15617): DEBUG: 17:49:40.167:   tcti: 0x560774494c00
** (tpm2-abrmd:15617): DEBUG: 17:49:40.167: created AccessBroker: 0x7f21380190c0
** (tpm2-abrmd:15617): DEBUG: 17:49:40.167: access_broker_init_tpm: 0x7f21380190c0
** INFO: 17:49:40.171: on_bus_acquired: com.intel.tss2.Tabrmd
** INFO: 17:49:40.173: on_name_acquired: com.intel.tss2.Tabrmd
** (tpm2-abrmd:15617): DEBUG: 17:49:40.173: Got proxy object for DBus daemon.
** (tpm2-abrmd:15617): DEBUG: 17:49:40.186: access_broker_get_tpm_properties_fixed
** (tpm2-abrmd:15617): DEBUG: 17:49:40.194: command_attrs_class_init
** (tpm2-abrmd:15617): DEBUG: 17:49:40.194: created CommandAttrs: 0x7f213800c640
** (tpm2-abrmd:15617): DEBUG: 17:49:40.194: GetCapabilty for 0xf80 commands
** (tpm2-abrmd:15617): DEBUG: 17:49:40.202: got attributes for 0x5f commands
** (tpm2-abrmd:15617): DEBUG: 17:49:40.202: command_source_class_init
** (tpm2-abrmd:15617): DEBUG: 17:49:40.202: command_source_set_properties: 0x560774496370
** (tpm2-abrmd:15617): DEBUG: 17:49:40.202:   command_attrs: 0x7f213800c640
** (tpm2-abrmd:15617): DEBUG: 17:49:40.202: command_source_set_properties: 0x560774496370
** (tpm2-abrmd:15617): DEBUG: 17:49:40.202: created command source: 0x560774496370
** (tpm2-abrmd:15617): DEBUG: 17:49:40.203: session_list_new with max-per-connection: 0x4
** (tpm2-abrmd:15617): DEBUG: 17:49:40.203: session_list_init
** (tpm2-abrmd:15617): DEBUG: 17:49:40.203: session_list_set_property: 0x7f213800c670 max-abandoned: 4
** (tpm2-abrmd:15617): DEBUG: 17:49:40.203: session_list_set_property: 0x7f213800c670 max-per-connection: 4
** (tpm2-abrmd:15617): DEBUG: 17:49:40.203: resource_manager_set_property: 0x7f2138009440
** (tpm2-abrmd:15617): DEBUG: 17:49:40.203:   in_queue: 0x7f2138001520
** (tpm2-abrmd:15617): DEBUG: 17:49:40.203: resource_manager_set_property: 0x7f2138009440
** (tpm2-abrmd:15617): DEBUG: 17:49:40.203:   access_broker: 0x7f21380190c0
** (tpm2-abrmd:15617): DEBUG: 17:49:40.203: resource_manager_set_property: 0x7f2138009440
** (tpm2-abrmd:15617): DEBUG: 17:49:40.203: created ResourceManager: 0x7f2138009440
** (tpm2-abrmd:15617): DEBUG: 17:49:40.203: response_sink_set_property
** (tpm2-abrmd:15617): DEBUG: 17:49:40.203:   setting PROP_IN_QUEUE
** (tpm2-abrmd:15617): DEBUG: 17:49:40.203: created response source: 0x7f213800c6d0
** (tpm2-abrmd:15617): DEBUG: 17:49:40.203: source_add_sink
** (tpm2-abrmd:15617): DEBUG: 17:49:40.203: command_source_add_sink: CommandSource: 0x560774496370 , Sink: 0x7f2138009440
** (tpm2-abrmd:15617): DEBUG: 17:49:40.203: command_source_set_properties: 0x560774496370
** (tpm2-abrmd:15617): DEBUG: 17:49:40.203:   sink: 0x7f2138009440
** (tpm2-abrmd:15617): DEBUG: 17:49:40.203: source_add_sink
** (tpm2-abrmd:15617): DEBUG: 17:49:40.203: resource_manager_add_sink: ResourceManager: 0x7f2138009440, Sink: 0x7f213800c6d0
** (tpm2-abrmd:15617): DEBUG: 17:49:40.204: resource_manager_set_property: 0x7f2138009440
** (tpm2-abrmd:15617): DEBUG: 17:49:40.204:   sink: 0x7f213800c6d0
** INFO: 17:49:40.204: init_thread_func done
** (tpm2-abrmd:15617): DEBUG: 17:49:40.204: resource_manager_thread start
** (tpm2-abrmd:15617): DEBUG: 17:49:40.204: response_sink_thread blocking on input queue: 0x7f21380018c0
** (tpm2-abrmd:15617): DEBUG: 17:49:40.204: message_queue_dequeue 0x7f2138001520
** (tpm2-abrmd:15617): DEBUG: 17:49:40.204: message_queue_dequeue 0x7f21380018c0
root@iRRo1:~# export TPM2TOOLS_TCTI="abrmd:bus_name=com.intel.tss2.Tabrmd"
root@iRRo1:~# tpm2_listpersistent
ERROR: Could not dlopen library: "tabrmd"
ERROR: Could not load tcti, got: "tabrmd"

tabrmd is well starting but i can only execute command with the device mode ...

any idea about the problem ?

kind regards.

williamcroberts commented 5 years ago

-----Original Message----- From: ba3aw [mailto:notifications@github.com] Sent: Tuesday, November 13, 2018 9:01 AM To: tpm2-software/tpm2-tools tpm2-tools@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: Re: [tpm2-software/tpm2-tools] Problem with ressourcemanager / abrmd : ERROR: Could not load tcti, got: "device" (#1238)

hi i just applied what was mentionned here:

https://github.com/tpm2-software/tpm2- tools/blob/master/man/common/tcti.md

root@iRRo1:~# sudo -u tss G_MESSAGES_DEBUG=all tpm2-abrmd INFO: 17:49:40.165: tabrmd startup INFO: 17:49:40.165: logging to stdout (tpm2-abrmd:15617): DEBUG: 17:49:40.165: tcti_conf_parse (tpm2-abrmd:15617): DEBUG: 17:49:40.165: tcti_conf_parse: combined conf is null (tpm2-abrmd:15617): DEBUG: 17:49:40.165: tcti_dynamic_set_property: TctiDynamic 0x560774494c00 set filename: libtss2-tcti-device.so.0 (tpm2-abrmd:15617): DEBUG: 17:49:40.166: tcti_dynamic_set_property: TctiDynamic 0x560774494c00 PROP_CONF_STR set to: (null) INFO: 17:49:40.166: entering g_main_loop INFO: 17:49:40.166: init_thread_func start (tpm2-abrmd:15617): DEBUG: 17:49:40.166: random_class_init (tpm2-abrmd:15617): DEBUG: 17:49:40.166: opening entropy source: /dev/urandom (tpm2-abrmd:15617): DEBUG: 17:49:40.166: reading from entropy source: /dev/urandom (tpm2-abrmd:15617): DEBUG: 17:49:40.166: seeding rand with 1541989115453376185 (tpm2-abrmd:15617): DEBUG: 17:49:40.166: connection_manager_set_property: 0x560774485300 (tpm2-abrmd:15617): DEBUG: 17:49:40.166: max_connections: 0x1b (tpm2-abrmd:15617): DEBUG: 17:49:40.166: ConnectionManager: 0x560774485300 (tpm2-abrmd:15617): DEBUG: 17:49:40.166: IpcFrontendDbus set bus_name: com.intel.tss2.Tabrmd (tpm2-abrmd:15617): DEBUG: 17:49:40.166: ipc_frontend_connect: 0x7f2138003460 (tpm2-abrmd:15617): DEBUG: 17:49:40.166: tcti_initialize: 0x560774494c00 (tpm2-abrmd:15617): DEBUG: 17:49:40.166: tcti_dynamic_initialize: TctiDynamic 0x560774494c00 (tpm2-abrmd:15617): DEBUG: 17:49:40.166: tcti_util_discover_info (tpm2-abrmd:15617): DEBUG: 17:49:40.167: tcti_util_dynamic_init (tpm2-abrmd:15617): DEBUG: 17:49:40.167: sapi_context_init w/ Tcti: 0x560774494c00 (tpm2-abrmd:15617): DEBUG: 17:49:40.167: tcti_peek_context: 0x560774494c00 (tpm2-abrmd:15617): DEBUG: 17:49:40.167: Allocating 0x1048 bytes for SAPI context (tpm2-abrmd:15617): DEBUG: 17:49:40.167: access_broker_set_property: 0x7f21380190c0 (tpm2-abrmd:15617): DEBUG: 17:49:40.167: sapi_context: 0x7f2138017870 (tpm2-abrmd:15617): DEBUG: 17:49:40.167: access_broker_set_property: 0x7f21380190c0 (tpm2-abrmd:15617): DEBUG: 17:49:40.167: tcti: 0x560774494c00 (tpm2-abrmd:15617): DEBUG: 17:49:40.167: created AccessBroker: 0x7f21380190c0 (tpm2-abrmd:15617): DEBUG: 17:49:40.167: access_broker_init_tpm: 0x7f21380190c0 INFO: 17:49:40.171: on_bus_acquired: com.intel.tss2.Tabrmd INFO: 17:49:40.173: on_name_acquired: com.intel.tss2.Tabrmd (tpm2-abrmd:15617): DEBUG: 17:49:40.173: Got proxy object for DBus daemon. (tpm2-abrmd:15617): DEBUG: 17:49:40.186: access_broker_get_tpm_properties_fixed (tpm2-abrmd:15617): DEBUG: 17:49:40.194: command_attrs_class_init (tpm2-abrmd:15617): DEBUG: 17:49:40.194: created CommandAttrs: 0x7f213800c640 (tpm2-abrmd:15617): DEBUG: 17:49:40.194: GetCapabilty for 0xf80 commands (tpm2-abrmd:15617): DEBUG: 17:49:40.202: got attributes for 0x5f commands (tpm2-abrmd:15617): DEBUG: 17:49:40.202: command_source_class_init (tpm2-abrmd:15617): DEBUG: 17:49:40.202: command_source_set_properties: 0x560774496370 (tpm2-abrmd:15617): DEBUG: 17:49:40.202: command_attrs: 0x7f213800c640 (tpm2-abrmd:15617): DEBUG: 17:49:40.202: command_source_set_properties: 0x560774496370 (tpm2-abrmd:15617): DEBUG: 17:49:40.202: created command source: 0x560774496370 (tpm2-abrmd:15617): DEBUG: 17:49:40.203: session_list_new with max-per- connection: 0x4 (tpm2-abrmd:15617): DEBUG: 17:49:40.203: session_list_init (tpm2-abrmd:15617): DEBUG: 17:49:40.203: session_list_set_property: 0x7f213800c670 max-abandoned: 4 (tpm2-abrmd:15617): DEBUG: 17:49:40.203: session_list_set_property: 0x7f213800c670 max-per-connection: 4 (tpm2-abrmd:15617): DEBUG: 17:49:40.203: resource_manager_set_property: 0x7f2138009440 (tpm2-abrmd:15617): DEBUG: 17:49:40.203: in_queue: 0x7f2138001520 (tpm2-abrmd:15617): DEBUG: 17:49:40.203: resource_manager_set_property: 0x7f2138009440 (tpm2-abrmd:15617): DEBUG: 17:49:40.203: access_broker: 0x7f21380190c0 (tpm2-abrmd:15617): DEBUG: 17:49:40.203: resource_manager_set_property: 0x7f2138009440 (tpm2-abrmd:15617): DEBUG: 17:49:40.203: created ResourceManager: 0x7f2138009440 (tpm2-abrmd:15617): DEBUG: 17:49:40.203: response_sink_set_property (tpm2-abrmd:15617): DEBUG: 17:49:40.203: setting PROP_IN_QUEUE (tpm2-abrmd:15617): DEBUG: 17:49:40.203: created response source: 0x7f213800c6d0 (tpm2-abrmd:15617): DEBUG: 17:49:40.203: source_add_sink (tpm2-abrmd:15617): DEBUG: 17:49:40.203: command_source_add_sink: CommandSource: 0x560774496370 , Sink: 0x7f2138009440 (tpm2-abrmd:15617): DEBUG: 17:49:40.203: command_source_set_properties: 0x560774496370 (tpm2-abrmd:15617): DEBUG: 17:49:40.203: sink: 0x7f2138009440 (tpm2-abrmd:15617): DEBUG: 17:49:40.203: source_add_sink (tpm2-abrmd:15617): DEBUG: 17:49:40.203: resource_manager_add_sink: ResourceManager: 0x7f2138009440, Sink: 0x7f213800c6d0 (tpm2-abrmd:15617): DEBUG: 17:49:40.204: resource_manager_set_property: 0x7f2138009440 (tpm2-abrmd:15617): DEBUG: 17:49:40.204: sink: 0x7f213800c6d0 INFO: 17:49:40.204: init_thread_func done (tpm2-abrmd:15617): DEBUG: 17:49:40.204: resource_manager_thread start (tpm2-abrmd:15617): DEBUG: 17:49:40.204: response_sink_thread blocking on input queue: 0x7f21380018c0 (tpm2-abrmd:15617): DEBUG: 17:49:40.204: message_queue_dequeue 0x7f2138001520 ** (tpm2-abrmd:15617): DEBUG: 17:49:40.204: message_queue_dequeue 0x7f21380018c0

root@iRRo1:~# export TPM2TOOLS_TCTI="abrmd:bus_name=com.intel.tss2.Tabrmd" root@iRRo1:~# tpm2_listpersistent ERROR: Could not dlopen library: "tabrmd" ERROR: Could not load tcti, got: "tabrmd"

tabrmd is well starting but i can only execute command with the device mode ...

any idea about the problem ?

Where is the shared library installed for the tabrmd tcti? Did you install from source? You may have to run sudo ldconfig to update the dynamic linker metadata cache.

kind regards.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tpm2- software/tpm2-tools/issues/1238#issuecomment-438349259 , or mute the thread https://github.com/notifications/unsubscribe- auth/AQ7bB70nwh55G5DdQ1fPMxUblvx023ECks5uuvqxgaJpZM4YaGL6 . https://github.com/notifications/beacon/AQ7bB6zszmW3tjH0UbkDeIobUaCgLz 9zks5uuvqxgaJpZM4YaGL6.gif

ghost commented 5 years ago

yes, i have installed from sources,

but i can only see this shared libraries:

root@iRRo1:/usr/lib# ls /usr/lib | grep tcti
libtss2-tcti-device.a
libtss2-tcti-device.la
libtss2-tcti-device.so
libtss2-tcti-device.so.0
libtss2-tcti-device.so.0.0.0
libtss2-tcti-mssim.a
libtss2-tcti-mssim.la
libtss2-tcti-mssim.so
libtss2-tcti-mssim.so.0
libtss2-tcti-mssim.so.0.0.0
ghost commented 5 years ago

my bad, i can see also these ones:

/usr/lib64/libtss2-tcti-tabrmd.a
/usr/lib64/libtss2-tcti-tabrmd.la
/usr/lib64/libtss2-tcti-tabrmd.so.0.0.0
/usr/lib64/libtss2-tcti-tabrmd.so
/usr/lib64/libtss2-tcti-tabrmd.so.0

and yes i have executed ldconfig

ghost commented 5 years ago

you are right, i missed to add the good path on my ldconfig, problem is solved and it was a configuration one, many thanks.