qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	"Li Zhijian" <lizhijian@cn.fujitsu.com>,
	"Juan Quintela" <quintela@redhat.com>
Subject: [PATCH 1/2] migration/rdma: Fix cm event use after free
Date: Wed,  2 Jun 2021 19:51:03 +0200	[thread overview]
Message-ID: <20210602175105.2522032-2-philmd@redhat.com> (raw)
In-Reply-To: <20210602175105.2522032-1-philmd@redhat.com>

From: Li Zhijian <lizhijian@cn.fujitsu.com>

Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20210602023506.3821293-1-lizhijian@cn.fujitsu.com>
[PMD: Do not add missing rdma_ack_cm_event() calls]
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 migration/rdma.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/migration/rdma.c b/migration/rdma.c
index 1cdb4561f32..b50ebb9183a 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -1539,8 +1539,10 @@ static int qemu_rdma_wait_comp_channel(RDMAContext *rdma)
 
                 if (pfds[1].revents) {
                     ret = rdma_get_cm_event(rdma->channel, &cm_event);
-                    if (!ret) {
-                        rdma_ack_cm_event(cm_event);
+                    if (ret) {
+                        error_report("failed to get cm event while wait "
+                                     "completion channel");
+                        return -EPIPE;
                     }
 
                     error_report("receive cm event while wait comp channel,"
-- 
2.26.3



  reply	other threads:[~2021-06-02 17:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-02 17:51 [RFC PATCH 0/2] migration/rdma: Enable use of g_autoptr with struct rdma_cm_event Philippe Mathieu-Daudé
2021-06-02 17:51 ` Philippe Mathieu-Daudé [this message]
2021-06-02 17:51 ` [RFC PATCH 2/2] " Philippe Mathieu-Daudé
2021-06-03  1:34   ` lizhijian
2021-06-03  9:30     ` Philippe Mathieu-Daudé
2021-06-03 12:57       ` lizhijian
2021-06-03 17:51   ` Dr. David Alan Gilbert

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=20210602175105.2522032-2-philmd@redhat.com \
    --to=philmd@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=lizhijian@cn.fujitsu.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.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).