Skip to content

Commit

Permalink
Merge branch 'drm-misc-next-fixes' of git://anongit.freedesktop.org/d…
Browse files Browse the repository at this point in the history
…rm/drm-misc into drm-next

- Mask mode type garbage from userspace (Ville)

Something went wrong on the misc tree side, but I'll pull the patch directly.

* 'drm-misc-next-fixes' of git://anongit.freedesktop.org/drm/drm-misc:
  drm: Fix uabi regression by allowing garbage mode->type from userspace
  • Loading branch information
Dave Airlie committed Mar 28, 2018
2 parents 9f36f9c + a01c477 commit 694f54f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/gpu/drm/drm_modes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1611,7 +1611,13 @@ int drm_mode_convert_umode(struct drm_device *dev,
out->vscan = in->vscan;
out->vrefresh = in->vrefresh;
out->flags = in->flags;
out->type = in->type;
/*
* Old xf86-video-vmware (possibly others too) used to
* leave 'type' unititialized. Just ignore any bits we
* don't like. It's a just hint after all, and more
* useful for the kernel->userspace direction anyway.
*/
out->type = in->type & DRM_MODE_TYPE_ALL;
strncpy(out->name, in->name, DRM_DISPLAY_MODE_LEN);
out->name[DRM_DISPLAY_MODE_LEN-1] = 0;

Expand Down

0 comments on commit 694f54f

Please sign in to comment.