All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] EFI: Fix getting EFI variable list on some systems
@ 2015-03-09 16:47 Ross Lagerwall
  2015-03-09 17:20 ` Andrew Cooper
  2015-03-10  8:44 ` Jan Beulich
  0 siblings, 2 replies; 3+ messages in thread
From: Ross Lagerwall @ 2015-03-09 16:47 UTC (permalink / raw)
  To: xen-devel; +Cc: Ross Lagerwall, Jan Beulich

Copy the entire output buffer to the guest because it may contain data beyond
the output size that the firmware requires on a subsequent
GetNextVariableName() call (e.g. a NULL character).

The spec requires that on each call, "the previous results" be passed in.

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

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
---
 xen/common/efi/runtime.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c
index 7ed5bfa..20772f3 100644
--- a/xen/common/efi/runtime.c
+++ b/xen/common/efi/runtime.c
@@ -518,7 +518,7 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
 
             if ( !EFI_ERROR(status) &&
                  copy_to_guest(op->u.get_next_variable_name.name,
-                               name.raw, size) )
+                               name.raw, op->u.get_next_variable_name.size) )
                 rc = -EFAULT;
             op->u.get_next_variable_name.size = size;
         }
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-03-10  8:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-09 16:47 [PATCH] EFI: Fix getting EFI variable list on some systems Ross Lagerwall
2015-03-09 17:20 ` Andrew Cooper
2015-03-10  8:44 ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.