Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UpdateCapsule Conformance SCT does not use a known good capsule header guid (Bugzilla Bug 4098) #231

Open
tianocore-issues opened this issue Oct 5, 2022 · 7 comments

Comments

@tianocore-issues
Copy link

This issue was created automatically with bugzilla2github

Bugzilla Bug 4098

Date: 2022-10-05T19:24:28+00:00
From: @Javagedes
To: @Javagedes
CC: edhaya.chandran

Last updated: 2024-09-05T10:37:56+00:00

@tianocore-issues
Copy link
Author

Comment 19718

Date: 2022-10-05 19:24:28 +0000
From: @Javagedes

  • Industry Specification: ---
  • Release Observed: EDK II Master
  • Releases to Fix: EDK II Master
  • Target OS: ---
  • Bugzilla Assignee(s): @Javagedes

UpdateCapsule() Conformance requires that a capsule marked CAPSULE_FLAGS_PERSIST_ACROSS_RESET must also provide a valid ScatterGatherList. In some platforms (See example [https://github.com/microsoft/mu_basecore/blob/2f7175d6bb584d5de26d6d7deb0b6da5ff6dd5c0/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c#L182]), however, if a capsule is marked as such, the capsule is validated before being persisted in memory (which is when the ScatterGatherList is verified). Due to this, those platforms fail the SCT that validates this conformance as they return EFI_UNSUPPORTED as the capsule header guid being passed to the function is not a known valid capsule header guid.

This commit updates the capsule header guid used in the MiscRuntimeService tests to use a known good capsule header guid, gWindowsUxCapsuleGuid, which causes these platforms to pass this SCT by reaching the ScatterGatherList validation, which then returns EFI_INVALID_PARAMETER.

@tianocore-issues
Copy link
Author

Comment 19719

Date: 2022-10-05 19:27:29 +0000
From: @Javagedes

Created attachment 1034
Patch

Attachment: BZ-1034-patch.patch

@tianocore-issues
Copy link
Author

Comment 19723

Date: 2022-10-06 10:11:12 +0000
From: Edhay <<edhaya.chandran>>

To be reviewed by @stuart Yoder.
This may be a corner case for the below mentioned firmware
https://github.com/microsoft/mu_basecore/blob/2f7175d6bb584d5de26d6d7deb0b6da5ff6dd5c0/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c#L182

@tianocore-issues
Copy link
Author

Comment 19727

Date: 2022-10-06 11:36:57 +0000
From: @Javagedes

Yes. The simple description of the edge case is that if a capsule has the flag CAPSULE_FLAGS_PERSIST_ACROSS_RESET set, we immediately verify we support the capsule by executing the function StageCapsuleImage() which in turn calls SupportCapsuleImage().

The capsule passed to the function fails. There are multiple ways to pass this check (See Edk2's SupportCapuleImage() https://github.com/tianocore/edk2/blob/710f83b79d6eab641401c054b2f40f6c630f8cd5/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c#L1499), but the easiest in my opinion is to use the gWindowsUxCapsuleGuid.

By making the change in the patch, the guid passes this check and makes it to the function that validates the ScatterGatherList, where it is expected to fail with an EFI_INVALID_PARAMETER.

Feel free to reach out if you have any questions.

@tianocore-issues
Copy link
Author

Comment 19927

Date: 2022-11-03 10:48:34 +0000
From: Edhay <<edhaya.chandran>>

The behavior for Capsule Update w.r.t to Capsule Header GUID to be checked offline

SupportCapsuleImage()
{
}

StageImage()
{
if(!SupportCapsuleImage())
{
return EFI_UNSUPPORTED;
}
}

  1. Can we query the SystemTable for the GUID, and set the value for the test parameter
  2. Is there a SCT test that checks the validity of the Capsule?

@tianocore-issues
Copy link
Author

Comment 21620

Date: 2023-06-01 10:08:31 +0000
From: Edhay <<edhaya.chandran>>

@joey Vagedes : Do you have any updates on the previous comment.

@tianocore-issues
Copy link
Author

Comment 23382

Date: 2024-09-05 10:37:56 +0000
From: Edhay <<edhaya.chandran>>

Edhay to reach to Microsoft for any updates on their solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant