rhboot / shim

UEFI shim loader
Other
816 stars 284 forks source link

FreePages() is used to return memory allocated by AllocatePages() #580

Closed dennis-tseng99 closed 11 months ago

dennis-tseng99 commented 1 year ago

There are several EFI_UNSUPPORTED exceptions in handle_image() of pe.c Some of them are missing returning page memory to firmware by FreePages(); while some of them are using unmatched FreePoll() function which implicitly is uefi_call_wrapper(BS->FreePool, 1, Buffer) to return memory. According to UEFI spec 2.0, FreePoll() is only used for AllocatePoll() when memory is returned to the available pool.

dennis-tseng99 commented 11 months ago

@jsetje, I've dropped the diff in relocate_coff(). Thank you so much.

vathpela commented 11 months ago

I've pushed this as 1e985a3a238100ca5f4bda3e269a9eaec9bda74b.