This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
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 2234774 - virt-qemu-sev-validate broken when providing --cpu-family/model/stepping without --loader
Summary: virt-qemu-sev-validate broken when providing --cpu-family/model/stepping with...
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: libvirt
Version: 9.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Daniel Berrangé
QA Contact: Luyao Huang
URL:
Whiteboard:
Depends On:
Blocks: 2234361
TreeView+ depends on / blocked
 
Reported: 2023-08-25 12:49 UTC by Daniel Berrangé
Modified: 2023-09-22 18:10 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-09-22 18:10:56 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   RHEL-7570 0 None Migrated None 2023-09-22 18:10:53 UTC
Red Hat Issue Tracker RHELPLAN-166996 0 None None None 2023-08-30 16:36:42 UTC

Description Daniel Berrangé 2023-08-25 12:49:06 UTC
Description of problem:
The following command line should validate a SEV guest, overriding the CPU model/stepping/family that are otherwise extracted from libvirt. 

# virt-qemu-sev-validate --tik sev_es_dhcert_tik.bin --tek sev_es_dhcert_tek.bin --domain berrange --insecure --debug --cpu-model 1 --cpu-family 25 --cpu-stepping 1
[DEBUG]: TIK(hex): 5802c018ba97b67cffb6e4634e613727
[DEBUG]: TEK(hex): 5e766810c034d98345946884483198f0
  File "/usr/bin/virt-qemu-sev-validate", line 1301, in main
    attest(args)
  File "/usr/bin/virt-qemu-sev-validate", line 1262, in attest
    cvm.build_vmsas(args.cpu_family,
  File "/usr/bin/virt-qemu-sev-validate", line 713, in build_vmsas
    ovmf.load(self.firmware)
  File "/usr/bin/virt-qemu-sev-validate", line 469, in load
    actual = content[-48:-32]
ERROR: 'NoneType' object is not subscriptable

The failure is because when --cpu-family/model/stepping args are provided in combination with --domain, we try to build the VMSA before we've acquired the firmware.

Adding --firmware to the above args is a workaround

# virt-qemu-sev-validate --tik sev_es_dhcert_tik.bin --tek sev_es_dhcert_tek.bin --domain berrange --insecure --debug --cpu-model 1 --cpu-family 25 --cpu-stepping 1 --firmware /usr/share/edk2/ovmf/OVMF.amdsev.fd 
[DEBUG]: Firmware(sha256): 906a0dcb21704b36758493a7e29b6f4102f50fd0dd800a04742c0f69f3ed6e19
[DEBUG]: TIK(hex): 5802c018ba97b67cffb6e4634e613727
[DEBUG]: TEK(hex): 5e766810c034d98345946884483198f0
[DEBUG]: VMSA CPU 0(sha256): f8b52f775502472e5797d2674d9de21f6abc05dc05e9bc49cbb7b6a13688d5e7
[DEBUG]: VMSA CPU 1(sha256): bcee5cb289f72882da17abd8dca5e8a7e9f8e2033e7ad96b4db0ab1a383a6487
[DEBUG]: VM: id=1 name=berrange uuid=99999999-7f0d-44c3-abee-eb1424bb23e7
[DEBUG]: VMSA(sha256): 0e5246de248812527b171d60d6851f37875ac4b22063f73f4e56d0dc4546d192
[DEBUG]: Measured-data(sha256): 4a470ecd611f292e0e168828688c9d24539a05131a96ce092397a74c1cbad0d2
[DEBUG]: Measured-msg(hex): 04013705070000004a470ecd611f292e0e168828688c9d24539a05131a96ce092397a74c1cbad0d2233e47003f79b80fa1177bfe04195f92
[DEBUG]: Measurement reported(hex): aa0b21bb54bab669025cdefa744c2026ccdae77e9ac25196e0530bb7eb84b353
[DEBUG]: Measurement computed(hex): aa0b21bb54bab669025cdefa744c2026ccdae77e9ac25196e0530bb7eb84b353
OK: Looks good to me



Version-Release number of selected component (if applicable):
libvirt-client-qemu-9.5.0-5.el9.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Use virt-qemu-sev-validate with --domain and --cpu-family/model/stepping, and WITHOUT --firmware

Actual results:
Exception trace

Expected results:
Validates guest

Additional info:

Comment 1 Daniel Berrangé 2023-08-25 12:54:17 UTC
This flaw is fixed by this patch

https://listman.redhat.com/archives/libvir-list/2023-August/241466.html

Comment 2 Jaroslav Suchanek 2023-08-28 10:57:50 UTC
Please move it to POST, once the patches are pushed upstream. Thanks.

Comment 9 RHEL Program Management 2023-09-22 18:10:05 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 10 RHEL Program Management 2023-09-22 18:10:56 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.


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