- qga-win: Fix guest-get-fsinfo multi-disks collection - hw/timer: fix systick trace message - virtio-net: correctly copy vnet header when flushing TX (CVE-2023-6693) - ui/clipboard: mark type as not available when there is no data (CVE-2023-6683) - esp: restrict non-DMA transfer length to that of available data (CVE-2024-24474) - hw/scsi/lsi53c895a: add missing decrement of reentrancy counter - hw/scsi/lsi53c895a: Fix reentrancy issues in the LSI controller (CVE-2023-0330) - net: Update MemReentrancyGuard for NIC (CVE-2023-3019) - net: Provide MemReentrancyGuard * to qemu_new_nic() Signed-off-by: Jiabo Feng <fengjiabo1@huawei.com> (cherry picked from commit 18db08e0e64d982b88ad7f29ccd49b19e8c656f0)
41 lines
1.5 KiB
Diff
41 lines
1.5 KiB
Diff
From bf48c640251cfe8d9ed7744bc88f5a858b694275 Mon Sep 17 00:00:00 2001
|
|
From: qihao <qihao_yewu@cmss.chinamobile.com>
|
|
Date: Wed, 7 Feb 2024 17:26:58 +0800
|
|
Subject: [PATCH] qga-win: Fix guest-get-fsinfo multi-disks collection
|
|
|
|
cheery-pick from 7c4486350a79532580a37d42abdeb1dc7e4fa6c9
|
|
|
|
When a volume has more than one disk, all disks cannot be
|
|
returned correctly because there is not enough malloced memory
|
|
for disk extents, so before executing DeviceIoControl for the
|
|
second time, get the correct size of the required memory space
|
|
to store all disk extents.
|
|
|
|
Details:
|
|
https://learn.microsoft.com/en-us/windows/win32/api/winioctl/ns-winioctl-volume_disk_extents
|
|
|
|
Signed-off-by: Peng Ji <peng.ji@smartx.com>
|
|
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
|
|
Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
|
|
Signed-off-by: qihao_yewu <qihao_yewu@cmss.chinamobile.com>
|
|
---
|
|
qga/commands-win32.c | 2 ++
|
|
1 file changed, 2 insertions(+)
|
|
|
|
diff --git a/qga/commands-win32.c b/qga/commands-win32.c
|
|
index 4e84afd83b..30e50f1769 100644
|
|
--- a/qga/commands-win32.c
|
|
+++ b/qga/commands-win32.c
|
|
@@ -904,6 +904,8 @@ static GuestDiskAddressList *build_guest_disk_info(char *guid, Error **errp)
|
|
DWORD last_err = GetLastError();
|
|
if (last_err == ERROR_MORE_DATA) {
|
|
/* Try once more with big enough buffer */
|
|
+ size = sizeof(VOLUME_DISK_EXTENTS) +
|
|
+ (sizeof(DISK_EXTENT) * (extents->NumberOfDiskExtents - 1));
|
|
g_free(extents);
|
|
extents = g_malloc0(size);
|
|
if (!DeviceIoControl(
|
|
--
|
|
2.27.0
|
|
|