* [PATCH] drm: Fix uabi regression by allowing garbage mode->type from userspace
@ 2018-03-21 21:12 Ville Syrjala
2018-03-21 21:40 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
` (4 more replies)
0 siblings, 5 replies; 8+ messages in thread
From: Ville Syrjala @ 2018-03-21 21:12 UTC (permalink / raw)
To: dri-devel; +Cc: Alex Deucher, intel-gfx
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Apparently xf86-video-vmware leaves the mode->type uninitialized
when feeding the mode to the kernel. Thus we have no choice but
to accept the garbage in. We'll just ignore any of the bits we
don't want. The mode type is just a hint anyway, and more
useful for the kernel->userspace direction.
Reported-by: Thomas Hellstrom <thomas@shipmail.org>
CC: Thomas Hellstrom <thomas@shipmail.org>
Cc: Adam Jackson <ajax@redhat.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Fixes: c6ed6dad5cfb ("drm/uapi: Validate the mode flags/type")
References: https://lists.freedesktop.org/archives/dri-devel/2018-March/170213.html
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/drm_modes.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index f6b7c0e36a1a..e82b61e08f8c 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -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;
--
2.16.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 8+ messages in thread
* ✗ Fi.CI.CHECKPATCH: warning for drm: Fix uabi regression by allowing garbage mode->type from userspace
2018-03-21 21:12 [PATCH] drm: Fix uabi regression by allowing garbage mode->type from userspace Ville Syrjala
@ 2018-03-21 21:40 ` Patchwork
2018-03-21 21:54 ` ✓ Fi.CI.BAT: success " Patchwork
` (3 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2018-03-21 21:40 UTC (permalink / raw)
To: Ville Syrjala; +Cc: intel-gfx
== Series Details ==
Series: drm: Fix uabi regression by allowing garbage mode->type from userspace
URL : https://patchwork.freedesktop.org/series/40416/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip
1ace93ec3e0c drm: Fix uabi regression by allowing garbage mode->type from userspace
-:21: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#21:
References: https://lists.freedesktop.org/archives/dri-devel/2018-March/170213.html
total: 0 errors, 1 warnings, 0 checks, 14 lines checked
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
* ✓ Fi.CI.BAT: success for drm: Fix uabi regression by allowing garbage mode->type from userspace
2018-03-21 21:12 [PATCH] drm: Fix uabi regression by allowing garbage mode->type from userspace Ville Syrjala
2018-03-21 21:40 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
@ 2018-03-21 21:54 ` Patchwork
2018-03-22 4:44 ` ✓ Fi.CI.IGT: " Patchwork
` (2 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2018-03-21 21:54 UTC (permalink / raw)
To: Ville Syrjala; +Cc: intel-gfx
== Series Details ==
Series: drm: Fix uabi regression by allowing garbage mode->type from userspace
URL : https://patchwork.freedesktop.org/series/40416/
State : success
== Summary ==
Series 40416v1 drm: Fix uabi regression by allowing garbage mode->type from userspace
https://patchwork.freedesktop.org/api/1.0/series/40416/revisions/1/mbox/
---- Known issues:
Test debugfs_test:
Subgroup read_all_entries:
incomplete -> PASS (fi-snb-2520m) fdo#103713
Test kms_flip:
Subgroup basic-flip-vs-wf_vblank:
fail -> PASS (fi-skl-6770hq) fdo#100368
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fi-bdw-5557u total:285 pass:264 dwarn:0 dfail:0 fail:0 skip:21 time:430s
fi-bdw-gvtdvm total:285 pass:261 dwarn:0 dfail:0 fail:0 skip:24 time:444s
fi-blb-e6850 total:285 pass:220 dwarn:1 dfail:0 fail:0 skip:64 time:379s
fi-bsw-n3050 total:285 pass:239 dwarn:0 dfail:0 fail:0 skip:46 time:534s
fi-bwr-2160 total:285 pass:180 dwarn:0 dfail:0 fail:0 skip:105 time:298s
fi-bxt-dsi total:285 pass:255 dwarn:0 dfail:0 fail:0 skip:30 time:517s
fi-bxt-j4205 total:285 pass:256 dwarn:0 dfail:0 fail:0 skip:29 time:510s
fi-byt-j1900 total:285 pass:250 dwarn:0 dfail:0 fail:0 skip:35 time:513s
fi-byt-n2820 total:285 pass:246 dwarn:0 dfail:0 fail:0 skip:39 time:508s
fi-cfl-8700k total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:418s
fi-cfl-s2 total:285 pass:259 dwarn:0 dfail:0 fail:0 skip:26 time:566s
fi-cfl-u total:285 pass:259 dwarn:0 dfail:0 fail:0 skip:26 time:512s
fi-cnl-drrs total:285 pass:254 dwarn:3 dfail:0 fail:0 skip:28 time:546s
fi-cnl-y3 total:285 pass:259 dwarn:0 dfail:0 fail:0 skip:26 time:579s
fi-elk-e7500 total:285 pass:225 dwarn:1 dfail:0 fail:0 skip:59 time:422s
fi-gdg-551 total:285 pass:176 dwarn:0 dfail:0 fail:1 skip:108 time:318s
fi-glk-1 total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:537s
fi-hsw-4770 total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:403s
fi-ilk-650 total:285 pass:225 dwarn:0 dfail:0 fail:0 skip:60 time:424s
fi-ivb-3520m total:285 pass:256 dwarn:0 dfail:0 fail:0 skip:29 time:475s
fi-ivb-3770 total:285 pass:252 dwarn:0 dfail:0 fail:0 skip:33 time:432s
fi-kbl-7500u total:285 pass:260 dwarn:1 dfail:0 fail:0 skip:24 time:476s
fi-kbl-7567u total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:469s
fi-kbl-r total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:514s
fi-pnv-d510 total:285 pass:219 dwarn:1 dfail:0 fail:0 skip:65 time:647s
fi-skl-6260u total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:439s
fi-skl-6600u total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:534s
fi-skl-6700k2 total:285 pass:261 dwarn:0 dfail:0 fail:0 skip:24 time:501s
fi-skl-6770hq total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:505s
fi-skl-guc total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:428s
fi-skl-gvtdvm total:285 pass:262 dwarn:0 dfail:0 fail:0 skip:23 time:445s
fi-snb-2520m total:285 pass:245 dwarn:0 dfail:0 fail:0 skip:40 time:575s
fi-snb-2600 total:285 pass:245 dwarn:0 dfail:0 fail:0 skip:40 time:406s
dff9ece60048108782aab6d6123822c1d34b0e5a drm-tip: 2018y-03m-21d-20h-44m-14s UTC integration manifest
1ace93ec3e0c drm: Fix uabi regression by allowing garbage mode->type from userspace
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8441/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
* ✓ Fi.CI.IGT: success for drm: Fix uabi regression by allowing garbage mode->type from userspace
2018-03-21 21:12 [PATCH] drm: Fix uabi regression by allowing garbage mode->type from userspace Ville Syrjala
2018-03-21 21:40 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2018-03-21 21:54 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2018-03-22 4:44 ` Patchwork
2018-03-22 7:42 ` [PATCH] " Thomas Hellstrom
2018-03-23 11:05 ` Daniel Stone
4 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2018-03-22 4:44 UTC (permalink / raw)
To: Ville Syrjala; +Cc: intel-gfx
== Series Details ==
Series: drm: Fix uabi regression by allowing garbage mode->type from userspace
URL : https://patchwork.freedesktop.org/series/40416/
State : success
== Summary ==
---- Known issues:
Test kms_flip:
Subgroup flip-vs-wf_vblank-interruptible:
fail -> PASS (shard-hsw) fdo#100368 +1
Test kms_frontbuffer_tracking:
Subgroup basic:
pass -> FAIL (shard-apl) fdo#103167
Test kms_pipe_crc_basic:
Subgroup read-crc-pipe-a-frame-sequence:
pass -> FAIL (shard-hsw) fdo#103481
Test kms_setmode:
Subgroup basic:
pass -> FAIL (shard-apl) fdo#99912
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103481 https://bugs.freedesktop.org/show_bug.cgi?id=103481
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
shard-apl total:3478 pass:1814 dwarn:1 dfail:0 fail:8 skip:1655 time:13071s
shard-hsw total:3478 pass:1766 dwarn:1 dfail:0 fail:3 skip:1707 time:11879s
shard-snb total:3478 pass:1357 dwarn:1 dfail:0 fail:3 skip:2117 time:7296s
Blacklisted hosts:
shard-kbl total:3478 pass:1940 dwarn:1 dfail:0 fail:9 skip:1528 time:9928s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8441/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] drm: Fix uabi regression by allowing garbage mode->type from userspace
2018-03-21 21:12 [PATCH] drm: Fix uabi regression by allowing garbage mode->type from userspace Ville Syrjala
` (2 preceding siblings ...)
2018-03-22 4:44 ` ✓ Fi.CI.IGT: " Patchwork
@ 2018-03-22 7:42 ` Thomas Hellstrom
2018-03-23 11:04 ` Maarten Lankhorst
2018-03-23 11:52 ` Ville Syrjälä
2018-03-23 11:05 ` Daniel Stone
4 siblings, 2 replies; 8+ messages in thread
From: Thomas Hellstrom @ 2018-03-22 7:42 UTC (permalink / raw)
To: Ville Syrjala, dri-devel; +Cc: Alex Deucher, intel-gfx
On 03/21/2018 10:12 PM, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Apparently xf86-video-vmware leaves the mode->type uninitialized
> when feeding the mode to the kernel. Thus we have no choice but
> to accept the garbage in. We'll just ignore any of the bits we
> don't want. The mode type is just a hint anyway, and more
> useful for the kernel->userspace direction.
>
> Reported-by: Thomas Hellstrom <thomas@shipmail.org>
> CC: Thomas Hellstrom <thomas@shipmail.org>
> Cc: Adam Jackson <ajax@redhat.com>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Fixes: c6ed6dad5cfb ("drm/uapi: Validate the mode flags/type")
> References: https://lists.freedesktop.org/archives/dri-devel/2018-March/170213.html
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/drm_modes.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> index f6b7c0e36a1a..e82b61e08f8c 100644
> --- a/drivers/gpu/drm/drm_modes.c
> +++ b/drivers/gpu/drm/drm_modes.c
> @@ -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;
>
Tested-by: Thomas Hellstrom <thellstrom@vmware.com>
Thanks,
Thomas
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] drm: Fix uabi regression by allowing garbage mode->type from userspace
2018-03-22 7:42 ` [PATCH] " Thomas Hellstrom
@ 2018-03-23 11:04 ` Maarten Lankhorst
2018-03-23 11:52 ` Ville Syrjälä
1 sibling, 0 replies; 8+ messages in thread
From: Maarten Lankhorst @ 2018-03-23 11:04 UTC (permalink / raw)
To: Thomas Hellstrom, Ville Syrjala, dri-devel; +Cc: Alex Deucher, intel-gfx
Op 22-03-18 om 08:42 schreef Thomas Hellstrom:
> On 03/21/2018 10:12 PM, Ville Syrjala wrote:
>> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>
>> Apparently xf86-video-vmware leaves the mode->type uninitialized
>> when feeding the mode to the kernel. Thus we have no choice but
>> to accept the garbage in. We'll just ignore any of the bits we
>> don't want. The mode type is just a hint anyway, and more
>> useful for the kernel->userspace direction.
>>
>> Reported-by: Thomas Hellstrom <thomas@shipmail.org>
>> CC: Thomas Hellstrom <thomas@shipmail.org>
>> Cc: Adam Jackson <ajax@redhat.com>
>> Cc: Alex Deucher <alexander.deucher@amd.com>
>> Fixes: c6ed6dad5cfb ("drm/uapi: Validate the mode flags/type")
>> References: https://lists.freedesktop.org/archives/dri-devel/2018-March/170213.html
>> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> ---
>> drivers/gpu/drm/drm_modes.c | 8 +++++++-
>> 1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
>> index f6b7c0e36a1a..e82b61e08f8c 100644
>> --- a/drivers/gpu/drm/drm_modes.c
>> +++ b/drivers/gpu/drm/drm_modes.c
>> @@ -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;
>>
>
> Tested-by: Thomas Hellstrom <thellstrom@vmware.com>
>
> Thanks,
>
> Thomas
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] drm: Fix uabi regression by allowing garbage mode->type from userspace
2018-03-21 21:12 [PATCH] drm: Fix uabi regression by allowing garbage mode->type from userspace Ville Syrjala
` (3 preceding siblings ...)
2018-03-22 7:42 ` [PATCH] " Thomas Hellstrom
@ 2018-03-23 11:05 ` Daniel Stone
4 siblings, 0 replies; 8+ messages in thread
From: Daniel Stone @ 2018-03-23 11:05 UTC (permalink / raw)
To: Ville Syrjala; +Cc: Alex Deucher, intel-gfx, dri-devel
On 21 March 2018 at 21:12, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> Apparently xf86-video-vmware leaves the mode->type uninitialized
> when feeding the mode to the kernel. Thus we have no choice but
> to accept the garbage in. We'll just ignore any of the bits we
> don't want. The mode type is just a hint anyway, and more
> useful for the kernel->userspace direction.
Reviewed-by: Daniel Stone <daniels@collabora.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] drm: Fix uabi regression by allowing garbage mode->type from userspace
2018-03-22 7:42 ` [PATCH] " Thomas Hellstrom
2018-03-23 11:04 ` Maarten Lankhorst
@ 2018-03-23 11:52 ` Ville Syrjälä
1 sibling, 0 replies; 8+ messages in thread
From: Ville Syrjälä @ 2018-03-23 11:52 UTC (permalink / raw)
To: Thomas Hellstrom; +Cc: Alex Deucher, intel-gfx, Adam Jackson, dri-devel
On Thu, Mar 22, 2018 at 08:42:11AM +0100, Thomas Hellstrom wrote:
> On 03/21/2018 10:12 PM, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Apparently xf86-video-vmware leaves the mode->type uninitialized
> > when feeding the mode to the kernel. Thus we have no choice but
> > to accept the garbage in. We'll just ignore any of the bits we
> > don't want. The mode type is just a hint anyway, and more
> > useful for the kernel->userspace direction.
> >
> > Reported-by: Thomas Hellstrom <thomas@shipmail.org>
> > CC: Thomas Hellstrom <thomas@shipmail.org>
> > Cc: Adam Jackson <ajax@redhat.com>
> > Cc: Alex Deucher <alexander.deucher@amd.com>
> > Fixes: c6ed6dad5cfb ("drm/uapi: Validate the mode flags/type")
> > References: https://lists.freedesktop.org/archives/dri-devel/2018-March/170213.html
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> > drivers/gpu/drm/drm_modes.c | 8 +++++++-
> > 1 file changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> > index f6b7c0e36a1a..e82b61e08f8c 100644
> > --- a/drivers/gpu/drm/drm_modes.c
> > +++ b/drivers/gpu/drm/drm_modes.c
> > @@ -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;
> >
>
> Tested-by: Thomas Hellstrom <thellstrom@vmware.com>
Thanks for the testing and reviews. And sorry for the extra hassle.
Pushed to drm-misc-next-fixes.
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-03-23 11:52 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-21 21:12 [PATCH] drm: Fix uabi regression by allowing garbage mode->type from userspace Ville Syrjala
2018-03-21 21:40 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2018-03-21 21:54 ` ✓ Fi.CI.BAT: success " Patchwork
2018-03-22 4:44 ` ✓ Fi.CI.IGT: " Patchwork
2018-03-22 7:42 ` [PATCH] " Thomas Hellstrom
2018-03-23 11:04 ` Maarten Lankhorst
2018-03-23 11:52 ` Ville Syrjälä
2018-03-23 11:05 ` Daniel Stone
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.