lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Tue,  5 May 2020 15:00:16 -0400
From:   Lenny Szubowicz <>
Subject: [PATCH] efi/libstub/x86: Free EFI map buffer in allocate_e820()

In allocate_e820(), free the EFI map buffer that has been returned
by efi_get_memory_map(). The returned size of the EFI map buffer
is used to allocate an adequately sized e820ext buffer, if it's
needed. But the contents of that EFI map buffer is not used at all
and the local pointer to it is gone on return from allocate_e820().

Signed-off-by: Lenny Szubowicz <>
 drivers/firmware/efi/libstub/x86-stub.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c
index 05ccb229fb45..4efe3e7a218d 100644
--- a/drivers/firmware/efi/libstub/x86-stub.c
+++ b/drivers/firmware/efi/libstub/x86-stub.c
@@ -623,6 +623,9 @@ static efi_status_t allocate_e820(struct boot_params *params,
 	if (status != EFI_SUCCESS)
 		return status;
+	/* Allocated EFI map buf is not used here. Just need its size. */
+	efi_bs_call(free_pool, map);
 	nr_desc = buff_size / desc_size;
 	if (nr_desc > ARRAY_SIZE(params->e820_table)) {

Powered by blists - more mailing lists