[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 12/24] savevm: Fix load_snapshot error path crash
From: |
Nicholas Piggin |
Subject: |
[PATCH v5 12/24] savevm: Fix load_snapshot error path crash |
Date: |
Tue, 19 Mar 2024 01:46:09 +1000 |
An error path missed setting *errp, which can cause a NULL deref.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
migration/savevm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/migration/savevm.c b/migration/savevm.c
index 388d7af7cd..10c187dd10 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -3260,6 +3260,7 @@ bool load_snapshot(const char *name, const char *vmstate,
/* Don't even try to load empty VM states */
ret = bdrv_snapshot_find(bs_vm_state, &sn, name);
if (ret < 0) {
+ error_setg(errp, "Snapshot can not be found");
return false;
} else if (sn.vm_state_size == 0) {
error_setg(errp, "This is a disk-only snapshot. Revert to it "
--
2.42.0
- Re: [PATCH v5 06/24] tests/avocado: replay_kernel.py add x86-64 q35 machine test, (continued)
- [PATCH v5 07/24] chardev: set record/replay on the base device of a muxed device, Nicholas Piggin, 2024/03/18
- [PATCH v5 08/24] replay: Fix migration use of clock, Nicholas Piggin, 2024/03/18
- [PATCH v5 10/24] virtio-net: Use replay_schedule_bh_event for bhs that affect machine state, Nicholas Piggin, 2024/03/18
- [PATCH v5 09/24] replay: Fix migration replay_mutex locking, Nicholas Piggin, 2024/03/18
- [PATCH v5 11/24] virtio-net: Use virtual time for RSC timers, Nicholas Piggin, 2024/03/18
- [PATCH v5 12/24] savevm: Fix load_snapshot error path crash,
Nicholas Piggin <=
- [PATCH v5 13/24] tests/avocado: replay_linux.py remove the timeout expected guards, Nicholas Piggin, 2024/03/18
- [PATCH v5 15/24] tests/avocado: reverse_debugging.py add test for x86-64 q35 machine, Nicholas Piggin, 2024/03/18
- [PATCH v5 16/24] tests/avocado: reverse_debugging.py verify addresses between record and replay, Nicholas Piggin, 2024/03/18
- [PATCH v5 17/24] tests/avocado: reverse_debugging.py stop VM before sampling icount, Nicholas Piggin, 2024/03/18
- [PATCH v5 14/24] tests/avocado: reverse_debugging.py mark aarch64 and pseries as not flaky, Nicholas Piggin, 2024/03/18
- [PATCH v5 18/24] tests/avocado: reverse_debugging reverse-step at the end of the trace, Nicholas Piggin, 2024/03/18