From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH] EFI: Fix getting EFI variable list on some systems Date: Mon, 9 Mar 2015 17:20:07 +0000 Message-ID: <54FDD647.7070806@citrix.com> References: <1425919679-22436-1-git-send-email-ross.lagerwall@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1425919679-22436-1-git-send-email-ross.lagerwall@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ross Lagerwall , xen-devel@lists.xen.org Cc: Jan Beulich List-Id: xen-devel@lists.xenproject.org On 09/03/15 16:47, Ross Lagerwall wrote: > 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 Reviewed-by: Andrew Cooper > --- > 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; > }