[PATCH 3/6] efi_loader: Implement EFI variable handling via OP-TEE

Ilias Apalodimas ilias.apalodimas at linaro.org
Mon May 11 12:00:41 CEST 2020


On Sat, May 09, 2020 at 11:14:51AM +0200, Heinrich Schuchardt wrote:

> > +	in_name_size = u16_strsize(variable_name);

[...]

> 
> The UEFI spec requires: "The size must be large enough to fit input
> string supplied in VariableName buffer."
> 
> Further it is required to return EFI_INVALID_PARAMETER if the
> "Null-terminator is not found in the first VariableNameSize bytes of the
> input VariableName buffer."
> 
> Please, investigate if SMM takes care of the check or we should do it.
> 

Smm checks for both and returns EFI_ACCESS_DENIED. 
In any case I don't suggest convoluting this with extra UEFI spec requirements.
Variables are delegated into Smm for handling and it should handle *everything*.
Any bugs/missing corner cases we end up discovering should be fixed directly
into EDK2 and not apply random fixups here. This is an API to Smm and that's 
all it should ever do.

Regards
/Ilias
 


More information about the U-Boot mailing list