[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 11/11] dump/win_dump: limit number of processed PRCBs
From: |
marcandre . lureau |
Subject: |
[PULL 11/11] dump/win_dump: limit number of processed PRCBs |
Date: |
Fri, 21 Oct 2022 17:05:49 +0400 |
From: Viktor Prutyanov <viktor.prutyanov@redhat.com>
When number of CPUs utilized by guest Windows is less than defined in
QEMU (i.e., desktop versions of Windows severely limits number of CPU
sockets), patch_and_save_context routine accesses non-existent PRCB and
fails. So, limit number of processed PRCBs by NumberProcessors taken
from guest Windows driver.
Signed-off-by: Viktor Prutyanov <viktor.prutyanov@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20221019235948.656411-1-viktor.prutyanov@redhat.com>
---
dump/win_dump.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/dump/win_dump.c b/dump/win_dump.c
index fd91350fbb..f20b6051b6 100644
--- a/dump/win_dump.c
+++ b/dump/win_dump.c
@@ -273,6 +273,13 @@ static void patch_and_save_context(WinDumpHeader *h, bool
x64,
uint64_t Context;
WinContext ctx;
+ if (i >= WIN_DUMP_FIELD(NumberProcessors)) {
+ warn_report("win-dump: number of QEMU CPUs is bigger than"
+ " NumberProcessors (%u) in guest Windows",
+ WIN_DUMP_FIELD(NumberProcessors));
+ return;
+ }
+
if (cpu_read_ptr(x64, first_cpu,
KiProcessorBlock + i * win_dump_ptr_size(x64),
&Prcb)) {
--
2.37.3
- [PULL 04/11] dump: Reintroduce memory_offset and section_offset, (continued)
- [PULL 04/11] dump: Reintroduce memory_offset and section_offset, marcandre . lureau, 2022/10/21
- [PULL 01/11] dump: Use a buffer for ELF section data and headers, marcandre . lureau, 2022/10/21
- [PULL 02/11] dump: Write ELF section headers right after ELF header, marcandre . lureau, 2022/10/21
- [PULL 03/11] dump: Reorder struct DumpState, marcandre . lureau, 2022/10/21
- [PULL 05/11] dump: Add architecture section and section string table support, marcandre . lureau, 2022/10/21
- [PULL 06/11] s390x: Add protected dump cap, marcandre . lureau, 2022/10/21
- [PULL 07/11] s390x: Introduce PV query interface, marcandre . lureau, 2022/10/21
- [PULL 09/11] s390x: Add KVM PV dump interface, marcandre . lureau, 2022/10/21
- [PULL 08/11] include/elf.h: add s390x note types, marcandre . lureau, 2022/10/21
- [PULL 10/11] s390x: pv: Add dump support, marcandre . lureau, 2022/10/21
- [PULL 11/11] dump/win_dump: limit number of processed PRCBs,
marcandre . lureau <=
- Re: [PULL 00/11] Dump patches, Stefan Hajnoczi, 2022/10/24