Bug 1498909

Summary: tpm2-tools are not built with tabrmd TCTI support
Product: [Fedora] Fedora Reporter: Javier Martinez Canillas <fmartine>
Component: tpm2-toolsAssignee: Yunying Sun <yunying.sun>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 27CC: javierm, jsnitsel, yunying.sun
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: tpm2-tools-2.1.0-6.fc27 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-10-13 23:29:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Javier Martinez Canillas 2017-10-05 14:18:13 UTC
Description of problem:

The tpm2-tools support different transport layers (TCTI). One of these is the tabrmd TCTI that's used to communicate with the tpm2-abrmd (D-Bus based user-space resource manager).

But the tpm2-tools in the package are not built with tabrmd TCTI support.

Version-Release number of selected component (if applicable):

tpm2-tools-2.1.0-4.fc27.x86_64

How reproducible:

Very easy to reproduce.

Steps to Reproduce:
1. sudo dnf install tpm2-{tools,tss,abrmd}
2. sudo systemctl start tpm2-abrmd
3. tpm2_listpcrs -L 0x4:7 -T tabrmd

Actual results:

The tools said that tabrmd is an invalid TCTI:

$ tpm2_listpcrs -L 0x4:7 -T tabrmd
invalid TCTI, see --help

Expected results:

The tools should be able to send commands to the TPM2 through the tpm2-abrmd:

$ tpm2_listpcrs -L 0x4:7 -T tabrmd

Bank/Algorithm: TPM_ALG_SHA1(0x0004)
PCR_07: 6d 72 06 87 1c 9c 6f 38 ad 39 97 ba ce eb ee 95 da de c0 4d

Additional info:

I've an updated package that fixes the issue in this COPR repository:

https://copr.fedorainfracloud.org/coprs/javierm/tpm-test-pkgs/

Comment 1 Jerry Snitselaar 2017-10-05 14:33:02 UTC
Should just need:

BuildRequires: pkgconfig(tcti-tabrmd)

yes?

It might also need a small patch to the Makefile to have the tabrmd info show up
in the man pages (what I used for rhel package build):

diff -ur tpm2-tools-2.1.0-orig/Makefile.am tpm2-tools-2.1.0/Makefile.am
--- tpm2-tools-2.1.0-orig/Makefile.am	2017-09-29 01:42:36.402463427 -0700
+++ tpm2-tools-2.1.0/Makefile.am	2017-09-29 01:43:43.536459921 -0700
@@ -209,6 +209,9 @@
 if HAVE_TCTI_SOCK
 	echo ".nr HAVE_TCTI_SOCK 1" >> $@
 endif
+if HAVE_TCTI_TABRMD
+	echo ".nr HAVE_TCTI_TABRMD 1" >> $@
+endif
 	sed -e '/@COMMON_OPTIONS_INCLUDE@/r man/common-options.troff' \
 	    -e '/@COMMON_OPTIONS_INCLUDE@/d' \
 	    -e '/@TCTI_OPTIONS_INCLUDE@/r man/tcti-options.troff' \

Comment 2 Javier Martinez Canillas 2017-10-05 14:37:24 UTC
(In reply to Jerry Snitselaar from comment #1)
> Should just need:
> 
> BuildRequires: pkgconfig(tcti-tabrmd)
> 
> yes?
>

Yes, in fact I proposed a pull request some minutes ago that do this:

https://src.fedoraproject.org/rpms/tpm2-tools/pull-request/1
 
> It might also need a small patch to the Makefile to have the tabrmd info
> show up
> in the man pages (what I used for rhel package build):
> 
> diff -ur tpm2-tools-2.1.0-orig/Makefile.am tpm2-tools-2.1.0/Makefile.am
> --- tpm2-tools-2.1.0-orig/Makefile.am	2017-09-29 01:42:36.402463427 -0700
> +++ tpm2-tools-2.1.0/Makefile.am	2017-09-29 01:43:43.536459921 -0700
> @@ -209,6 +209,9 @@
>  if HAVE_TCTI_SOCK
>  	echo ".nr HAVE_TCTI_SOCK 1" >> $@
>  endif
> +if HAVE_TCTI_TABRMD
> +	echo ".nr HAVE_TCTI_TABRMD 1" >> $@
> +endif

Ah, I missed that. I can updated my PR adding this.

Comment 3 Fedora Update System 2017-10-09 08:20:01 UTC
tpm2-tools-2.1.0-6.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-8b3cf5f512

Comment 4 Fedora Update System 2017-10-09 21:55:47 UTC
tpm2-tools-2.1.0-6.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-8b3cf5f512

Comment 5 Fedora Update System 2017-10-13 23:29:52 UTC
tpm2-tools-2.1.0-6.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.