ACK: [PATCH 3/4] uefirtvariable: skip test when specific attributes not supported (LP: #1356199)

Alex Hung alex.hung at canonical.com
Wed Aug 13 09:52:58 UTC 2014


On 08/13/2014 04:00 PM, Ivan Hu wrote:
>  From UEFI spec, when firmware doesn't support these operations with
> EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS or EFI_VARIABLE_TIME_BASED_AUTHENTICATED
> _WRITE_ACCESS or EFI_VARIABLE_APPEND_WRITE attributes are set,
> EFI_INVALID_PARAMETER shall be returned.
> When fwts gets the EFI_INVALID_PARAMETER returned with any of the attribute is set, skip the test.
>
> Signed-off-by: Ivan Hu <ivan.hu at canonical.com>
> ---
>   src/uefi/uefirtvariable/uefirtvariable.c |   13 +++++++++++++
>   1 file changed, 13 insertions(+)
>
> diff --git a/src/uefi/uefirtvariable/uefirtvariable.c b/src/uefi/uefirtvariable/uefirtvariable.c
> index 6a22c80..a69c804 100644
> --- a/src/uefi/uefirtvariable/uefirtvariable.c
> +++ b/src/uefi/uefirtvariable/uefirtvariable.c
> @@ -780,6 +780,19 @@ static int setvariable_insertvariable(
>   	ioret = ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable);
>
>   	if (ioret == -1) {
> +		if ((status == EFI_INVALID_PARAMETER) &&
> +			((attributes | FWTS_UEFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS) ||
> +			(attributes | FWTS_UEFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS) ||
> +			(attributes | FWTS_UEFI_VARIABLE_APPEND_WRITE))) {
> +			fwts_uefi_print_status_info(fw, status);
> +			fwts_skipped(fw,
> +				"EFI_INVALID_PARAMETER shall be returned, "
> +				"when firmware doesn't support these operations "
> +				"with EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS or "
> +				"EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS "
> +				"EFI_VARIABLE_APPEND_WRITE attributes is set.");
> +			return FWTS_SKIP;
> +		}
>   		if (datasize == 0)
>   			fwts_failed(fw, LOG_LEVEL_HIGH,
>   				"UEFIRuntimeSetVariable",
>
Acked-by: Alex Hung <alex.hung at canonical.com>



More information about the fwts-devel mailing list