[U-Boot] [PATCH v2 18/23] efi_loader: implement a pseudo "file delete"
Alexander Graf
agraf at suse.de
Tue Sep 4 09:16:38 UTC 2018
On 04.09.18 09:49, AKASHI Takahiro wrote:
> This patch is necessary to run SCT.efi (UEFI Self-Certification Test).
> Returning EFI_SUCCESS can cheat SCT execution.
>
> Signed-off-by: AKASHI Takahiro <takahiro.akashi at linaro.org>
How hard would it be to implement a real delete instead?
Alex
> ---
> lib/efi_loader/efi_file.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c
> index 6ec98c80227e..12044a0c7196 100644
> --- a/lib/efi_loader/efi_file.c
> +++ b/lib/efi_loader/efi_file.c
> @@ -226,12 +226,20 @@ static efi_status_t EFIAPI efi_file_close(struct efi_file_handle *file)
> return EFI_EXIT(file_close(fh));
> }
>
> +static efi_status_t EFIAPI efi_file_write(struct efi_file_handle *file,
> + efi_uintn_t *buffer_size,
> + void *buffer);
> +
> static efi_status_t EFIAPI efi_file_delete(struct efi_file_handle *file)
> {
> struct file_handle *fh = to_fh(file);
> + efi_uintn_t size = 0;
> EFI_ENTRY("%p", file);
> +
> + /* TODO: implement real 'delete' */
> + efi_file_write(file, &size, NULL);
> file_close(fh);
> - return EFI_EXIT(EFI_WARN_DELETE_FAILURE);
> + return EFI_SUCCESS;
> }
>
> static efi_status_t file_read(struct file_handle *fh, u64 *buffer_size,
>
More information about the U-Boot
mailing list