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 2002265 - Shim refuses to boot the system when TPM event logging fails
Summary: Shim refuses to boot the system when TPM event logging fails
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: shim
Version: 8.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Bootloader engineering team
QA Contact: Release Test Team
URL: https://github.com/rhboot/shim/pull/414
Whiteboard:
Depends On:
Blocks: 2000946 2065214
TreeView+ depends on / blocked
 
Reported: 2021-09-08 11:28 UTC by Renaud Métrich
Modified: 2022-05-10 17:01 UTC (History)
10 users (show)

Fixed In Version: shim-15.5-2.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2065214 (view as bug list)
Environment:
Last Closed: 2022-05-10 15:33:29 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github rhboot shim pull 414 0 None None None 2021-09-09 09:51:24 UTC
Red Hat Issue Tracker RHELPLAN-96537 0 None None None 2021-09-08 11:29:49 UTC
Red Hat Issue Tracker RTT-4242 0 None None None 2022-02-14 18:43:03 UTC
Red Hat Issue Tracker RTT-4243 0 None None None 2022-02-14 18:43:10 UTC
Red Hat Knowledge Base (Solution) 6321691 0 None None None 2021-09-09 12:53:00 UTC
Red Hat Product Errata RHBA-2022:2126 0 None None None 2022-05-10 15:34:09 UTC

Description Renaud Métrich 2021-09-08 11:28:31 UTC
Description of problem:

On Dell hardware (at least PowerEdge T340 with BIOS 2.6.3), when selecting option "TPM 1.2 On without Pre-Boot Measurements" in the UEFI firmware, Shim refuses to boot the system the system because the call of mirror_one_mok_variable() function on MokListRT, MokListXRT and SbatLevelRT fails.

Actually the failure is not when creating the variables, but calling tpm_log_event() (line 819):
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
 532 static EFI_STATUS NONNULL(1)
 533 mirror_one_mok_variable(struct mok_state_variable *v,
 534                         BOOLEAN only_first)
 535 {
 :
 544         BOOLEAN log = v->flags & MOK_VARIABLE_LOG;
 :
 812                 if (log) {
 813                         /*
 814                          * Log this variable into whichever PCR the table
 815                          * says.
 816                          */
 817                         EFI_PHYSICAL_ADDRESS datap =
 818                                         (EFI_PHYSICAL_ADDRESS)(UINTN)FullData,
 819                         efi_status = tpm_log_event(datap, FullDataSize,
 820                                                    v->pcr, (CHAR8 *)v->name8);
 821                         if (EFI_ERROR(efi_status)) {
 822                                 dprint(L"tpm_log_event(0x%llx, %lu, %lu, \"%s\")->%r\n",
 823                                        FullData, FullDataSize, v->pcr, v->name,
 824                                        efi_status);
 825                                 return efi_status;
 826                         }
 827                 }
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Verbose mode snippet:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
mok.c:358:mirror_mok_db() SetVariable("MokListRT", ... varsz=0x826) = Success
mok.c:792:mirror_one_mok_variable() mirror_mok_db("MokListRT",  datasz=2086) returned Success
mok.c:823:mirror_one_mok_variable() tpm_log_event(0x5C506020, 2086, 14, "MokList")->Unsupported
Could not create MokListRT: Unsupported
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------


Talking to Javier, he believes that having tpm_log_event() fail should NOT make the mirror_one_mok_variable() function fail, exactly as the code in Grub does (i.e. ignore errors at TPM level):
see patch https://src.fedoraproject.org/rpms/grub2/raw/rawhide/f/0152-tpm-Don-t-propagate-TPM-measurement-errors-to-the-ve.patch


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

All shim releases, customer reproduces with latest for RHEL8.4 (shim-x64-15.4-2.el8_1.x86_64)


How reproducible:

Always on customer system, I don't have the hardware to test myself.

Comment 1 Renaud Métrich 2021-09-09 09:51:24 UTC
I gave the customer a shim-unsigned-x64 package with the proposed patch (see https://github.com/rhboot/shim/pull/414).
The customer reported it works fine.

Comment 28 errata-xmlrpc 2022-05-10 15:33:29 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (shim bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:2126


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