From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ilias Apalodimas Date: Mon, 11 May 2020 13:00:41 +0300 Subject: [PATCH 3/6] efi_loader: Implement EFI variable handling via OP-TEE In-Reply-To: <66ec53db-ec5f-139a-8505-08c5885df2de@gmx.de> References: <20200506191246.237790-1-ilias.apalodimas@linaro.org> <20200506191246.237790-4-ilias.apalodimas@linaro.org> <66ec53db-ec5f-139a-8505-08c5885df2de@gmx.de> Message-ID: <20200511100041.GA76988@apalos.home> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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