mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-25 06:46:00 +00:00
efi_loader: validate device path length in boot manager
Bootxxxx variables are provided by the user and therefore cannot be trusted. We have to validate them before usage. A device path provided by a Bootxxxx variable must have an end node within the indicated device path length. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
parent
5bba77e48b
commit
15d8f008dc
1 changed files with 2 additions and 4 deletions
|
@ -105,10 +105,8 @@ efi_status_t efi_deserialize_load_option(struct efi_load_option *lo, u8 *data,
|
||||||
if (*size < len)
|
if (*size < len)
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
lo->file_path = (struct efi_device_path *)data;
|
lo->file_path = (struct efi_device_path *)data;
|
||||||
/*
|
if (efi_dp_check_length(lo->file_path, len) < 0)
|
||||||
* TODO: validate device path. There should be an end node within
|
return EFI_INVALID_PARAMETER;
|
||||||
* the indicated file_path_length.
|
|
||||||
*/
|
|
||||||
data += len;
|
data += len;
|
||||||
*size -= len;
|
*size -= len;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue