From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
intel-gfx@lists.freedesktop.org,
Daniel Vetter <daniel.vetter@ffwll.ch>,
stable@vger.kernel.org, dri-devel@lists.freedesktop.org,
Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: Re: [PATCH 1/2] drm/i915: Don't clobber the addfb2 ioctl params
Date: Wed, 11 Nov 2015 19:24:40 +0200 [thread overview]
Message-ID: <20151111172440.GL4437@intel.com> (raw)
In-Reply-To: <20151111172010.GI6247@nuc-i3427.alporthouse.com>
On Wed, Nov 11, 2015 at 05:20:10PM +0000, Chris Wilson wrote:
> On Wed, Nov 11, 2015 at 07:11:28PM +0200, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > We try to convert the old way of of specifying fb tiling (obj->tiling)
> > into the new fb modifiers. We store the result in the passed in mode_cmd
> > structure. But that structure comes directly from the addfb2 ioctl, and
> > gets copied back out to userspace, which means we're clobbering the
> > modifiers that the user provided (all 0 since the DRM_MODE_FB_MODIFIERS
> > flag wasn't even set by the user). Hence if the user reuses the struct
> > for another addfb2, the ioctl will be rejected since it's now asking for
> > some modifiers w/o the flag set.
>
> What do we actually pass back to userspace through the struct?
The fb id.
> Do we
> just want to
> -#define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, struct drm_mode_fb_cmd2)
> +#define DRM_IOCTL_MODE_ADDFB2 DRM_IOR(0xB8, struct drm_mode_fb_cmd2
> instead?
> -Chris
>
> --
> Chris Wilson, Intel Open Source Technology Centre
--
Ville Syrjälä
Intel OTC
WARNING: multiple messages have this Message-ID (diff)
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
intel-gfx@lists.freedesktop.org,
Daniel Vetter <daniel.vetter@ffwll.ch>,
stable@vger.kernel.org, dri-devel@lists.freedesktop.org,
Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: Re: [PATCH 1/2] drm/i915: Don't clobber the addfb2 ioctl params
Date: Wed, 11 Nov 2015 19:24:40 +0200 [thread overview]
Message-ID: <20151111172440.GL4437@intel.com> (raw)
In-Reply-To: <20151111172010.GI6247@nuc-i3427.alporthouse.com>
On Wed, Nov 11, 2015 at 05:20:10PM +0000, Chris Wilson wrote:
> On Wed, Nov 11, 2015 at 07:11:28PM +0200, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrj�l� <ville.syrjala@linux.intel.com>
> >
> > We try to convert the old way of of specifying fb tiling (obj->tiling)
> > into the new fb modifiers. We store the result in the passed in mode_cmd
> > structure. But that structure comes directly from the addfb2 ioctl, and
> > gets copied back out to userspace, which means we're clobbering the
> > modifiers that the user provided (all 0 since the DRM_MODE_FB_MODIFIERS
> > flag wasn't even set by the user). Hence if the user reuses the struct
> > for another addfb2, the ioctl will be rejected since it's now asking for
> > some modifiers w/o the flag set.
>
> What do we actually pass back to userspace through the struct?
The fb id.
> Do we
> just want to
> -#define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, struct drm_mode_fb_cmd2)
> +#define DRM_IOCTL_MODE_ADDFB2 DRM_IOR(0xB8, struct drm_mode_fb_cmd2
> instead?
> -Chris
>
> --
> Chris Wilson, Intel Open Source Technology Centre
--
Ville Syrj�l�
Intel OTC
next prev parent reply other threads:[~2015-11-11 17:24 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-11 17:11 [PATCH 1/2] drm/i915: Don't clobber the addfb2 ioctl params ville.syrjala
2015-11-11 17:11 ` [PATCH 2/2] drm: Pass the user drm_mode_fb_cmd2 as const to .fb_create() ville.syrjala
2015-11-16 15:20 ` Tvrtko Ursulin
2015-11-17 9:48 ` [Intel-gfx] " Daniel Vetter
2015-11-17 13:30 ` John Harrison
2015-11-17 14:45 ` [Intel-gfx] " Jani Nikula
2015-11-11 17:11 ` [PATCH i-g-t] tests/kms_addfb_basic: Add clobbered-modifier subtest ville.syrjala
2015-11-11 17:20 ` [PATCH 1/2] drm/i915: Don't clobber the addfb2 ioctl params Chris Wilson
2015-11-11 17:20 ` Chris Wilson
2015-11-11 17:24 ` Ville Syrjälä [this message]
2015-11-11 17:24 ` Ville Syrjälä
2015-11-11 17:36 ` Chris Wilson
2015-11-11 17:36 ` Chris Wilson
2015-11-17 9:47 ` Daniel Vetter
2015-11-17 9:47 ` Daniel Vetter
2015-11-17 11:04 ` Ville Syrjälä
2015-11-17 11:04 ` Ville Syrjälä
2015-11-17 13:00 ` [Intel-gfx] " Ville Syrjälä
2015-11-17 13:00 ` Ville Syrjälä
2015-11-17 14:45 ` Jani Nikula
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=20151111172440.GL4437@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=stable@vger.kernel.org \
--cc=tvrtko.ursulin@intel.com \
/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.