[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 05/23] replay: Fix dangling location bug in repla
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PATCH v2 05/23] replay: Fix dangling location bug in replay_configure() |
Date: |
Mon, 9 May 2016 13:07:49 +0100 |
From: Markus Armbruster <address@hidden>
replay_configure() pushes and pops a Location with automatic storage
duration. Except it fails to pop when -icount parameter "rr" isn't
given. cur_loc then points to unused stack space, and will most
likely get clobbered in short order.
Clobbered cur_loc can make loc_pop() and error_print_loc() crash or
report bogus locations.
Broken in commit 890ad55.
I didn't take the time to find a reproducer.
Cc: Eduardo Habkost <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
---
replay/replay.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/replay/replay.c b/replay/replay.c
index 7c2573a..167fd29 100644
--- a/replay/replay.c
+++ b/replay/replay.c
@@ -275,7 +275,7 @@ void replay_configure(QemuOpts *opts)
rr = qemu_opt_get(opts, "rr");
if (!rr) {
/* Just enabling icount */
- return;
+ goto out;
} else if (!strcmp(rr, "record")) {
mode = REPLAY_MODE_RECORD;
} else if (!strcmp(rr, "replay")) {
@@ -293,6 +293,7 @@ void replay_configure(QemuOpts *opts)
replay_enable(fname, mode);
+out:
loc_pop(&loc);
}
--
2.5.5
- [Qemu-devel] [PATCH v2 13/23] configure: Check if struct fsxattr is available from linux header, (continued)
- [Qemu-devel] [PATCH v2 13/23] configure: Check if struct fsxattr is available from linux header, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 15/23] Update version for v2.6.0-rc4 release, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 14/23] Revert "acpi: mark PMTIMER as unlocked", Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 18/23] libqos: drop duplicated virtio_config.h definitions, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 17/23] libqos: drop duplicated PCI vendor ID definition, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 19/23] libqos: drop duplicated virtio_ring.h bit definitions, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 16/23] libqos: use virtio_ids.h for device ID definitions, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 22/23] libqos: drop duplicated virtio_scsi.h definitions, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 20/23] libqos: drop duplicated virtio_vring.h structs, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 23/23] libqos: drop duplicated virtio_pci.h definitions, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 05/23] replay: Fix dangling location bug in replay_configure(),
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH v2 08/23] slirp: fix guest network access with darwin host, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 06/23] qom: -object error messages lost location, restore it, Stefan Hajnoczi, 2016/05/09
- Re: [Qemu-devel] [PATCH v2 00/23] libqos: use standard virtio headers, Stefan Hajnoczi, 2016/05/09
- [Qemu-devel] [PATCH v2 21/23] libqos: drop duplicated virtio_blk.h definitions, Stefan Hajnoczi, 2016/05/09