[syslinux] [PATCH] efi: Suspicious size reduction in emalloc

Gene Cumm gene.cumm at gmail.com
Thu Feb 13 03:24:58 PST 2014


On Wed, Feb 12, 2014 at 9:20 PM,  <celelibi at gmail.com> wrote:
> From: Sylvain Gault <sylvain.gault at gmail.com>
>
> It could happen on 32 bits architecture that the memory size really allocated
> could be less than required. On 64 bits, allocate_pages may be called
> more times than needed.
>
> This closes bug #39.
>
> Signed-off-by: Sylvain Gault <sylvain.gault at gmail.com>
> ---
>  efi/main.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/efi/main.c b/efi/main.c
> index 0e6b137..94878f9 100644
> --- a/efi/main.c
> +++ b/efi/main.c
> @@ -691,10 +691,8 @@ EFI_STATUS emalloc(UINTN size, UINTN align, EFI_PHYSICAL_ADDRESS *addr)
>                 /* Low-memory is super-precious! */
>                 if (end <= 1 << 20)
>                         continue;
> -               if (start < 1 << 20) {
> -                       size -= (1 << 20) - start;
> +               if (start < 1 << 20)
>                         start = (1 << 20);
> -               }
>
>                 aligned = (start + align -1) & ~(align -1);

Geert, it looks like the thread got broken apart

-- 
-Gene


More information about the Syslinux mailing list