Re: [PATCH 1/7] hw/display/virtio-gpu-rutabaga: zero-init capset info response

Daniel P. Berrangé <[email protected]> Mon, 27 Jul 2026 12:05:47 +0100
Newsgroups org.kernel.vger.linux-cxl,org.nongnu.qemu-devel
Message-ID <[email protected]>
On Sun, Jul 26, 2026 at 12:24:52PM +0400, Marc-André Lureau wrote:
> Hi
> 
> On Sun, Jul 26, 2026 at 11:33 AM Akihiko Odaki
> <[email protected]> wrote:
> >
> > On 2026/07/25 23:00, Marc-André Lureau wrote:
> > > rutabaga_cmd_get_capset_info() only fills in capset_id,
> > > capset_max_version and capset_max_size before sending the response to
> > > the guest. The remaining fields of struct virtio_gpu_resp_capset_info,
> > > including hdr.fence_id, hdr.ctx_id and hdr.ring_idx, are left with
> > > stack garbage and leaked to the guest, including host pointers useful
> > > for an ASLR bypass.
> > >
> > > Zero the response first, matching virgl_cmd_get_capset_info().
> > >
> > > Not a real risk thanks to -ftrivial-auto-var-init=zero.
> >
> > GCC only added -ftrivial-auto-var-init=zero in GCC 12, while QEMU still
> > supports GCC 10.4/11.

Opps, I thought we had new enough versions already.

> 
> Good point, may be we should update:
> https://patchew.org/QEMU/[email protected]/

I'm inclined to bump our min GCC/Clang versions so we can assume
zero-init.

We picked 10.5 due to NetBSD, and CentOS 9 still has 11.x

In both those cases, however, Clang is available in new enough
version to support -ftrivial-auto-var-init=zero. In NetBSD
there are also many new versions of GCC  available, only the
base system GCC is 10.5.


With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|