Skip to content

Commit 694f54f

Browse files
committed
Merge branch 'drm-misc-next-fixes' of git://anongit.freedesktop.org/drm/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
2 parents 9f36f9c + a01c477 commit 694f54f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/gpu/drm/drm_modes.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1611,7 +1611,13 @@ int drm_mode_convert_umode(struct drm_device *dev,
16111611
out->vscan = in->vscan;
16121612
out->vrefresh = in->vrefresh;
16131613
out->flags = in->flags;
1614-
out->type = in->type;
1614+
/*
1615+
* Old xf86-video-vmware (possibly others too) used to
1616+
* leave 'type' unititialized. Just ignore any bits we
1617+
* don't like. It's a just hint after all, and more
1618+
* useful for the kernel->userspace direction anyway.
1619+
*/
1620+
out->type = in->type & DRM_MODE_TYPE_ALL;
16151621
strncpy(out->name, in->name, DRM_DISPLAY_MODE_LEN);
16161622
out->name[DRM_DISPLAY_MODE_LEN-1] = 0;
16171623

0 commit comments

Comments
 (0)