Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2009124

Summary: [RHEL9.0]WHCKTpmTbsAdminEncryptDecrypt test case failed with Win10 guest
Product: Red Hat Enterprise Linux 9 Reporter: Qinghua Cheng <qcheng>
Component: libtpmsAssignee: Marc-Andre Lureau <marcandre.lureau>
Status: CLOSED MIGRATED QA Contact: Qinghua Cheng <qcheng>
Severity: low Docs Contact:
Priority: low    
Version: 9.0CC: coli, jinzhao, juzhang, mkedzier, qcheng, stefanb
Target Milestone: rcKeywords: MigratedToJIRA, Reopened, Triaged
Target Release: ---Flags: stefanb: needinfo-
pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-22 12:20:05 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:
Bug Depends On:    
Bug Blocks: 2135761    

Description Qinghua Cheng 2021-09-30 02:46:59 UTC
Description of problem:

LibTester.LibTesterTBSFunctional.WHCKTpmTbsAdminEncryptDecrypt test failed.


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

RHEL9.0
kernel: 5.14.0-3.el9.x86_64
qemu-kvm: qemu-kvm-6.1.0-2.el9.x86_64
libtpms: libtpms-0.8.2-0.20210301git729fc6a4ca.el9.7.x86_64
swtpm: swtpm-0.6.0-3.20210607gitea627b3.el9.x86_64
libvirt: libvirt-7.6.0-2.el9.x86_64

Win 10 version: 21h1
Studio version: 10.0.19041.1

This test case is passed with: libtpms-0.7.5-0.20210218gite271498466.el9.1.x86_64

And also failed with: libtpms-0.9.0-0.20210301git729fc6a4ca.el9.0.x86_64

How reproducible:
5/5

Steps to Reproduce:
1. Launch a Win10 guest with vtpm device
2. Launch HLK server
3. Select and run tpm test case 

Actual results:

Got LibTester.LibTesterTBSFunctional.WHCKTpmTbsAdminEncryptDecrypt failed

Expected results:

Test pass.

Additional info:

Error 9/28/2021 11:02:54.420 PM TestEncryptDecrypt;
TPM Error: Size. Error {Size} was returned for command EncryptDecrypt.
Details:
[Code=TpmRc.Size],[RawCode=0x95,149]
[ErrorEntity=Handle], [ParmNum=0]
[ParmName=Unknown]

Parameters:
Tdes.128.Ecb<p>Tpm2Lib.Tpm2EncryptDecryptRequest
  keyHandle             -                         TpmHandle
    handle              2164260855 (0x80fffff7)   uint
  decrypt               0 (0x0)                   byte
  mode                  Ecb                       TpmAlgId
  ivIn                  0x0000000000000000        byte[8]
  inData                0x3e81f78cebba4258        byte[8]
<p>To reproduce use option: -seed 85089ee57865e44c

 WexTraceInfo ThreadId=5052 ProcessId=3640 TimeStamp=13503212288 LogSessionId=1 SessionTraceCount=3901
 Result Failed

File:    Line: -1
Error Type:
Error Code:   0x0
Error Text:   Error 0x00000000

Comment 1 John Ferlan 2021-09-30 11:52:35 UTC
Added Marek to CC for Win10 awareness/help

Comment 2 Stefan Berger 2021-09-30 13:11:40 UTC
> 3. Select and run tpm test case 

Since there are many, which test case was selected?

Comment 3 Stefan Berger 2021-10-04 12:51:16 UTC
I tried to recreate the issue and could not.

Comment 4 Qinghua Cheng 2021-10-08 01:46:45 UTC
(In reply to Stefan Berger from comment #2)
> > 3. Select and run tpm test case 
> 
> Since there are many, which test case was selected?

Hi Stefan,

This test is a sub test of TPM 2.0 - Functional 

Thanks,

Qinghua

Comment 5 Stefan Berger 2021-10-13 14:18:14 UTC
> This test is a sub test of TPM 2.0 - Functional 

I couldn't recreate the issue.

   Stefan

Comment 7 John Ferlan 2022-09-02 20:27:37 UTC
Setting ITR just to ensure this reaches the radar during the release so that we can either resolve or close.

Comment 9 Qinghua Cheng 2022-09-08 06:30:14 UTC
The latest test result:

rhel 9.1 

kernel: 5.14.0-156.el9.x86_64
qemu-kvm: qemu-kvm-7.1.0-1.el9.x86_64

swtpm-0.7.0-2.20211109gitb79fd91.el9.x86_64
libtpms-0.9.1-2.20211126git1ff6fe1f43.el9.x86_64
edk2-ovmf-20220526git16779ede2d36-3.el9.noarch

Get following failed test cases:
'Task error message : Test name: TPM - Auxiliary Test, Task name: Run Test, Cause : Task "Run Test" is Marked Failed From the LogFile', 
'Task error message : Test name: TPM 2.0 - Cryptographic Operations and RNG, Task name: Run Test, Cause : Task "Run Test" is Marked Failed From the LogFile', 
'Task error message : Test name: TPM 2.0 - Functional, Task name: Run Test, Cause : Task "Run Test" is Marked Failed From the LogFile', 
'Task error message : Test name: TPM 2.0 - NV Storage, Policy, Error Handling and Attestation, Task name: Run Test, Cause : Task "Run Test" is Marked Failed From the LogFile', 
'Task error message : Test name: TPM 2.0 - Stress, Task name: Run Test, Cause : Task "Run Test" is Marked Failed From the LogFile', 
'Task error message : Test name: TPM 2.0 EK Certificate Tests, Task name: Run Test, Cause : Task "Run Test" is Marked Failed From the LogFile'

I upload the WttEa.log for Functional test in the attachment for reference.

Comment 10 Stefan Berger 2022-09-09 17:32:02 UTC
summary: 
 - Upgrading to libtpms v0.9.5 resolved the original issue of this BZ that I could previously not recreate but could recreate this time.  
 - I could not recreate any new issues as shown in comment #9.
 - Issues of 2 test cases are known and cannot be resolved.


I ran the tests now also again on

Fedora 36 host  with

swtpm 0.7.4      from git repo    [swtpm version is unlikely to be relevant in the test results here]
libtpms-0.9.1    from git repo
openssl-3.0.5-1.fc36.x86_64

The following were the results:

  -  Test name: TPM 2.0 - Cryptographic Operations and RNG
    => the original issue of this BZ could be recreated with libtpms 0.9.1 and disappeared with libtpms v0.9.5

  - Test name: TPM - Auxiliary Test   and
    Test name: TPM 2.0 EK Certificate Test
    => The errors that appeared here during my testing are known and documented in the 2nd table at the following link and cannot be resolved: https://github.com/stefanberger/libtpms/wiki/Testing-of-libtpms-Functionality#windows-hardware-lab-kit-tests

  - Test name: TPM 2.0 - Functional, Task name     and
    Test name: TPM 2.0 - NV Storage, Policy, Error Handling and Attestation    and
    Test name: TPM 2.0 - Stress

    => No error appeared with either libtpms v0.9.1 or libtpms v0.9.5

Comment 11 Marc-Andre Lureau 2022-09-13 07:49:07 UTC
(In reply to Stefan Berger from comment #10)
> summary: 
>  - Upgrading to libtpms v0.9.5 resolved the original issue of this BZ that I
> could previously not recreate but could recreate this time.  

The LibTester.LibTesterTBSFunctional.WHCKTpmTbsAdminEncryptDecrypt test?

Do you know what broke the test and what fixed it?

thanks

Comment 12 Qinghua Cheng 2022-09-13 07:59:20 UTC
Hi Stefan,

Thanks for recreating the bug again. I will try 0.9.5 when I get the downstream build.

Thanks,
Qinghua

(In reply to Stefan Berger from comment #10)
> summary: 
>  - Upgrading to libtpms v0.9.5 resolved the original issue of this BZ that I
> could previously not recreate but could recreate this time.  
>  - I could not recreate any new issues as shown in comment #9.
>  - Issues of 2 test cases are known and cannot be resolved.
> 
> 
> I ran the tests now also again on
> 
> Fedora 36 host  with
> 
> swtpm 0.7.4      from git repo    [swtpm version is unlikely to be relevant
> in the test results here]
> libtpms-0.9.1    from git repo
> openssl-3.0.5-1.fc36.x86_64
> 
> The following were the results:
> 
>   -  Test name: TPM 2.0 - Cryptographic Operations and RNG
>     => the original issue of this BZ could be recreated with libtpms 0.9.1
> and disappeared with libtpms v0.9.5
> 
>   - Test name: TPM - Auxiliary Test   and
>     Test name: TPM 2.0 EK Certificate Test
>     => The errors that appeared here during my testing are known and
> documented in the 2nd table at the following link and cannot be resolved:
> https://github.com/stefanberger/libtpms/wiki/Testing-of-libtpms-
> Functionality#windows-hardware-lab-kit-tests
> 
>   - Test name: TPM 2.0 - Functional, Task name     and
>     Test name: TPM 2.0 - NV Storage, Policy, Error Handling and Attestation 
> and
>     Test name: TPM 2.0 - Stress
> 
>     => No error appeared with either libtpms v0.9.1 or libtpms v0.9.5

Comment 13 Stefan Berger 2022-09-13 11:16:19 UTC
(In reply to Marc-Andre Lureau from comment #11)
> (In reply to Stefan Berger from comment #10)
> > summary: 
> >  - Upgrading to libtpms v0.9.5 resolved the original issue of this BZ that I
> > could previously not recreate but could recreate this time.  
> 
> The LibTester.LibTesterTBSFunctional.WHCKTpmTbsAdminEncryptDecrypt test?

Yes.

> 
> Do you know what broke the test and what fixed it?

My guess would be that this patch here fixed it: https://github.com/stefanberger/libtpms/commit/1de757972e97dea11502c124fba3a64743d18df1

Comment 14 Marc-Andre Lureau 2022-09-13 14:13:32 UTC
(In reply to Stefan Berger from comment #13)
> > Do you know what broke the test and what fixed it?
> 
> My guess would be that this patch here fixed it:
> https://github.com/stefanberger/libtpms/commit/
> 1de757972e97dea11502c124fba3a64743d18df1

That is fixed with https://bugzilla.redhat.com/show_bug.cgi?id=2093651.

@qcheng, could you check with >= libtpms-0.9.1-1.20211126git1ff6fe1f43.el9 ?

thanks

Comment 16 Qinghua Cheng 2022-09-20 14:20:05 UTC
I get the same results as comment 9 with libtpms-0.9.1-1.20211126git1ff6fe1f43.el9.x86_64.

kernel: 5.14.0-160.el9.x86_64
qemu-kvm: qemu-kvm-7.1.0-1.el9.x86_64
libtpms: libtpms-0.9.1-1.20211126git1ff6fe1f43.el9.x86_64
openssl: openssl-3.0.1-41.el9_0.x86_64

Upload the WttEa.log file for Functional tests for your reference.

Comment 17 Marc-Andre Lureau 2022-11-29 09:08:04 UTC
Hi @qcheng, could you try with 0.9.5 ? https://centos.softwarefactory-project.io/logs/9/9/95eea4b36f0d2e46f1ab439b5426b3dee6a4edbc/check/mock-build/d1ff91d/repo/

thanks

Comment 19 Qinghua Cheng 2022-12-19 08:13:11 UTC
I got same results: 

'Task error message : Test name: TPM - Auxiliary Test, Task name: Run Test, Cause : Task "Run Test" is Marked Failed From the LogFile', 
'Task error message : Test name: TPM 2.0 - Cryptographic Operations and RNG, Task name: Run Test, Cause : Task "Run Test" is Marked Failed From the LogFile', 
'Task error message : Test name: TPM 2.0 - Functional, Task name: Run Test, Cause : Task "Run Test" is Marked Failed From the LogFile', 
'Task error message : Test name: TPM 2.0 - NV Storage, Policy, Error Handling and Attestation, Task name: Run Test, Cause : Task "Run Test" is Marked Failed From the LogFile', 
'Task error message : Test name: TPM 2.0 - Stress, Task name: Run Test, Cause : Task "Run Test" is Marked Failed From the LogFile', 
'Task error message : Test name: TPM 2.0 EK Certificate Tests, Task name: Run Test, Cause : Task "Run Test" is Marked Failed From the LogFile'

krnel: 5.14.0-210.el9.x86_64
qemu-kvm: qemu-kvm-7.1.0-6.el9.x86_64
swtpm-0.7.0-3.20211109gitb79fd91.el9.x86_64
libtpms-0.9.5-1.el9.x86_64
openssl-3.0.7-2.el9.x86_64
edk2-ovmf-20220826gitba0e0e4c6a-2.el9.noarch

I upload the WttEa.log for Cryptographic Operations and RNG in the attachment.

Comment 20 Marc-Andre Lureau 2023-01-02 09:22:23 UTC
I don't really understand the failing test from the log. It seems to start with:
3324 7984 2022:12:12 2:41:39:892 Error: 0x8201aaac, Error 0x8201aaac   (Error ( status = 43692 ) in call: FindFileAndCopy( lpszFileName, lpszDestinationDir, 0, &dwFilesCopied, filecopyinfoDic) )   File=sdktools\dtm\wttbuild\coresys\client\executiontask\executiontask.cpp Line=2065    

Which doesn't look TPM related.

Furthermore, it's a bit weird that there are several "Build No Greater than 4000. This is a Windows Vista Machine    ". Perhaps you could share the details of your WHLK setup.

Comment 21 Qinghua Cheng 2023-01-19 09:06:55 UTC
Hi Marc-Andre,

My Win10 guest is installed from our internal iso and checked inside the guest:

Edition Windows 10 Enterprise
Version 21H2

HLK is 2004

If you need more information, please let me know.

Thanks,
Qinghua

Comment 23 RHEL Program Management 2023-03-30 07:28:22 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.

Comment 24 Qinghua Cheng 2023-04-03 09:54:40 UTC
Let's open this bz for more investigation.

Comment 28 RHEL Program Management 2023-09-22 12:18:45 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 29 RHEL Program Management 2023-09-22 12:20:05 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.