]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
igvm: fix off by one bug in memmap entry count checking
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 29 Oct 2025 10:55:52 +0000 (11:55 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 3 Nov 2025 06:38:53 +0000 (07:38 +0100)
Fixes: c1d466d267 ("backends/igvm: Add IGVM loader and configuration")
Reviewed-by: Luigi Leonardi <leonardi@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-ID: <20251029105555.2492276-3-kraxel@redhat.com>

backends/igvm.c

index 723d45b755a0f75190c6557f8ce11dad17adeb3d..055bbba745ad5f34518ad83be847b87de3e1530c 100644 (file)
@@ -567,7 +567,7 @@ static int qigvm_directive_memory_map(QIgvm *ctx, const uint8_t *header_data,
 
             retval = ctx->cgsc->get_mem_map_entry(entry, &cgmm_entry, errp);
             while (retval == 0) {
-                if (entry > max_entry_count) {
+                if (entry >= max_entry_count) {
                     error_setg(
                         errp,
                         "IGVM: guest memory map size exceeds parameter area defined in IGVM file");