Skip to content

Commit f5869a8

Browse files
Alan Coxairlied
authored andcommitted
drm: stop vmgfx driver explosion
If you do a page flip with no flags set then event is NULL. If event is NULL then the vmw_gfx driver likes to go digging into NULL and extracts NULL->base.file_priv. On a modern kernel with NULL mapping protection it's just another oops, without it there are some "intriguing" possibilities. What it should do is an open question but that for the driver owners to sort out. Signed-off-by: Alan Cox <[email protected]> Reviewed-by: Jakob Bornecrantz <[email protected]> Cc: [email protected] Signed-off-by: Dave Airlie <[email protected]>
1 parent 85119c1 commit f5869a8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/gpu/drm/vmwgfx/vmwgfx_kms.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1688,15 +1688,19 @@ int vmw_du_page_flip(struct drm_crtc *crtc,
16881688
struct vmw_private *dev_priv = vmw_priv(crtc->dev);
16891689
struct drm_framebuffer *old_fb = crtc->fb;
16901690
struct vmw_framebuffer *vfb = vmw_framebuffer_to_vfb(fb);
1691-
struct drm_file *file_priv = event->base.file_priv;
1691+
struct drm_file *file_priv ;
16921692
struct vmw_fence_obj *fence = NULL;
16931693
struct drm_clip_rect clips;
16941694
int ret;
16951695

1696+
if (event == NULL)
1697+
return -EINVAL;
1698+
16961699
/* require ScreenObject support for page flipping */
16971700
if (!dev_priv->sou_priv)
16981701
return -ENOSYS;
16991702

1703+
file_priv = event->base.file_priv;
17001704
if (!vmw_kms_screen_object_flippable(dev_priv, crtc))
17011705
return -EINVAL;
17021706

0 commit comments

Comments
 (0)