ShellPkg/UefiHandleParsingLib: support handle list growth#12289
Merged
mergify[bot] merged 2 commits intotianocore:masterfrom Mar 26, 2026
Merged
ShellPkg/UefiHandleParsingLib: support handle list growth#12289mergify[bot] merged 2 commits intotianocore:masterfrom
mergify[bot] merged 2 commits intotianocore:masterfrom
Conversation
da668e5 to
eb2585c
Compare
mdkinney
reviewed
Mar 13, 2026
5e0e69d to
ceb1eb3
Compare
mdkinney
reviewed
Mar 14, 2026
bdba2df to
55bcb31
Compare
mdkinney
approved these changes
Mar 15, 2026
makubacki
approved these changes
Mar 16, 2026
55bcb31 to
da29522
Compare
e40e4f2 to
ce4408c
Compare
Refactor GetHandleListByProtocol() to support additions to the handle list during its execution. Replace LocateHandle() with LocateHandleBuffer() to avoid the possibility that the buffer allocated for LocateHandle() is too small if additional handles are added during GetHandleListByProtocol() execution. Note that the previous implementation did not detect the handle list growth and would cause memory corruption when writing the terminating NULL handle to the allocated buffer. Signed-off-by: Bob Morgan <bobm@nvidia.com>
ce4408c to
3658134
Compare
Member
|
@bobm21 Why forced push changes after review? |
Contributor
Author
Sorry, wasn't sure if I needed to rebase on tip. |
Member
Mergify handles that automatically when push label is set. |
Merge Queue Status
This pull request spent 1 hour 19 minutes 25 seconds in the queue, including 28 minutes 35 seconds running CI. Required conditions to merge
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor GetHandleListByProtocol() to support additions to the handle list during its execution. Replace LocateHandle() with LocateHandleBuffer() to avoid the possibility that the buffer allocated for LocateHandle() is too small if additional handles
are added during GetHandleListByProtocol() execution.
Note that the previous implementation did not detect the handle list growth and would cause memory
corruption when writing the terminating NULL handle to the allocated buffer.
Description
Fixes an intermittent problem where the second LocateHandle call in the EFI_BUFFER_TOO_SMALL handling also failed with EFI_BUFFER_TOO_SMALL due to a handle being added between the two LocateHandle calls, but since Status of the second call is not checked, the writing of the NULL terminating entry using the new Size value in HandleList[Size/sizeof (EFI_HANDLE)] corrupted the allocated buffer trailer causing an ASSERT when the HandleList was freed.
How This Was Tested
Re-ran the repetitive test that had been hitting the intermittent failure.
Integration Instructions
N/A