From: Gerd Hoffmann Date: Wed, 14 Jan 2026 10:47:45 +0000 (+0100) Subject: hw/uefi: fix size negotiation X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46dee71a945d50639586ca3365be29aa9f368bfd;p=thirdparty%2Fqemu.git hw/uefi: fix size negotiation Payload size is the variable request size, not the total buffer size. Take that into account and subtract header sizes. Fixes: db1ecfb473ac ("hw/uefi: add var-service-vars.c") Signed-off-by: Gerd Hoffmann Message-ID: <20260114104745.3465860-1-kraxel@redhat.com> --- diff --git a/hw/uefi/var-service-vars.c b/hw/uefi/var-service-vars.c index 52845e9723..94f40ef236 100644 --- a/hw/uefi/var-service-vars.c +++ b/hw/uefi/var-service-vars.c @@ -593,7 +593,7 @@ uefi_vars_mm_get_payload_size(uefi_vars_state *uv, mm_header *mhdr, return uefi_vars_mm_error(mhdr, mvar, EFI_BAD_BUFFER_SIZE); } - ps->payload_size = uv->buf_size; + ps->payload_size = uv->buf_size - sizeof(*mhdr) - sizeof(*mvar); mvar->status = EFI_SUCCESS; return length; }