mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matt Fleming <matt@console-pimps.org>
To: Linn Crosetto <linn@hp.com>
Cc: matt.fleming@intel.com, hpa@zytor.com, tglx@linutronix.de,
	mingo@redhat.com, x86@kernel.org, yinghai@kernel.org,
	linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86: EFI stub support for large memory maps
Date: Fri, 6 Sep 2013 11:03:25 +0100	[thread overview]
Message-ID: <20130906100325.GB7579@console-pimps.org> (raw)
In-Reply-To: <1377291771-21302-1-git-send-email-linn@hp.com>

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

  reply	other threads:[~2013-09-06 10:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-23 21:02 Linn Crosetto
2013-09-06 10:03 ` Matt Fleming [this message]
2013-09-06 17:04 ` [PATCHv2] " Linn Crosetto
2013-09-17 20:14   ` Matt Fleming
2013-09-23  0:23     ` Linn Crosetto
2013-09-23  1:59   ` [PATCHv3] " Linn Crosetto
2013-09-25 12:58     ` Matt Fleming
2013-09-25 22:45       ` Linn Crosetto
2013-09-26 11:34         ` Matt Fleming
2013-09-27 23:46           ` Linn Crosetto
2013-09-30  9:22             ` Matt Fleming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130906100325.GB7579@console-pimps.org \
    --to=matt@console-pimps.org \
    --cc=hpa@zytor.com \
    --cc=linn@hp.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt.fleming@intel.com \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=yinghai@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome