From: Zhou JianFeng <[email protected]> Memory freed by function grub_efi_free_pages() with wrong pages will not be removed from list efi_allocated_memory by function grub_efi_drop_alloc(), it will be freed again by function grub_efi_memory_fini() which is called by function grub_machine_fini()/grub_exit() when exit grub. Freeing memory twice may lead to unpredictable result.
Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Zhou JianFeng <[email protected]> --- grub-core/kern/efi/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c index 6a6fba891..49daa976f 100644 --- a/grub-core/kern/efi/mm.c +++ b/grub-core/kern/efi/mm.c @@ -643,7 +643,7 @@ grub_efi_mm_add_regions (grub_size_t required_bytes, unsigned int flags) /* Release the memory maps. */ grub_efi_free_pages ((grub_addr_t) memory_map, - 2 * BYTES_TO_PAGES (MEMORY_MAP_SIZE)); + 2 * BYTES_TO_PAGES (map_size)); return GRUB_ERR_NONE; } -- 2.25.1 _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel
