Re: [Intel-gfx] [PATCH] drm/i915: Reject undefined colorkey flags

2018-02-06 Thread Chris Wilson
Quoting Ville Syrjala (2018-02-06 20:43:33)
> From: Ville Syrjälä 
> 
> Check that userspace isn't passing in garbage in the colorkey
> ioctl flags.
> 
> Signed-off-by: Ville Syrjälä 

I think we can retrospectively apply this filter. Afaict, only the ddx
ever hooked up this interface.

Reviewed-by: Chris Wilson 
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH] drm/i915: Reject undefined colorkey flags

2018-02-06 Thread Ville Syrjala
From: Ville Syrjälä 

Check that userspace isn't passing in garbage in the colorkey
ioctl flags.

Signed-off-by: Ville Syrjälä 
---
 drivers/gpu/drm/i915/intel_sprite.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_sprite.c 
b/drivers/gpu/drm/i915/intel_sprite.c
index 3be22c0fcfb5..12a9536d7b7a 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -1077,6 +1077,9 @@ int intel_sprite_set_colorkey(struct drm_device *dev, 
void *data,
/* ignore the pointless "none" flag */
set->flags &= ~I915_SET_COLORKEY_NONE;
 
+   if (set->flags & ~(I915_SET_COLORKEY_DESTINATION | 
I915_SET_COLORKEY_SOURCE))
+   return -EINVAL;
+
/* Make sure we don't try to enable both src & dest simultaneously */
if ((set->flags & (I915_SET_COLORKEY_DESTINATION | 
I915_SET_COLORKEY_SOURCE)) == (I915_SET_COLORKEY_DESTINATION | 
I915_SET_COLORKEY_SOURCE))
return -EINVAL;
-- 
2.13.6

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx