qemu/include
Marc-André Lureau 8720061c6d hw/display/virtio-gpu: cap submit_3d command buffer allocation
Both virgl_cmd_submit_3d() and rutabaga_cmd_submit_3d() pass the
guest-controlled cs.size directly to malloc() without bounds checking. A
malicious guest can set cs.size to an arbitrarily large value, causing
an OOM abort that crashes the QEMU process.

Checking cs.size against the descriptor payload length (iov_size) is not
sufficient: indirect descriptor tables can repeat entries aliasing the
same guest-physical range, inflating iov_size() to nearly 4 GiB while
referring to only a small amount of unique memory.

Instead, cap cs.size at 4 MiB. With 4 KiB pages and QEMU's
VIRTQUEUE_MAX_SIZE (1024) mapped-iov limit, the Linux virtio driver
cannot carry more than ~4 MiB of inline command data, so legitimate
submissions are unaffected.

Fixes: 9d9e152136 ("virtio-gpu: add 3d mode and virgl rendering support.")
Fixes: 1dcc6adbc1 ("gfxstream + rutabaga: add initial support for gfxstream")
Fixes: d52c454aad ("contrib: add vhost-user-gpu")
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3776
Reported-by: admin@fluentlogic.org
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2026-07-17 15:52:31 +04:00
..
accel accel/tcg: Improve docstrings around TCGCPUOps::*watchpoint* handlers 2026-07-06 15:42:18 +02:00
authz
block hw/nvme: add migration blockers for non-supported cases 2026-07-07 00:39:42 +02:00
chardev ui/console: default vc encoding to cp437 for machine < 11.1 2026-05-09 10:24:33 +04:00
crypto MAINTAINERS: Remove my disfunctional emails 2026-04-24 21:27:22 +02:00
disas disas: Make disassemble_info::target_info field const 2026-02-03 14:57:34 +01:00
exec accel/tcg: Use TLB_FORCE_SLOW not TLB_MMIO for user-only plugins 2026-07-07 09:48:42 -07:00
fpu fpu: Export floatN_minmax 2026-05-22 11:21:37 -07:00
gdbstub gdbstub: Introduce GdbBreakpointType enumerator 2026-07-06 15:42:18 +02:00
hw hw/display/virtio-gpu: cap submit_3d command buffer allocation 2026-07-17 15:52:31 +04:00
io io: invert the return semantics of qio_channel_flush 2026-05-21 12:39:54 +01:00
libdecnumber include/libdecnumber: replace FSF postal address with licenses URL 2025-06-26 00:42:37 +02:00
migration migration: Make switchover-ack re-usable 2026-07-07 07:12:46 +02:00
monitor monitor: eliminate monitor_is_hmp_non_interactive method 2026-07-07 11:16:25 +02:00
net net: mark struct ip6_header as QEMU_PACKED 2026-05-12 22:35:54 +02:00
plugins plugins: use int64_t for the syscall filter return value 2026-06-18 16:47:12 -07:00
qapi error: Fix "to current monitor if we have one" comments 2026-05-05 12:50:35 +02:00
qemu common-user: Move selfmap from util 2026-07-10 14:39:58 -07:00
qobject json-parser: add location to JSON parsing errors 2026-07-02 13:56:35 +02:00
qom qom: replace 'can_be_deleted' with 'prepare_delete' 2026-07-07 11:16:22 +02:00
scsi scsi: always send valid PREEMPT TYPE field 2026-05-08 16:40:03 +02:00
semihosting semihosting/uaccess: Use the cpu_internal_tswap() functions 2026-03-12 19:24:24 +00:00
standard-headers linux-headers: Update to Linux v7.2-rc1 with KVM_S390_VM_CPU_FEAT_ASTFLEIE2 2026-07-06 13:37:54 +02:00
system Monitor patches for 2026-07-07 2026-07-07 19:17:41 +02:00
tcg tcg: Include missing 'qemu/bitops.h' header in tcg-gvec-desc.h 2026-06-18 14:27:04 +02:00
ui ui/gtk: handle console hotplug/unplug events 2026-06-24 15:41:15 +04:00
user common-user: Move probe_guest_base from linux-user 2026-07-10 14:40:42 -07:00
elf.h elf: Add EF_MIPS_ARCH_ASE definitions 2025-09-02 17:57:05 +02:00
glib-compat.h glib-compat: add fallback for g_clear_fd/g_autofd 2026-06-24 15:41:14 +04:00
qemu-io.h
qemu-main.h ui & main loop: Redesign of system-specific main thread event handling 2024-12-31 21:21:34 +01:00