public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jim Paris <jim-XrPbb/hENzg@public.gmane.org>
To: Uri Lublin <uril-atKUWr5tajBWk0Htik3J/w@public.gmane.org>,
	kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Cc: Jim Paris <jim-XrPbb/hENzg@public.gmane.org>
Subject: [PATCH 1/3] qemu: fix freed pointer dereference
Date: Wed,  8 Aug 2007 16:22:47 -0400	[thread overview]
Message-ID: <11866045692122-git-send-email-jim@jtan.com> (raw)
In-Reply-To: <1186604569626-git-send-email-jim-XrPbb/hENzg@public.gmane.org>

If *has_error==0, s is freed before s->detach is used.  Save a copy of
s->detach earlier.

Signed-off-by: Jim Paris <jim-XrPbb/hENzg@public.gmane.org>
---

This shouldn't change much since the memory is most likely still
valid even after it's been freed, but it's still a bug.

 qemu/migration.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/qemu/migration.c b/qemu/migration.c
index 6053c98..4d7aa01 100644
--- a/qemu/migration.c
+++ b/qemu/migration.c
@@ -169,6 +169,7 @@ static void migrate_finish(MigrationState *s)
     int ret = 0;
     int *has_error = s->has_error;
     int saved_vm_running = vm_running;
+    int detach = s->detach;
 
     fcntl(s->fd, F_SETFL, 0);
 
@@ -194,7 +195,7 @@ static void migrate_finish(MigrationState *s)
 	if (saved_vm_running)
             vm_start();
     }
-    if (!s->detach)
+    if (!detach)
 	monitor_resume();
     qemu_free(has_error);
     cpu_physical_memory_set_dirty_tracking(0);
-- 
1.5.3.GIT


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

  parent reply	other threads:[~2007-08-08 20:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-08 20:22 migration with exec giving truncated images Jim Paris
     [not found] ` <1186604569626-git-send-email-jim-XrPbb/hENzg@public.gmane.org>
2007-08-08 20:22   ` Jim Paris [this message]
     [not found]     ` <11866045692122-git-send-email-jim-XrPbb/hENzg@public.gmane.org>
2007-08-08 20:22       ` [PATCH 2/3] qemu: don't start a new migration if one is already in progress Jim Paris
     [not found]         ` <1186604569652-git-send-email-jim-XrPbb/hENzg@public.gmane.org>
2007-08-08 20:22           ` [PATCH 3/3] qemu: reset buffer pointers after CR/LF Jim Paris
2007-08-09 21:42       ` [PATCH 1/3] qemu: fix freed pointer dereference Avi Kivity
2007-08-09 12:24   ` migration with exec giving truncated images Uri Lublin
     [not found]     ` <46BB0760.80405-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-08-14  3:56       ` Jim Paris
     [not found]         ` <20070814035659.GA10726-lSbMZ+N7itA@public.gmane.org>
2007-08-14  4:49           ` Jim Paris

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=11866045692122-git-send-email-jim@jtan.com \
    --to=jim-xrpbb/henzg@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=uril-atKUWr5tajBWk0Htik3J/w@public.gmane.org \
    /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