[U-Boot] [PATCH] efi_loader: initialize device path on alloc
Heinrich Schuchardt
xypron.glpk at gmx.de
Sun Mar 25 19:38:51 UTC 2018
On 03/25/2018 07:54 PM, Patrick Wildt wrote:
> Since the backing memory for a new device path can contain stale
> data we have to make sure that we zero the buffer. Otherwise some
> code paths that don't set all fields in a structure backed by this
> device path might contain unwanted stale data.
>
> Signed-off-by: Patrick Wildt <patrick at blueri.se>
Thank you for the patch.
Reviewed-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
> ---
> lib/efi_loader/efi_device_path.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c
> index 3c735e60d3..20f5c83219 100644
> --- a/lib/efi_loader/efi_device_path.c
> +++ b/lib/efi_loader/efi_device_path.c
> @@ -66,6 +66,7 @@ static void *dp_alloc(size_t sz)
> return NULL;
> }
>
> + memset(buf, 0, sz);
> return buf;
> }
>
>
More information about the U-Boot
mailing list