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 2035643

Summary: ERROR:esys:src/tss2-esys/api/Esys_Load.c:112:Esys_Load() Esys Finish ErrorCode (0x00000921)
Product: Red Hat Enterprise Linux 9 Reporter: lejeczek <peljasz>
Component: tpm2-toolsAssignee: Štěpán Horáček <shoracek>
Status: CLOSED WONTFIX QA Contact: Vilém Maršík <vmarsik>
Severity: high Docs Contact:
Priority: unspecified    
Version: CentOS StreamCC: bhu, bstinson, jsnitsel, jwboyer, miabbott, scorreia
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: 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-06-26 07:28:08 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 lejeczek 2021-12-26 12:12:11 UTC
Description of problem:

Hi.
I have a luks device already clevis-pined and when I try to 'regen':

-> clevis luks list -d /dev/nvme0n1p3
1: tpm2 '{"hash":"sha256","key":"rsa","pcr_bank":"sha256","pcr_ids":"0,1"}'
[root@dzien ~]# clevis luks regen -d /dev/nvme0n1p3 -s 1
Regenerating binding (device /dev/nvme0n1p3, slot 1):
Pin: tpm2, Config: '{"hash":"sha256","key":"rsa","pcr_bank":"sha256","pcr_ids":"0,1"}'
Do you want to proceed? [ynYN] y
WARNING:esys:src/tss2-esys/api/Esys_Load.c:324:Esys_Load_Finish() Received TPM Error 
ERROR:esys:src/tss2-esys/api/Esys_Load.c:112:Esys_Load() Esys Finish ErrorCode (0x00000921) 
ERROR: Eys_Load(0x921) - tpm:warn(2.0): authorizations for objects subject to DA protection are not allowed at this time because the TPM is in DA lockout mode
ERROR: Unable to run tpm2_load
Loading jwk to TPM2 failed!
Enter existing LUKS password: 
Warning: Value 512 is outside of the allowed entropy range, adjusting it.
WARNING:esys:src/tss2-esys/api/Esys_Create.c:375:Esys_Create_Finish() Received TPM Error 
ERROR:esys:src/tss2-esys/api/Esys_Create.c:120:Esys_Create() Esys Finish ErrorCode (0x00000921) 
ERROR: Esys_Create(0x921) - tpm:warn(2.0): authorizations for objects subject to DA protection are not allowed at this time because the TPM is in DA lockout mode
ERROR: Unable to run tpm2_create
Creating TPM2 object for jwk failed!
Invalid input!
Usage: jose jwe fmt -i JWE [-I CT] [-o JWE] [-O CT] [-c]

Converts a JWE between serialization formats

  -i JSON --input=JSON     Parse JWE from JSON
  -i FILE --input=FILE     Read JWE from FILE
  -i -    --input=-        Read JWE from standard input

  -I FILE --detached=FILE  Read decoded ciphertext from FILE
  -I -    --detached=-     Read decoded ciphertext from standard input

  -o JSON --output=JSON    Parse JWE from JSON
  -o FILE --output=FILE    Read JWE from FILE
  -o -    --output=-       Read JWE from standard input
                           Default: "-"

  -O JSON --detach=JSON    Parse JWE from JSON
  -O FILE --detach=FILE    Read JWE from FILE
  -O -    --detach=-       Read JWE from standard input

  -c      --compact        Output JWE using compact serialization

Failed to import token from file.
Error saving metadata to LUKS2 header in device /dev/nvme0n1p3
Unable to update metadata; operation cancelled
Unable to regenerate binding in /dev/nvme0n1p3:1
-----

It's a fresh install on AMD hardware, 'regen' needed for PCRs changed after PCI HW changes.

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

clevis-luks-18-5.el9.x86_64
tpm2-tools-5.0-10.el9.x86_64

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Micah Abbott 2023-05-10 15:11:35 UTC
(In reply to lejeczek from comment #0)

> ERROR: Unable to run tpm2_load

> ERROR: Unable to run tpm2_create

These items are part of the `tpm2-tools` package; I've recategorized this BZ appropriately.

Comment 2 Štěpán Horáček 2023-05-11 14:03:19 UTC
Does this problem still persist?

I tried to reproduce it on a VM, but was unable to.

[root@localhost ~]# clevis luks list -d file
1: tpm2 '{"hash":"sha256","key":"rsa","pcr_bank":"sha256","pcr_ids":"0,1"}'
[root@localhost ~]# clevis luks regen -d file -s 1
Regenerating binding (device file, slot 1):
Pin: tpm2, Config: '{"hash":"sha256","key":"rsa","pcr_bank":"sha256","pcr_ids":"0,1"}'
Do you want to proceed? [ynYN] y
Warning: Value 512 is outside of the allowed entropy range, adjusting it.
Binding regenerated successfully
[root@localhost ~]# tpm2_pcrextend 0:sha256=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
[root@localhost ~]# clevis luks regen -d file -s 1
Regenerating binding (device file, slot 1):
Pin: tpm2, Config: '{"hash":"sha256","key":"rsa","pcr_bank":"sha256","pcr_ids":"0,1"}'
Do you want to proceed? [ynYN] y
WARNING:esys:src/tss2-esys/api/Esys_Unseal.c:295:Esys_Unseal_Finish() Received TPM Error
ERROR:esys:src/tss2-esys/api/Esys_Unseal.c:98:Esys_Unseal() Esys Finish ErrorCode (0x0000099d)
ERROR: Esys_Unseal(0x99D) - tpm:session(1):a policy check failed
ERROR: Unable to run tpm2_unseal
Unsealing jwk from TPM failed!
Enter existing LUKS password:
Warning: Value 512 is outside of the allowed entropy range, adjusting it.
Binding regenerated successfully
[root@localhost ~]# tpm2_clear
[root@localhost ~]# clevis luks regen -d file -s 1
Regenerating binding (device file, slot 1):
Pin: tpm2, Config: '{"hash":"sha256","key":"rsa","pcr_bank":"sha256","pcr_ids":"0,1"}'
Do you want to proceed? [ynYN] y
WARNING:esys:src/tss2-esys/api/Esys_Load.c:324:Esys_Load_Finish() Received TPM Error
ERROR:esys:src/tss2-esys/api/Esys_Load.c:112:Esys_Load() Esys Finish ErrorCode (0x000001df)
ERROR: Eys_Load(0x1DF) - tpm:parameter(1):integrity check failed
ERROR: Unable to run tpm2_load
Loading jwk to TPM2 failed!
Enter existing LUKS password:
Warning: Value 512 is outside of the allowed entropy range, adjusting it.
Binding regenerated successfully

Changed the PCR and also cleared the TPM, but in both cases the regeneration was successful.

Comment 3 Jerry Snitselaar 2023-05-11 15:21:08 UTC
"authorizations for objects subject to DA protection are not allowed at this time because the TPM is in DA lockout mode"

It looks like the TPM on that system is locked out.

Comment 5 RHEL Program Management 2023-06-26 07:28:08 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 6 Red Hat Bugzilla 2023-10-25 04:25:02 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days