qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Stefano Garzarella <sgarzare@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Roy Hopkins <roy.hopkins@randomman.co.uk>,
	Ani Sinha <anisinha@redhat.com>,
	Luigi Leonardi <leonardi@redhat.com>,
	Gerd Hoffmann <kraxel@redhat.com>, Zhao Liu <zhao1.liu@intel.com>
Subject: [PATCH v5 2/5] igvm: fix off by one bug in memmap entry count checking
Date: Wed, 29 Oct 2025 11:55:52 +0100	[thread overview]
Message-ID: <20251029105555.2492276-3-kraxel@redhat.com> (raw)
In-Reply-To: <20251029105555.2492276-1-kraxel@redhat.com>

Fixes: c1d466d267 ("backends/igvm: Add IGVM loader and configuration")
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Luigi Leonardi <leonardi@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
---
 backends/igvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/backends/igvm.c b/backends/igvm.c
index 723d45b755a0..055bbba745ad 100644
--- a/backends/igvm.c
+++ b/backends/igvm.c
@@ -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");
-- 
2.51.0



  parent reply	other threads:[~2025-10-29 10:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-29 10:55 [PATCH v5 0/5] igvm: add support for igvm memory map parameter in native mode Gerd Hoffmann
2025-10-29 10:55 ` [PATCH v5 1/5] igvm: move igvm.h file to include/system Gerd Hoffmann
2025-10-29 10:55 ` Gerd Hoffmann [this message]
2025-10-29 10:55 ` [PATCH v5 3/5] igvm: add support for igvm memory map parameter in native mode Gerd Hoffmann
2025-10-29 10:55 ` [PATCH v5 4/5] igvm: add support for initial register state load " Gerd Hoffmann
2025-10-29 10:55 ` [PATCH v5 5/5] igvm: add MAINTAINERS entry Gerd Hoffmann
2025-10-29 11:22   ` Stefano Garzarella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251029105555.2492276-3-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=anisinha@redhat.com \
    --cc=leonardi@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=roy.hopkins@randomman.co.uk \
    --cc=sgarzare@redhat.com \
    --cc=zhao1.liu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).