microsoft / mu_basecore

Project Mu BaseCore
https://microsoft.github.io/mu/
Other
242 stars 124 forks source link

[Bug]: UnprotectUefiImageMu Does Not Clear Attributes #1014

Closed os-d closed 4 weeks ago

os-d commented 3 months ago

Is there an existing issue for this?

Current Behavior

When unloading an image, UnprotectUefiImageMu calls into SetUefiMemoryAttributes with 0 for attributes. However that function gets the current attributes from the memory descriptor and ors those with the supplied attributes, which means the attributes can never be cleared. It also uses the ImageRecord->ImageSize as the range to clear, but that needs to be page aligned, as is done when the image is protected.

Expected Behavior

When unprotecting an image, the attributes should be cleared on a page aligned size.

Steps To Reproduce

Unprotect an image

Build Environment

- OS(s):
- Tool Chain(s):
- Targets Impacted:
All

Version Information

top of tree

Urgency

Medium

Are you going to fix this?

I will fix it

Do you need maintainer feedback?

No maintainer feedback needed

Anything else?

No response

github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had activity in 45 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.

github-actions[bot] commented 4 weeks ago

This issue has been automatically been closed because it did not have any activity in 45 days and no follow up within 7 days after being marked stale. Thank you for your contributions.