Skip to content
New issue

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

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

Already on GitHub? # to your account

Increase Temp Buffer Size in FillMemoryMap() Routine #213

Merged

Conversation

TaylorBeebe
Copy link
Contributor

@TaylorBeebe TaylorBeebe commented Dec 16, 2022

Description

Platforms with many differences between the EFI and GCD memory maps can overflow the temp buffer allocated at the start of FillInMemoryMap(). This PR updates the size of the temp buffer to be quadruple the size of the input EFI memory map to accommodate extra entries. At the end of the routine, the contents of the temp buffer are copied into a new buffer which is strictly the required size and the temp buffer is freed.

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

Booting to shell

Integration Instructions

N/A

@apop5
Copy link
Contributor

apop5 commented Dec 16, 2022

Would it be better to create a PCD that determines the multiplier for additional entries and default it to 2 or 4?

@TaylorBeebe
Copy link
Contributor Author

Would it be better to create a PCD that determines the multiplier for additional entries and default it to 2 or 4?

This seems like it would be confusing. The buffer allocated at the start of the routine is just temporary. At the end of the routine, the contents of the temp buffer are copied to a new buffer which is only the required size and the temp buffer is freed.

@TaylorBeebe TaylorBeebe merged commit ce33fcf into microsoft:release/202208 Dec 16, 2022
@TaylorBeebe TaylorBeebe deleted the increase_temp_buffer_size branch November 10, 2023 17:44
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants