mirror of https://gitlab.com/qemu-project/qemu
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
![]() Coverity reported a file descriptor leak (CID 1490785) that happens if `vhost_vdpa_get_max_queue_pairs()` returns 0, since in that case net_host_vdpa_init(), which should take ownership of the fd, is never called. vhost_vdpa_get_max_queue_pairs() returns 1 if VIRTIO_NET_F_MQ is not negotiated, or a negative error if the ioctl() fails, or the maximum number of queue pairs exposed by the device in the config space in the `max_virtqueue_pairs` field. In the VIRTIO spec we have: The device MUST set max_virtqueue_pairs to between 1 and 0x8000 inclusive, if it offers VIRTIO_NET_F_MQ. So, if `vhost_vdpa_get_max_queue_pairs()` returns 0, it's really an error since the device is violating the VIRTIO spec. Treat also `queue_pairs == 0` as an error, and jump to the `err` label, to return a negative value to the caller in any case. Coverity: CID 1490785 Suggested-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> Message-Id: <20250714101156.30024-1-sgarzare@redhat.com> Suggested-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> Acked-by: Jason Wang <jasowang@redhat.com> |
1 week ago | |
---|---|---|
.. | ||
can | 4 months ago | |
af-xdp.c | 4 weeks ago | |
announce.c | 3 years ago | |
checksum.c | 9 months ago | |
clients.h | 4 weeks ago | |
colo-compare.c | 4 months ago | |
colo-compare.h | 4 years ago | |
colo-stubs.c | 1 year ago | |
colo.c | 3 years ago | |
colo.h | 3 years ago | |
dgram.c | 2 years ago | |
dump.c | 4 months ago | |
eth.c | 2 years ago | |
filter-buffer.c | 4 months ago | |
filter-mirror.c | 4 months ago | |
filter-replay.c | 4 months ago | |
filter-rewriter.c | 4 months ago | |
filter.c | 4 months ago | |
hub.c | 4 weeks ago | |
hub.h | 6 years ago | |
l2tpv3.c | 3 years ago | |
meson.build | 4 weeks ago | |
net-hmp-cmds.c | 6 months ago | |
net.c | 4 weeks ago | |
netmap.c | 1 year ago | |
passt.c | 3 weeks ago | |
queue.c | 10 months ago | |
slirp.c | 6 months ago | |
socket.c | 2 months ago | |
stream.c | 4 weeks ago | |
stream_data.c | 4 weeks ago | |
stream_data.h | 4 weeks ago | |
tap-bsd.c | 1 year ago | |
tap-linux.c | 5 months ago | |
tap-linux.h | 2 years ago | |
tap-solaris.c | 1 year ago | |
tap-stub.c | 1 year ago | |
tap-win32.c | 4 weeks ago | |
tap.c | 3 weeks ago | |
tap_int.h | 1 year ago | |
trace-events | 1 year ago | |
trace.h | 5 years ago | |
util.c | 10 years ago | |
util.h | 3 years ago | |
vde.c | 3 years ago | |
vhost-user-stub.c | 4 weeks ago | |
vhost-user.c | 3 weeks ago | |
vhost-vdpa-stub.c | 3 years ago | |
vhost-vdpa.c | 1 week ago | |
vmnet-bridged.m | 1 year ago | |
vmnet-common.m | 5 months ago | |
vmnet-host.c | 1 year ago | |
vmnet-shared.c | 1 year ago | |
vmnet_int.h | 3 years ago |