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>
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;
}