tianocore / edk2

EDK II
https://github.com/tianocore/tianocore.github.io/wiki/EDK-II
Other
4.38k stars 2.4k forks source link

AmdSev: enable kernel hashes without initrd #5830

Closed fitzthum closed 4 days ago

fitzthum commented 1 week ago

5769 does not allow for the situation where kernel hashes is used but an initrd is not provided. Thankfully it's easy to support this.

If kernel hashes are enabled but no initrd is provided, QEMU will still create an entry in the hash table, but it will be the hash of an empty buffer.

Remove the explicit check for the length of the blob. This logic will be handled by the later hash comparison, which will still fail when the blob is not present but is expected, but will pass when the blob is not present and the hash table contains a hash of an empty buffer.

cc: @bssrikanth @dubek @tlendacky @ardbiesheuvel @kraxel

bssrikanth commented 1 week ago

This fixes the issue reported.

Tested-by: Srikanth Aithal sraithal@amd.com

tlendacky commented 1 week ago

Is the same issue present if -append isn't specified and, if so, this patch takes care of that situation as well?

fitzthum commented 1 week ago

@tlendacky

Is the same issue present if -append isn't specified and, if so, this patch takes care of that situation as well?

If you don't specify append, QEMU will provide a 1-byte blob (\0) and use this value to calculate the expected hash for the table. There is no issue with the blob having zero size.

Btw if you don't provide -kernel then you can't do a direct boot so no issue there either.

bssrikanth commented 6 days ago

When is this fix planned to be merged?