[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-8.1.3 28/55] vfio/pci: Fix buffer overrun when writing the VF to
From: |
Michael Tokarev |
Subject: |
[Stable-8.1.3 28/55] vfio/pci: Fix buffer overrun when writing the VF token |
Date: |
Thu, 9 Nov 2023 16:42:32 +0300 |
From: Cédric Le Goater <clg@redhat.com>
qemu_uuid_unparse() includes a trailing NUL when writing the uuid
string and the buffer size should be UUID_FMT_LEN + 1 bytes. Use the
recently added UUID_STR_LEN which defines the correct size.
Fixes: CID 1522913
Fixes: 2dca1b37a760 ("vfio/pci: add support for VF token")
Cc: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: "Denis V. Lunev" <den@openvz.org>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
(cherry picked from commit f8d6f3b16c37bd516a026e92a31dade5d761d3a6)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index a205c6b113..aab02ebb98 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -2987,7 +2987,7 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
int groupid;
int i, ret;
bool is_mdev;
- char uuid[UUID_FMT_LEN];
+ char uuid[UUID_STR_LEN];
char *name;
if (!vbasedev->sysfsdev) {
--
2.39.2
- [Stable-8.1.3 21/55] block: Fix locking in media change monitor commands, (continued)
- [Stable-8.1.3 21/55] block: Fix locking in media change monitor commands, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 20/55] misc/led: LED state is set opposite of what is expected, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 17/55] hw/rdma/vmw/pvrdma_cmd: Use correct struct in query_port(), Michael Tokarev, 2023/11/09
- [Stable-8.1.3 19/55] target/arm: Fix syndrome for FGT traps on ERET, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 18/55] target/sparc: Clear may_lookup for npc == DYNAMIC_PC, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 25/55] target/arm: Fix SVE STR increment, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 22/55] tests/tcg: Add -fno-stack-protector, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 23/55] qemu-img: rebase: stop when reaching EOF of old backing file, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 24/55] qemu-iotests: 024: add rebasing test case for overlay_size > backing_size, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 26/55] target/arm: Correctly propagate stage 1 BTI guarded bit in a two-stage walk, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 28/55] vfio/pci: Fix buffer overrun when writing the VF token,
Michael Tokarev <=
- [Stable-8.1.3 27/55] util/uuid: Add UUID_STR_LEN definition, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 29/55] util/uuid: Remove UUID_FMT_LEN, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 30/55] i386/xen: Don't advertise XENFEAT_supervisor_mode_kernel, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 35/55] hw/xen: take iothread mutex in xen_evtchn_reset_op(), Michael Tokarev, 2023/11/09
- [Stable-8.1.3 32/55] hw/xen: select kernel mode for per-vCPU event channel upcall vector, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 31/55] i386/xen: fix per-vCPU upcall vector for Xen emulation, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 33/55] hw/xen: don't clear map_track[] in xen_gnttab_reset(), Michael Tokarev, 2023/11/09
- [Stable-8.1.3 34/55] hw/xen: fix XenStore watch delivery to guest, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 39/55] target/arm: Fix A64 LDRA immediate decode, Michael Tokarev, 2023/11/09
- [Stable-8.1.3 36/55] hw/xen: use correct default protocol for xen-block on x86, Michael Tokarev, 2023/11/09