[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 03/21] Fix off-by-1 error in RAM migration code
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 03/21] Fix off-by-1 error in RAM migration code |
Date: |
Wed, 16 Jan 2013 10:49:05 -0600 |
From: David Gibson <address@hidden>
The code for migrating (or savevm-ing) memory pages starts off by creating
a dirty bitmap and filling it with 1s. Except, actually, because bit
addresses are 0-based it fills every bit except bit 0 with 1s and puts an
extra 1 beyond the end of the bitmap, potentially corrupting unrelated
memory. Oops. This patch fixes it.
Signed-off-by: David Gibson <address@hidden>
Signed-off-by: Anthony Liguori <address@hidden>
(cherry picked from commit 7ec81e56edc2b2007ce0ae3982aa5c18af9546ab)
Signed-off-by: Michael Roth <address@hidden>
---
arch_init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch_init.c b/arch_init.c
index e6effe8..b75a4c5 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -568,7 +568,7 @@ static int ram_save_setup(QEMUFile *f, void *opaque)
int64_t ram_pages = last_ram_offset() >> TARGET_PAGE_BITS;
migration_bitmap = bitmap_new(ram_pages);
- bitmap_set(migration_bitmap, 1, ram_pages);
+ bitmap_set(migration_bitmap, 0, ram_pages);
migration_dirty_pages = ram_pages;
bytes_transferred = 0;
--
1.7.9.5
- [Qemu-devel] Patch Round-up for stable 1.3.1, freeze Monday, Michael Roth, 2013/01/16
- [Qemu-devel] [PATCH 01/21] Fix semaphores fallback code, Michael Roth, 2013/01/16
- [Qemu-devel] [PATCH 02/21] Disable semaphores fallback code for OpenBSD, Michael Roth, 2013/01/16
- [Qemu-devel] [PATCH 03/21] Fix off-by-1 error in RAM migration code,
Michael Roth <=
- [Qemu-devel] [PATCH 04/21] migration: Fix madvise breakage if host and guest have different page sizes, Michael Roth, 2013/01/16
- [Qemu-devel] [PATCH 05/21] target-mips: Fix incorrect code and test for INSV, Michael Roth, 2013/01/16
- [Qemu-devel] [PATCH 06/21] target-mips: Fix incorrect shift for SHILO and SHILOV, Michael Roth, 2013/01/16
- [Qemu-devel] [PATCH 07/21] vfio-pci: Don't use kvm_irqchip_in_kernel, Michael Roth, 2013/01/16
- [Qemu-devel] [PATCH 11/21] target-xtensa: fix ITLB/DTLB page protection flags, Michael Roth, 2013/01/16
- [Qemu-devel] [PATCH 12/21] qxl: save qemu_create_displaysurface_from result, Michael Roth, 2013/01/16
- [Qemu-devel] [PATCH 10/21] pixman: fix vnc tight png/jpeg support, Michael Roth, 2013/01/16
- [Qemu-devel] [PATCH 08/21] seabios: update to e8a76b0f225bba5ba9d63ab227e0a37b3beb1059, Michael Roth, 2013/01/16
- [Qemu-devel] [PATCH 13/21] qxl+vnc: register a vm state change handler for dummy spice_server, Michael Roth, 2013/01/16
- [Qemu-devel] [PATCH 15/21] migration: fix migration_bitmap leak, Michael Roth, 2013/01/16