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:
3e977ac
)
drm/i915: Reject attempted pwrites into a read-only object
author
Chris Wilson
<
[email protected]
>
Thu, 12 Jul 2018 18:53:14 +0000
(19:53 +0100)
committer
Chris Wilson
<
[email protected]
>
Fri, 13 Jul 2018 15:15:38 +0000
(16:15 +0100)
If the user created a read-only object, they should not be allowed to
circumvent the write protection using the pwrite ioctl.
Signed-off-by: Chris Wilson <
[email protected]
>
Cc: Jon Bloomfield <
[email protected]
>
Cc: Joonas Lahtinen <
[email protected]
>
Cc: Matthew Auld <
[email protected]
>
Reviewed-by: Jon Bloomfield <
[email protected]
>
Reviewed-by: Joonas Lahtinen <
[email protected]
>
Reviewed-by: Matthew Auld <
[email protected]
>
Link:
https://patchwork.freedesktop.org/patch/msgid/
[email protected]
drivers/gpu/drm/i915/i915_gem.c
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/i915/i915_gem.c
b/drivers/gpu/drm/i915/i915_gem.c
index 1910c66f48e28f37545d554d26b76d940031a352..42d24410a98c6b3474265e0d5b0aa50b86251d04 100644
(file)
--- a/
drivers/gpu/drm/i915/i915_gem.c
+++ b/
drivers/gpu/drm/i915/i915_gem.c
@@
-1627,6
+1627,12
@@
i915_gem_pwrite_ioctl(struct drm_device *dev, void *data,
goto err;
}
+ /* Writes not allowed into this read-only object */
+ if (i915_gem_object_is_readonly(obj)) {
+ ret = -EINVAL;
+ goto err;
+ }
+
trace_i915_gem_object_pwrite(obj, args->offset, args->size);
ret = -ENODEV;