mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-18 13:11:31 +00:00
efi_loader: loosen check of parameters of efi_file_open()
The UEFI spec requires that attributes are only set for when EFI_FILE_MODE_CREATE is set in open_mode. The SCT tries to read a directory with EFI_FILE_DIRECTORY. As EDK2 allows this we should not be more strict. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
1c381cebb7
commit
bd66588657
1 changed files with 10 additions and 1 deletions
|
@ -229,7 +229,16 @@ static efi_status_t EFIAPI efi_file_open(struct efi_file_handle *file,
|
|||
ret = EFI_INVALID_PARAMETER;
|
||||
goto out;
|
||||
}
|
||||
if ((!(open_mode & EFI_FILE_MODE_CREATE) && attributes) ||
|
||||
/*
|
||||
* The UEFI spec requires that attributes are only set in create mode.
|
||||
* The SCT does not care about this and sets EFI_FILE_DIRECTORY in
|
||||
* read mode. EDK2 does not check that attributes are zero if not in
|
||||
* create mode.
|
||||
*
|
||||
* So here we only check attributes in create mode and do not check
|
||||
* that they are zero otherwise.
|
||||
*/
|
||||
if ((open_mode & EFI_FILE_MODE_CREATE) &&
|
||||
(attributes & (EFI_FILE_READ_ONLY | ~EFI_FILE_VALID_ATTR))) {
|
||||
ret = EFI_INVALID_PARAMETER;
|
||||
goto out;
|
||||
|
|
Loading…
Add table
Reference in a new issue