All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Thomas Hellstrom <thomas@shipmail.org>
Cc: Alex Deucher <alexander.deucher@amd.com>,
	intel-gfx@lists.freedesktop.org, Adam Jackson <ajax@redhat.com>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm: Fix uabi regression by allowing garbage mode->type from userspace
Date: Fri, 23 Mar 2018 13:52:55 +0200	[thread overview]
Message-ID: <20180323115255.GP5453@intel.com> (raw)
In-Reply-To: <f2eabe8c-923d-3464-fdbd-54e8f04c2341@shipmail.org>

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

  parent reply	other threads:[~2018-03-23 11:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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ä [this message]
2018-03-23 11:05 ` Daniel Stone

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180323115255.GP5453@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=ajax@redhat.com \
    --cc=alexander.deucher@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=thomas@shipmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.