[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 46/53] libvhost-user.c: add assertion to vu_message_read_defaul
From: |
Michael S. Tsirkin |
Subject: |
[PULL v2 46/53] libvhost-user.c: add assertion to vu_message_read_default |
Date: |
Wed, 4 Oct 2023 23:45:33 -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
- [PULL v2 45/53] pcie_sriov: unregister_vfs(): fix error path, (continued)
- [PULL v2 45/53] pcie_sriov: unregister_vfs(): fix error path, Michael S. Tsirkin, 2023/10/04
- [PULL v2 39/53] hw/pci-bridge/cxl-upstream: Add serial number extended capability support, Michael S. Tsirkin, 2023/10/04
- [PULL v2 42/53] vdpa net: follow VirtIO initialization properly at cvq isolation probing, Michael S. Tsirkin, 2023/10/04
- [PULL v2 36/53] hw/cxl: Add utility functions decoder interleave ways and target count., Michael S. Tsirkin, 2023/10/04
- [PULL v2 37/53] hw/cxl: Fix and use same calculation for HDM decoder block size everywhere, Michael S. Tsirkin, 2023/10/04
- [PULL v2 35/53] hw/cxl: Push cxl_decoder_count_enc() and cxl_decode_ig() into .c, Michael S. Tsirkin, 2023/10/04
- [PULL v2 38/53] hw/cxl: Support 4 HDM decoders at all levels of topology, Michael S. Tsirkin, 2023/10/04
- [PULL v2 41/53] vdpa net: stop probing if cannot set features, Michael S. Tsirkin, 2023/10/04
- [PULL v2 46/53] libvhost-user.c: add assertion to vu_message_read_default,
Michael S. Tsirkin <=
- [PULL v2 43/53] amd_iommu: Fix APIC address check, Michael S. Tsirkin, 2023/10/04
- [PULL v2 44/53] hw/i386/pc: improve physical address space bound check for 32-bit x86 systems, Michael S. Tsirkin, 2023/10/04
- [PULL v2 47/53] virtio: use shadow_avail_idx while checking number of heads, Michael S. Tsirkin, 2023/10/04
- [PULL v2 50/53] util/uuid: add a hash function, Michael S. Tsirkin, 2023/10/04
- [PULL v2 48/53] virtio: remove unnecessary thread fence while reading next descriptor, Michael S. Tsirkin, 2023/10/04
- [PULL v2 52/53] vhost-user: add shared_object msg, Michael S. Tsirkin, 2023/10/04
- [PULL v2 53/53] libvhost-user: handle shared_object msg, Michael S. Tsirkin, 2023/10/04
- [PULL v2 51/53] hw/display: introduce virtio-dmabuf, Michael S. Tsirkin, 2023/10/04
- [PULL v2 49/53] virtio: remove unused next argument from virtqueue_split_read_next_desc(), Michael S. Tsirkin, 2023/10/04
- Re: [PULL v2 00/53] virtio,pci: features, cleanups, Stefan Hajnoczi, 2023/10/05