Files
qemu-reims-vgpu/include/hw
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
..
2025-12-27 10:11:08 +01:00
2026-03-09 16:45:24 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2026-02-04 08:24:29 +01:00
2026-07-01 19:59:10 +10:00
2026-06-03 08:36:42 -04:00
2026-02-27 14:22:07 +01:00
…
2026-01-20 19:51:36 +01:00
2025-12-27 10:11:08 +01:00