]> xenbits.xensource.com Git - people/gdunlap/xen.git/commit
EFI: fix getting EFI variable list on some systems
authorRoss Lagerwall <ross.lagerwall@citrix.com>
Tue, 10 Mar 2015 12:52:01 +0000 (13:52 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 10 Mar 2015 12:52:01 +0000 (13:52 +0100)
commit1f4eb9d27d0ebd62a0b6cdff8213726f5ae8f25c
tree559ed38762ac526a1711d255059c51f7d62eff06
parentb5f90278f5a5c9658a481a99f6a18bf4badba616
EFI: fix getting EFI variable list on some systems

Copy the entire output buffer to the guest because some firmwares update
size on successful calls (contrary to the spec) and the buffer may
contain data beyond the output size that the firmware requires on a
subsequent GetNextVariableName() call (e.g. a NULL character).

Note that this shouldn't change the amount of data copied because on success, a
compliant firmware does not change size and so the entire buffer is copied
anyway.  If size is changed, Xen does not copy the buffer.

Without this change, the following (simplified) sequence would occur:
GetNextVariableName: in \0, size 1024 || out AdminPw\0, size 7
GetNextVariableName: in AdminPw\0, size 1024 || out UserPw\0, size 6
GetNextVariableName: in UserPww\0, size 1024 || NOT FOUND

This was seen on an Intel S1200RP_SE with firmware
S1200RP.86B.02.02.0005.102320140911, version 4.6, date 2014-10-23.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/common/efi/runtime.c