]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/uefi: fix size negotiation
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 14 Jan 2026 10:47:45 +0000 (11:47 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 3 Feb 2026 07:32:33 +0000 (08:32 +0100)
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 <kraxel@redhat.com>
Message-ID: <20260114104745.3465860-1-kraxel@redhat.com>

hw/uefi/var-service-vars.c

index 52845e9723d3d818b5e2ecb9ac2651da42ff2f92..94f40ef23684f0ddbc43c4bfbca34a49c4922e31 100644 (file)
@@ -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;
 }