[PATCH 1/3] uefirtvariable: Check new VariableNameSize from GetNextVariableName()

Colin Ian King colin.king at canonical.com
Wed Mar 6 11:32:26 UTC 2013


On 06/03/13 11:27, Matt Fleming wrote:
> On Tue, 2013-03-05 at 21:54 +0000, Matt Fleming wrote:
>> From: Matt Fleming <matt.fleming at intel.com>
>>
>> Some firmware implementations update VariableNameSize in
>> GetNextVariableName() with a value that is larger than the actual
>> buffer required to hold the VariableName string. This is not
>> technically a bug, but most implementations do update VariableNameSize
>> with the value of strlen(VariableName) + 1, so print a warning if a
>> different value is found.
>>
>> Signed-off-by: Matt Fleming <matt.fleming at intel.com>
>> ---
>>   src/uefi/uefirtvariable/uefirtvariable.c | 74 +++++++++++++++++++++++++++++++-
>>   1 file changed, 72 insertions(+), 2 deletions(-)
>
> Folks, I was fairly certain that there were no implementations in the
> wild that failed to update VariableNameSize on EFI_SUCCESS, but I've
> just been informed that there are some.

Urgh, is this because the spec is a tad ambiguous that we're seeing this 
in the wild?

>
> You may or may not want to take this patch, since it is warning about an
> undocumented behaviour - albeit one that many implementations exhibit.
>

One of the remits of fwts is to catch ambiguous behaviour so firmware 
can be fixed before it gets released.  Will catching this kind of 
behaviour be useful? If so, there seems merit to keeping it.

Colin




More information about the fwts-devel mailing list