virtio-gpu: add sanity check
PATCH 1/1 virtio-gpu: add sanity check
Require a minimum 16x16 size for the scanout, to make sure the guest can't set either width or height to zero. This (a) doesn't make sense at all and (b) causes problems in some UI code. When using spice this will triggers an assert().
--- hw/display/virtio-gpu.c | 2 ++ 1 file changed, 2 insertions(+)
hw/display/virtio-gpu.c +2 -0
@@ -677,6 +677,8 @@ static void virtio_gpu_set_scanout(VirtIOGPU *g, if (ss.r.x > res->width || ss.r.y > res->height || + ss.r.width < 16 || + ss.r.height < 16 || ss.r.width > res->width || ss.r.height > res->height || ss.r.x + ss.r.width > res->width ||
Signature · 1 line
2.18.1
Quoted 8 lines · Gerd Hoffmann
Require a minimum 16x16 size for the scanout, to make sure the guest can't set either width or height to zero. This (a) doesn't make sense at all and (b) causes problems in some UI code. When using spice this will triggers an
assert().Reported-by Tyler Slabinski <[email protected]>Signed-off-by Gerd Hoffmann <[email protected]>
Quoted 21 lines
--- hw/display/virtio-gpu.c | 2 ++ 1 file changed, 2 insertions(+)hw/display/virtio-gpu.c +2
-1@@ -677,6 +677,8 @@ static void virtio_gpu_set_scanout(VirtIOGPU *g, if (ss.r.x > res->width || ss.r.y > res->height || + ss.r.width < 16 || + ss.r.height < 16 || ss.r.width > res->width || ss.r.height > res->height || ss.r.x + ss.r.width > res->width || --2.18.1
Signature · 1 line
Marc-André Lureau
Quoted 7 lines · Gerd Hoffmann
Require a minimum 16x16 size for the scanout, to make sure the guest can't set either width or height to zero. This (a) doesn't make sense at all and (b) causes problems in some UI code. When using spice this will triggers an
assert().Reported-by Tyler Slabinski <[email protected]>Signed-off-by Gerd Hoffmann <[email protected]>
OK. Worth adding to spec maybe.
Quoted 19 lines
--- hw/display/virtio-gpu.c | 2 ++ 1 file changed, 2 insertions(+)hw/display/virtio-gpu.c +2
-0@@ -677,6 +677,8 @@ static void virtio_gpu_set_scanout(VirtIOGPU *g, if (ss.r.x > res->width || ss.r.y > res->height || + ss.r.width < 16 || + ss.r.height < 16 || ss.r.width > res->width || ss.r.height > res->height || ss.r.x + ss.r.width > res->width ||Signature · 1 line
2.18.1