diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2019-09-08 11:37:07 +0200 |
---|---|---|
committer | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2019-09-11 21:51:38 +0200 |
commit | 8262578535f18cdab95318828e6fd6464721ac54 (patch) | |
tree | 6241505eaf59f35fef0ed515e6318c73155ab531 /lib/efi_loader | |
parent | 11335c0439aa76bc5ed32b1ccfcab9995e2eac6b (diff) | |
download | u-boot-8262578535f18cdab95318828e6fd6464721ac54.tar.gz u-boot-8262578535f18cdab95318828e6fd6464721ac54.tar.xz u-boot-8262578535f18cdab95318828e6fd6464721ac54.zip |
efi_loader: parameter checks EFI_FILE_PROTOCOL.SetInfo()
We do not support volume label changes. No parameter checks are needed
here.
When the info for as file is changed the buffer must always contain a file
name.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'lib/efi_loader')
-rw-r--r-- | lib/efi_loader/efi_file.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c index 71582e5149..6d3f680e56 100644 --- a/lib/efi_loader/efi_file.c +++ b/lib/efi_loader/efi_file.c @@ -695,7 +695,9 @@ static efi_status_t EFIAPI efi_file_setinfo(struct efi_file_handle *file, char *new_file_name, *pos; loff_t file_size; - if (buffer_size < sizeof(struct efi_file_info)) { + /* The buffer will always contain a file name. */ + if (buffer_size < sizeof(struct efi_file_info) + 2 || + buffer_size < info->size) { ret = EFI_BAD_BUFFER_SIZE; goto out; } @@ -735,12 +737,8 @@ static efi_status_t EFIAPI efi_file_setinfo(struct efi_file_handle *file, * TODO: Support read only */ ret = EFI_SUCCESS; - } else if (!guidcmp(info_type, &efi_file_system_info_guid)) { - if (buffer_size < sizeof(struct efi_file_system_info)) { - ret = EFI_BAD_BUFFER_SIZE; - goto out; - } } else { + /* TODO: We do not support changing the volume label */ ret = EFI_UNSUPPORTED; } out: |