projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
928f0cd
)
drm/i915: Reject undefined colorkey flags
author
Ville Syrjälä
<
[email protected]
>
Tue, 6 Feb 2018 20:43:33 +0000
(22:43 +0200)
committer
Ville Syrjälä
<
[email protected]
>
Fri, 9 Feb 2018 16:03:36 +0000
(18:03 +0200)
Check that userspace isn't passing in garbage in the colorkey
ioctl flags.
Signed-off-by: Ville Syrjälä <
[email protected]
>
Link:
https://patchwork.freedesktop.org/patch/msgid/
[email protected]
Reviewed-by: Chris Wilson <
[email protected]
>
drivers/gpu/drm/i915/intel_sprite.c
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/i915/intel_sprite.c
b/drivers/gpu/drm/i915/intel_sprite.c
index 32f10621fac814a90045a6d5edaa8f0b93bed48d..d8900d09bef7219ed436d879b6241739c4ef35d0 100644
(file)
--- a/
drivers/gpu/drm/i915/intel_sprite.c
+++ b/
drivers/gpu/drm/i915/intel_sprite.c
@@
-1073,6
+1073,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;