[PATCH v3] drm/virtio: Fix handling CONFIG_DRM_VIRTIO_GPU_KMS option

Emil Velikov emil.velikov at collabora.com
Mon Mar 6 21:31:55 UTC 2023


On 2023/03/06, Dmitry Osipenko wrote:
> On 3/6/23 19:39, Dmitry Osipenko wrote:
> > VirtIO-GPU got a new config option for disabling KMS. There were two
> > problems left unnoticed during review when the new option was added:
> > 
> > 1. The IS_ENABLED(CONFIG_DRM_VIRTIO_GPU_KMS) check in the code was
> > inverted, hence KMS was disabled when it should be enabled and vice versa.
> > 
> > 2. The disabled KMS crashed kernel with a NULL dereference in
> > drm_kms_helper_hotplug_event(), which shall not be invoked with a
> > disabled KMS.
> > 
> > Fix the inverted config option check in the code and skip handling the
> > VIRTIO_GPU_EVENT_DISPLAY sent by host when KMS is disabled in guest to fix
> > the crash.
> > 
> > Acked-by: Gerd Hoffmann <kraxel at redhat.com>
> > Fixes: 72122c69d717 ("drm/virtio: Add option to disable KMS support")
> > Signed-off-by: Dmitry Osipenko <dmitry.osipenko at collabora.com>
> > ---
> 
> Added r-b from Emil and applied to misc-next
> 

For anyone wondering: I've sent that in private, adding here for posterity

Reviewed-by: Emil Velikov <emil.velikov at collabora.com>

-Emil


More information about the dri-devel mailing list