tpm2-software / tpm2-abrmd

TPM2 Access Broker & Resource Management Daemon implementing the TCG spec.
https://github.com/tpm2-software/tpm2-abrmd
BSD 2-Clause "Simplified" License
116 stars 100 forks source link

failed to launch tpm2-tabrmd on busybox #815

Open benzwt opened 2 years ago

benzwt commented 2 years ago

I'm running a small device with busybox, the version of the linux kernel is 4.14.0. I built my own dbus, tpm2-abrmd(following the INSTALL.MD). But I failed to lauched the tpm2-abrmd on my busybox.

To ensure the dbus is working, I compiled the example program which provieded by http://dbus.freedesktop.org/doc/dbus/libdbus-tutorial.html. The demo ran flawlessly.

The environment of the busybox is very clean, I don't have any SE-Linux stuff that might block the dbus service.

I started the dbus-daemon as follow:

/usr/local/bin/dbus-daemon --system --nofork --nopidfile --syslog-only

I then started the tpm2-abrmd with the user tss, but it complained that it cannot get the proxy for Dbus daemon

root> su - tss && tpm2-abrmd --logger=stdout


** (tpm2-abrmd:2188): WARNING **: 19:46:36.540: Failed to get proxy for DBus daemon (org.freedesktop.DBus): Could not connect: No such file or directory

(tpm2-abrmd:2188): CRITICAL : 19:46:36.540: Failed to acquire DBus name com.intel.tss2.Tabrmd. UID 106 must be allowed to "own" this name. Check DBus config and check that this is running as user tss or root. ERROR:tcti:src/util/io.c:114:write_all() failed to write to fd 5: Operation not permitted ERROR:tcti:src/tss2-tcti/tcti-device.c:469:Tss2_Tcti_Device_Init() Could not probe device for partial response read support ERROR:tcti:src/tss2-tcti/tctildr-dl.c:154:tcti_from_file() Could not initialize TCTI file: device ERROR:tcti:src/tss2-tcti/tctildr.c:428:Tss2_TctiLdr_Initialize_Ex() Failed to instantiate TCTI

(tpm2-abrmd:2188): CRITICAL : 19:46:37.294: init_thread_func: failed to create TCTI with conf "device:/dev/tpm0", got RC: 0xa000a


I then try to launch the tpm2-abrmd with root permission, and the same problem appeared
> root> tpm2-abrmd --logger=stdout  --allow-root

(tpm2-abrmd:2222): WARNING : 19:48:24.975: Failed to get proxy for DBus daemon (org.freedesktop.DBus): Could not connect: No such file or directory

(tpm2-abrmd:2222): CRITICAL : 19:48:24.975: Failed to acquire DBus name com.intel.tss2.Tabrmd. UID 0 must be allowed to "own" this name. Check DBus config and check that this is running as user tss or root. ERROR:tcti:src/util/io.c:114:write_all() failed to write to fd 5: Operation not permitted ERROR:tcti:src/tss2-tcti/tcti-device.c:469:Tss2_Tcti_Device_Init() Could not probe device for partial response read support ERROR:tcti:src/tss2-tcti/tctildr-dl.c:154:tcti_from_file() Could not initialize TCTI file: device ERROR:tcti:src/tss2-tcti/tctildr.c:428:Tss2_TctiLdr_Initialize_Ex() Failed to instantiate TCTI

(tpm2-abrmd:2222): CRITICAL : 19:48:25.728: init_thread_func: failed to create TCTI with conf "device:/dev/tpm0", got RC: 0xa000a


Finally, this the query result of dbus-daemon
> dbus-send --system --dest=org.freedesktop.DBus --type=method_call --print-reply /org/freedesktop/DBus org.freedesktop.DBus.ListNames

method return time=1659985732.312696 sender=org.freedesktop.DBus -> destination=:1.0 serial=3 reply_serial=2 array [ string "org.freedesktop.DBus" string ":1.0" ]