qemu/subprojects
Michael S. Tsirkin bac345a99d libvduse: validate vq size
libvduse assumes that vq size (aka vq num) is below VIRTQUEUE_MAX_SIZE
and maps logs large enough based on this assumption.

However, vduse_queue_enable() accepts the vq size returned through
VDUSE_VQ_GET_INFO without validation, so a value above
VIRTQUEUE_MAX_SIZE (1024) overruns the inflight log and causes
out-of-bounds writes in vduse_queue_inflight_get().

According to the virtio spec, vq size can only be reduced, not
increased, so vq size must not exceed the previously configured
max_size, but the kernel vduse module does not validate this for us, and
we should not trust another process to follow the spec.

Validate and reject vq size values above VIRTQUEUE_MAX_SIZE.

Fixes: CVE-2026-61402
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3652
Reported-by: Jia Jia <physicalmtea@gmail.com>
Message-ID: <bf7e71b3139875e5e00fd53970c772d6c90dc2a1.1784888961.git.mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 733a98a552)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2026-07-31 11:08:41 +03:00
..
libvduse libvduse: validate vq size 2026-07-31 11:08:41 +03:00
libvhost-user libvhost-user: fix heap overflow in vu_check_queue_inflights 2026-07-31 11:08:41 +03:00
packagefiles rust: subprojects: add libc crate 2025-02-25 10:49:23 +01:00
.gitignore rust: subprojects: add libc crate 2025-02-25 10:49:23 +01:00
arbitrary-int-1-rs.wrap rust: hide warnings for subprojects 2025-01-10 23:34:44 +01:00
berkeley-softfloat-3.wrap subprojects: Use the correct .git suffix in the repository URLs 2023-09-21 11:31:18 +03:00
berkeley-testfloat-3.wrap subprojects: Use the correct .git suffix in the repository URLs 2023-09-21 11:31:18 +03:00
bilge-0.2-rs.wrap rust: hide warnings for subprojects 2025-01-10 23:34:44 +01:00
bilge-impl-0.2-rs.wrap rust: hide warnings for subprojects 2025-01-10 23:34:44 +01:00
dtc.wrap meson: subprojects: replace submodules with wrap files 2023-06-06 16:30:01 +02:00
either-1-rs.wrap rust: hide warnings for subprojects 2025-01-10 23:34:44 +01:00
itertools-0.11-rs.wrap rust: hide warnings for subprojects 2025-01-10 23:34:44 +01:00
keycodemapdb.wrap meson: subprojects: replace submodules with wrap files 2023-06-06 16:30:01 +02:00
libblkio.wrap subprojects: add wrap file for libblkio 2023-09-07 13:32:37 +02:00
libc-0.2-rs.wrap rust: subprojects: add libc crate 2025-02-25 10:49:23 +01:00
libvfio-user.wrap meson: subprojects: replace submodules with wrap files 2023-06-06 16:30:01 +02:00
proc-macro-error-1-rs.wrap rust: hide warnings for subprojects 2025-01-10 23:34:44 +01:00
proc-macro-error-attr-1-rs.wrap rust: hide warnings for subprojects 2025-01-10 23:34:44 +01:00
proc-macro2-1-rs.wrap rust: hide warnings for subprojects 2025-01-10 23:34:44 +01:00
quote-1-rs.wrap rust: hide warnings for subprojects 2025-01-10 23:34:44 +01:00
slirp.wrap subprojects: Use the correct .git suffix in the repository URLs 2023-09-21 11:31:18 +03:00
syn-2-rs.wrap rust: hide warnings for subprojects 2025-01-10 23:34:44 +01:00
unicode-ident-1-rs.wrap rust: hide warnings for subprojects 2025-01-10 23:34:44 +01:00