[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/1] grub-core/loader/efi/fdt.c: do not copy random memory
From: |
Leif Lindholm |
Subject: |
Re: [PATCH 1/1] grub-core/loader/efi/fdt.c: do not copy random memory |
Date: |
Mon, 17 Dec 2018 21:14:26 +0000 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Mon, Dec 17, 2018 at 10:00:24PM +0100, Heinrich Schuchardt wrote:
> We should not try to copy any memory area which is outside of the original
> fdt. If this extra memory is controlled by a hypervisor this might end
> with a crash.
>
> Signed-off-by: Heinrich Schuchardt <address@hidden>
Whoops, yes.
Reviewed-by: Leif Lindholm <address@hidden>
> ---
> grub-core/loader/efi/fdt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/grub-core/loader/efi/fdt.c b/grub-core/loader/efi/fdt.c
> index a18ca8ccb..ee9c5592c 100644
> --- a/grub-core/loader/efi/fdt.c
> +++ b/grub-core/loader/efi/fdt.c
> @@ -66,7 +66,7 @@ grub_fdt_load (grub_size_t additional_size)
>
> if (raw_fdt)
> {
> - grub_memmove (fdt, raw_fdt, size);
> + grub_memmove (fdt, raw_fdt, size - additional_size);
> grub_fdt_set_totalsize (fdt, size);
> }
> else
> --
> 2.19.2
>