]> git.baikalelectronics.ru Git - uboot.git/commit
efi_loader: check memory address before freeing
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Fri, 10 May 2019 19:21:30 +0000 (21:21 +0200)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Sun, 12 May 2019 18:54:22 +0000 (20:54 +0200)
commitc36477e6e143a34283b0f844e7474fdff2b034c7
treec6fe2338c0f0874e783fb94d745dee25bd3edbe1
parente3ed2fd897e801c51ff466936348da28165f7129
efi_loader: check memory address before freeing

When we call FreePages() we essentially add memory to our memory map. We
shouldn't do this for memory that does not exit.

Check if the memory that is to be freed via FreePages() or FreePool() is in
our memory map and is not EFI_CONVENTIONAL_MEMORY.

This check is mandated by the UEFI specification.

Cf. UEFI SCT  II (2017), 3.2.2 FreePages(), 5.1.2.1 - 5.1.2.2

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
lib/efi_loader/efi_memory.c