lkml.org 
[lkml]   [2013]   [Sep]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86: EFI stub support for large memory maps
On Fri, 23 Aug, at 03:02:51PM, Linn Crosetto wrote:
> This patch fixes a problem with EFI memory maps larger than 128 entries
> when booting using the EFI stub, which results in overflowing e820_map
> in boot_params and an eventual halt when checking the map size in
> sanitize_e820_map().
>
> If the number of map entries is greater than what can fit in e820_map,
> add the extra entries to the setup_data list using type SETUP_E820_EXT.
> These extra entries are then picked up when the setup_data list is
> parsed in parse_e820_ext().
>
> Signed-off-by: Linn Crosetto <linn@hp.com>
> ---
> arch/x86/boot/compressed/eboot.c | 220 ++++++++++++++++++++++++++++-----------
> 1 file changed, 157 insertions(+), 63 deletions(-)

[...]

> @@ -1016,6 +1154,19 @@ get_map:
> if (status != EFI_SUCCESS)
> goto free_mem_map;
>
> + prev_nr_desc = nr_desc;
> + nr_desc = size / desc_size;
> + if (nr_desc > prev_nr_desc &&
> + nr_desc > ARRAY_SIZE(boot_params->e820_map)) {
> + u32 nr_e820ext = nr_desc - ARRAY_SIZE(boot_params->e820_map);
> +
> + status = alloc_e820ext(nr_e820ext, &e820ext, &e820ext_size);
> + if (status != EFI_SUCCESS)
> + return status;

In the error path shouldn't we jump to free_mem_map to avoid leaking
memory?

--
Matt Fleming, Intel Open Source Technology Center


\
 
 \ /
  Last update: 2013-09-06 12:21    [W:0.248 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site