Page MenuHomeFreeBSD

virtio_gpu: Avoid panic if a 0x0 mode is provided
Needs ReviewPublic

Authored by val_packett.cool on Jun 25 2024, 5:09 AM.
Tags
None
Referenced Files
F163290427: D45724.diff
Tue, Jul 21, 6:56 PM
Unknown Object (File)
Mon, Jul 20, 1:54 AM
Unknown Object (File)
Thu, Jul 2, 1:09 AM
Unknown Object (File)
Mon, Jun 22, 4:32 PM
Unknown Object (File)
Jun 17 2026, 11:59 PM
Unknown Object (File)
Jun 15 2026, 12:14 PM
Unknown Object (File)
Jun 10 2026, 8:39 AM
Unknown Object (File)
Jun 4 2026, 7:51 AM
Subscribers

Details

Reviewers
andrew
Group Reviewers
Contributor Reviews (src)
Summary

On an amd64 QEMU host, using "-device virtio-gpu-gl" results in a 0x0
mode being provided, which would panic the kernel due to a zero-sized
allocation attempt. Suggest using virtio-vga(-gl) which does not have
that issue.

Sponsored by: Ihor Antonov <ihor@antonovs.family>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 58342
Build 55230: arc lint + arc unit

Event Timeline

emaste added inline comments.
sys/dev/virtio/gpu/virtio_gpu.c
507

It's not necessarily 0x0 (e.g. 640x0 would also trigger this). We could either do "skipping %ux%u" and include the width and height, or e.g. "skipping display mode with width/height 0"

Or just skip it without a message

@emaste are there any other blockers here other than your comment? The fix is quite straightforward and I see no reason not to land this.

I'll land it with the message changed