From: Jan Beulich Date: Thu, 6 Feb 2020 08:52:33 +0000 (+0100) Subject: EFI: don't leak heap contents through XEN_EFI_get_next_variable_name X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~735 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4783ee894f6bfb0f4deec9f1fe8e7faceafaa1a2;p=xen.git EFI: don't leak heap contents through XEN_EFI_get_next_variable_name Commit 1f4eb9d27d0e ("EFI: fix getting EFI variable list on some systems") switched to using the caller provided size for the copy-out without making sure the copied buffer is properly scrubbed. Reported-by: Ilja Van Sprundel Signed-off-by: Jan Beulich Reviewed-by: George Dunlap --- diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c index 752e604390..95367694b5 100644 --- a/xen/common/efi/runtime.c +++ b/xen/common/efi/runtime.c @@ -571,7 +571,7 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op) return -EINVAL; size = op->u.get_next_variable_name.size; - name.raw = xmalloc_bytes(size); + name.raw = xzalloc_bytes(size); if ( !name.raw ) return -ENOMEM; if ( copy_from_guest(name.raw, op->u.get_next_variable_name.name,