Created attachment 1425753 [details] Patch fixing UEFI Signature List iteration Description of problem: The dbxtool fails to display the content of the UEFI signature database (db) on my system when invoked like this: dbxtool --list --dbx /sys/firmware/efi/efivars/db-d719b2cb-3d3a-4596-a3bc-dad00e67656f Version-Release number of selected component (if applicable): 8-3.fc27 How reproducible: Always Steps to Reproduce: 1. login to a system with more than one entry in its UEFI signature database (db) 2. run the following command while replacing the <guid> with a signature database GUID specific to your system: dbxtool --list --dbx /sys/firmware/efi/efivars/db-<guid> Actual results: Only the first entry is printed, after which an error is reported: 1: {microsoft} {x509_cert} <certificate hex dump here> dbxtool: EFI Signature List is malformed dbxtool: list has 3991 bytes left, element is 1543 bytes Expected results: All entries are printed, no error is reported. Additional info: The problem seems to be in the EFI signature list iterator's esl_iter_next function. The attached patch fixes it for me.
Created attachment 1426574 [details] Patch fixing UEFI Signature List iteration Improved version of the patch with more appropriate validation.
The bug is still present in Fedora 28.
Hi Michal, I've just found out about this BZ -- it looks like a duplicate of earlier bug 1508808. Fixing the issue is actually possible with a one-liner (more precisely: a one *character*) patch. Can you please check if the scratch builds in bug 1508808 comment 25 work for you? If they do, I suggest that we close bug 1570980 (i.e., this bug) as a duplicate of bug 1508808. Thank you, Laszlo
Hi Laszlo, the scratch build does fix the problem for me. However as things stand now, the previously broken check is not performed for the very first element in the list. In addition the X.509 certificate ASN.1 check performed just below the previously broken check - [1], is AFAICT duplicated by an identical check in the esd_iter_next function - [2]. My patch addresses both of these issues, so it might be worth considering using it in preference to the one liner from bug 1508808. Thanks, Michal [1] https://github.com/rhboot/dbxtool/blob/338a2d097b79faba9505a913c2cfc5916b6ffa9a/src/iter.c#L231-L248 [2] https://github.com/rhboot/dbxtool/blob/338a2d097b79faba9505a913c2cfc5916b6ffa9a/src/iter.c#L104-L120
OK, thanks for the feedback. Both BZs are now cross-referenced, so Peter should find them both regardless of which one he checks out first. Feel free to comment on the other BZ as well, of course! Peter should decide which BZ to close as the duplicate of the other. Thank you! Laszlo
This message is a reminder that Fedora 27 is nearing its end of life. On 2018-Nov-30 Fedora will stop maintaining and issuing updates for Fedora 27. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '27'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 27 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 27 changed to end-of-life (EOL) status on 2018-11-30. Fedora 27 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.