Bug 786837 - rngd does not check status when communicating with the TPM
Summary: rngd does not check status when communicating with the TPM
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: rng-tools
Version: 6.5
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Neil Horman
QA Contact: Rachel Sibley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-02 14:39 UTC by Steve Grubb
Modified: 2019-10-30 17:17 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-06-11 16:58:19 UTC
Target Upstream Version:


Attachments (Terms of Use)
patch to check tpm return code (972 bytes, patch)
2014-08-13 15:30 UTC, Neil Horman
no flags Details | Diff

Description Steve Grubb 2012-02-02 14:39:12 UTC
Description of problem:
Rngd does not interpret any error returns from the TPM chip. In the BIOS, usually you have to do 2 things to get the TPM fully enabled. If you only enable TPM without also setting the "Execute TPM command" to enabled, it can show up as /dev/tpm but doesn't actually work. The program as written does not check the payload returned from the chip for success/failure. It assumes that it was successful and then goes on to do the FIPS test and fails that. So, the only indication is failing a FIPS check rather than saying that the TPM returned an error code and what that error code means.

Comment 3 Suzanne Logcher 2012-02-14 23:30:21 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.

Comment 4 Jeff Garzik 2013-04-18 22:52:34 UTC
Example of checking TPM error return?

Comment 5 Neil Horman 2014-08-13 13:32:53 UTC
This already works in RHEL7 because the kernel handles abstracting the tpm rng.  Basically the tpm response has an ouput header with error code information in it for the GetRandom Command, documented here:

http://www.trustedcomputinggroup.org/files/static_page_files/72C33D71-1A4B-B294-D02C7DF86630BE7C/TPM%20Main-Part%203%20Commands_v1.2_rev116_01032011.pdf

Since RHEL6 does the tpm rng work in rngd, we need to do the same error checking there.

Comment 6 Neil Horman 2014-08-13 15:30:49 UTC
Created attachment 926487 [details]
patch to check tpm return code

test patch to check tpm output header for positive return code.  currently untested

Comment 7 Neil Horman 2014-08-13 15:32:45 UTC
http://brewweb.devel.redhat.com/brew/taskinfo?taskID=7839469

Steve, theres a test build with the patch from the previous comment included.  If you could please test it out and let me know if it works, I would appreciate it

Comment 8 Neil Horman 2015-06-11 16:58:19 UTC
Closing, its been a year without any feedback here.


Note You need to log in before you can comment on or make changes to this bug.