[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 56/63] libvhost-user.c: add assertion to vu_message_read_default
From: |
Michael S. Tsirkin |
Subject: |
[PULL 56/63] libvhost-user.c: add assertion to vu_message_read_default |
Date: |
Wed, 4 Oct 2023 04:46:09 -0400 |
From: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Explain Coverity that we are not going to overflow vmsg->fds.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Message-Id: <20230925194040.68592-5-vsementsov@yandex-team.ru>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
subprojects/libvhost-user/libvhost-user.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/subprojects/libvhost-user/libvhost-user.c
b/subprojects/libvhost-user/libvhost-user.c
index 0469a50101..49b57c7ef4 100644
--- a/subprojects/libvhost-user/libvhost-user.c
+++ b/subprojects/libvhost-user/libvhost-user.c
@@ -322,6 +322,7 @@ vu_message_read_default(VuDev *dev, int conn_fd,
VhostUserMsg *vmsg)
if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS) {
fd_size = cmsg->cmsg_len - CMSG_LEN(0);
vmsg->fd_num = fd_size / sizeof(int);
+ assert(fd_size < VHOST_MEMORY_BASELINE_NREGIONS);
memcpy(vmsg->fds, CMSG_DATA(cmsg), fd_size);
break;
}
--
MST
- Re: [PATCH v3] hw/cxl: Add QTG _DSM support for ACPI0017 device, (continued)
- [PULL 35/63] hw/i386/acpi-build: Use pc_madt_cpu_entry() directly, Michael S. Tsirkin, 2023/10/04
- [PULL 42/63] hw/acpi/core: Trace enable and status registers of GPE separately, Michael S. Tsirkin, 2023/10/04
- [PULL 48/63] hw/cxl: Support 4 HDM decoders at all levels of topology, Michael S. Tsirkin, 2023/10/04
- [PULL 51/63] vdpa net: stop probing if cannot set features, Michael S. Tsirkin, 2023/10/04
- [PULL 55/63] pcie_sriov: unregister_vfs(): fix error path, Michael S. Tsirkin, 2023/10/04
- [PULL 47/63] hw/cxl: Fix and use same calculation for HDM decoder block size everywhere, Michael S. Tsirkin, 2023/10/04
- [PULL 45/63] hw/cxl: Push cxl_decoder_count_enc() and cxl_decode_ig() into .c, Michael S. Tsirkin, 2023/10/04
- [PULL 60/63] util/uuid: add a hash function, Michael S. Tsirkin, 2023/10/04
- [PULL 53/63] amd_iommu: Fix APIC address check, Michael S. Tsirkin, 2023/10/04
- [PULL 56/63] libvhost-user.c: add assertion to vu_message_read_default,
Michael S. Tsirkin <=
- [PULL 61/63] hw/display: introduce virtio-dmabuf, Michael S. Tsirkin, 2023/10/04
- [PULL 57/63] virtio: use shadow_avail_idx while checking number of heads, Michael S. Tsirkin, 2023/10/04
- [PULL 40/63] hw/i386/acpi-build: Determine SMI command port just once, Michael S. Tsirkin, 2023/10/04
- [PULL 46/63] hw/cxl: Add utility functions decoder interleave ways and target count., Michael S. Tsirkin, 2023/10/04
- [PULL 54/63] hw/i386/pc: improve physical address space bound check for 32-bit x86 systems, Michael S. Tsirkin, 2023/10/04
- [PULL 52/63] vdpa net: follow VirtIO initialization properly at cvq isolation probing, Michael S. Tsirkin, 2023/10/04
- [PULL 59/63] virtio: remove unused next argument from virtqueue_split_read_next_desc(), Michael S. Tsirkin, 2023/10/04
- [PULL 63/63] libvhost-user: handle shared_object msg, Michael S. Tsirkin, 2023/10/04
- [PULL 62/63] vhost-user: add shared_object msg, Michael S. Tsirkin, 2023/10/04
- [PULL 43/63] vdpa: fix gcc cvq_isolated uninitialized variable warning, Michael S. Tsirkin, 2023/10/04